minor: code tidy and inserted log lines for future use.

Unable to get to the bottom of why resizing a mesh fails to properly reset the physics proxy, when toggling phantom does
After a mesh is generated, the existing sculptdata is set to zero in PrimitiveBaseShape to save memory
When phantom is toggled, the sculptdata is regenerated before remeshing.
But on resize, the sculptdata is not regenerated.
So clearly, resetting sculptdata is possible, but haven't quite been able to pin down how this is being done when phantom is toggled.
This commit is contained in:
Justin Clark-Casey (justincc)
2011-07-09 00:35:30 +01:00
parent c3d82bdcb1
commit 5e8900dfd0
7 changed files with 72 additions and 43 deletions

View File

@@ -213,6 +213,8 @@ namespace OpenSim.Framework
/// <param name="prim"></param>
public PrimitiveBaseShape(Primitive prim)
{
// m_log.DebugFormat("[PRIMITIVE BASE SHAPE]: Creating from {0}", prim.ID);
PCode = (byte)prim.PrimData.PCode;
ExtraParams = new byte[1];
@@ -613,29 +615,39 @@ namespace OpenSim.Framework
}
}
public byte SculptType {
get {
public byte SculptType
{
get
{
return _sculptType;
}
set {
set
{
_sculptType = value;
}
}
public byte[] SculptData {
get {
public byte[] SculptData
{
get
{
return _sculptData;
}
set {
set
{
// m_log.DebugFormat("[PRIMITIVE BASE SHAPE]: Setting SculptData to data with length {0}", value.Length);
_sculptData = value;
}
}
public int FlexiSoftness {
get {
public int FlexiSoftness
{
get
{
return _flexiSoftness;
}
set {
set
{
_flexiSoftness = value;
}
}
@@ -849,6 +861,8 @@ namespace OpenSim.Framework
public byte[] ExtraParamsToBytes()
{
// m_log.DebugFormat("[EXTRAPARAMS]: Called ExtraParamsToBytes()");
ushort FlexiEP = 0x10;
ushort LightEP = 0x20;
ushort SculptEP = 0x30;
@@ -864,18 +878,21 @@ namespace OpenSim.Framework
TotalBytesLength += 16;// data
TotalBytesLength += 2 + 4; // type
}
if (_lightEntry)
{
ExtraParamsNum++;
TotalBytesLength += 16;// data
TotalBytesLength += 2 + 4; // type
}
if (_sculptEntry)
{
ExtraParamsNum++;
TotalBytesLength += 17;// data
TotalBytesLength += 2 + 4; // type
}
if (_projectionEntry)
{
ExtraParamsNum++;
@@ -885,7 +902,6 @@ namespace OpenSim.Framework
byte[] returnbytes = new byte[TotalBytesLength];
// uint paramlength = ExtraParamsNum;
// Stick in the number of parameters
@@ -905,6 +921,7 @@ namespace OpenSim.Framework
Array.Copy(FlexiData, 0, returnbytes, i, FlexiData.Length);
i += FlexiData.Length;
}
if (_lightEntry)
{
byte[] LightData = GetLightBytes();
@@ -919,6 +936,7 @@ namespace OpenSim.Framework
Array.Copy(LightData, 0, returnbytes, i, LightData.Length);
i += LightData.Length;
}
if (_sculptEntry)
{
byte[] SculptData = GetSculptBytes();
@@ -933,6 +951,7 @@ namespace OpenSim.Framework
Array.Copy(SculptData, 0, returnbytes, i, SculptData.Length);
i += SculptData.Length;
}
if (_projectionEntry)
{
byte[] ProjectionData = GetProjectionBytes();
@@ -946,6 +965,7 @@ namespace OpenSim.Framework
Array.Copy(ProjectionData, 0, returnbytes, i, ProjectionData.Length);
i += ProjectionData.Length;
}
if (!_flexiEntry && !_lightEntry && !_sculptEntry && !_projectionEntry)
{
byte[] returnbyte = new byte[1];
@@ -953,10 +973,7 @@ namespace OpenSim.Framework
return returnbyte;
}
return returnbytes;
//m_log.Info("[EXTRAPARAMS]: Length = " + m_shape.ExtraParams.Length.ToString());
}
public void ReadInUpdateExtraParam(ushort type, bool inUse, byte[] data)
@@ -1027,7 +1044,6 @@ namespace OpenSim.Framework
extraParamCount = data[i++];
}
for (int k = 0; k < extraParamCount; k++)
{
ushort epType = Utils.BytesToUInt16(data, i);
@@ -1071,7 +1087,6 @@ namespace OpenSim.Framework
_sculptEntry = false;
if (!lGotFilter)
_projectionEntry = false;
}
public void ReadSculptData(byte[] data, int pos)
@@ -1100,6 +1115,7 @@ namespace OpenSim.Framework
if (_sculptType != (byte)1 && _sculptType != (byte)2 && _sculptType != (byte)3 && _sculptType != (byte)4)
_sculptType = 4;
}
_sculptTexture = SculptUUID;
_sculptType = SculptTypel;
//m_log.Info("[SCULPT]:" + SculptUUID.ToString());