diff options
author | Justin Clark-Casey (justincc) | 2011-07-09 00:35:30 +0100 |
---|---|---|
committer | Justin Clark-Casey (justincc) | 2011-07-09 00:35:30 +0100 |
commit | 5e8900dfd058bd103cb6dcf8a57dc94683efd878 (patch) | |
tree | a9962c79801fd6a3181fb72d026ae84e5c1097cd /OpenSim/Framework/PrimitiveBaseShape.cs | |
parent | When loading library asset set, only store an asset if it's different from an... (diff) | |
download | opensim-SC-5e8900dfd058bd103cb6dcf8a57dc94683efd878.zip opensim-SC-5e8900dfd058bd103cb6dcf8a57dc94683efd878.tar.gz opensim-SC-5e8900dfd058bd103cb6dcf8a57dc94683efd878.tar.bz2 opensim-SC-5e8900dfd058bd103cb6dcf8a57dc94683efd878.tar.xz |
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.
Diffstat (limited to 'OpenSim/Framework/PrimitiveBaseShape.cs')
-rw-r--r-- | OpenSim/Framework/PrimitiveBaseShape.cs | 46 |
1 files changed, 31 insertions, 15 deletions
diff --git a/OpenSim/Framework/PrimitiveBaseShape.cs b/OpenSim/Framework/PrimitiveBaseShape.cs index 7b5fb2e..8489ad8 100644 --- a/OpenSim/Framework/PrimitiveBaseShape.cs +++ b/OpenSim/Framework/PrimitiveBaseShape.cs | |||
@@ -213,6 +213,8 @@ namespace OpenSim.Framework | |||
213 | /// <param name="prim"></param> | 213 | /// <param name="prim"></param> |
214 | public PrimitiveBaseShape(Primitive prim) | 214 | public PrimitiveBaseShape(Primitive prim) |
215 | { | 215 | { |
216 | // m_log.DebugFormat("[PRIMITIVE BASE SHAPE]: Creating from {0}", prim.ID); | ||
217 | |||
216 | PCode = (byte)prim.PrimData.PCode; | 218 | PCode = (byte)prim.PrimData.PCode; |
217 | ExtraParams = new byte[1]; | 219 | ExtraParams = new byte[1]; |
218 | 220 | ||
@@ -613,29 +615,39 @@ namespace OpenSim.Framework | |||
613 | } | 615 | } |
614 | } | 616 | } |
615 | 617 | ||
616 | public byte SculptType { | 618 | public byte SculptType |
617 | get { | 619 | { |
620 | get | ||
621 | { | ||
618 | return _sculptType; | 622 | return _sculptType; |
619 | } | 623 | } |
620 | set { | 624 | set |
625 | { | ||
621 | _sculptType = value; | 626 | _sculptType = value; |
622 | } | 627 | } |
623 | } | 628 | } |
624 | 629 | ||
625 | public byte[] SculptData { | 630 | public byte[] SculptData |
626 | get { | 631 | { |
632 | get | ||
633 | { | ||
627 | return _sculptData; | 634 | return _sculptData; |
628 | } | 635 | } |
629 | set { | 636 | set |
637 | { | ||
638 | // m_log.DebugFormat("[PRIMITIVE BASE SHAPE]: Setting SculptData to data with length {0}", value.Length); | ||
630 | _sculptData = value; | 639 | _sculptData = value; |
631 | } | 640 | } |
632 | } | 641 | } |
633 | 642 | ||
634 | public int FlexiSoftness { | 643 | public int FlexiSoftness |
635 | get { | 644 | { |
645 | get | ||
646 | { | ||
636 | return _flexiSoftness; | 647 | return _flexiSoftness; |
637 | } | 648 | } |
638 | set { | 649 | set |
650 | { | ||
639 | _flexiSoftness = value; | 651 | _flexiSoftness = value; |
640 | } | 652 | } |
641 | } | 653 | } |
@@ -849,6 +861,8 @@ namespace OpenSim.Framework | |||
849 | 861 | ||
850 | public byte[] ExtraParamsToBytes() | 862 | public byte[] ExtraParamsToBytes() |
851 | { | 863 | { |
864 | // m_log.DebugFormat("[EXTRAPARAMS]: Called ExtraParamsToBytes()"); | ||
865 | |||
852 | ushort FlexiEP = 0x10; | 866 | ushort FlexiEP = 0x10; |
853 | ushort LightEP = 0x20; | 867 | ushort LightEP = 0x20; |
854 | ushort SculptEP = 0x30; | 868 | ushort SculptEP = 0x30; |
@@ -864,18 +878,21 @@ namespace OpenSim.Framework | |||
864 | TotalBytesLength += 16;// data | 878 | TotalBytesLength += 16;// data |
865 | TotalBytesLength += 2 + 4; // type | 879 | TotalBytesLength += 2 + 4; // type |
866 | } | 880 | } |
881 | |||
867 | if (_lightEntry) | 882 | if (_lightEntry) |
868 | { | 883 | { |
869 | ExtraParamsNum++; | 884 | ExtraParamsNum++; |
870 | TotalBytesLength += 16;// data | 885 | TotalBytesLength += 16;// data |
871 | TotalBytesLength += 2 + 4; // type | 886 | TotalBytesLength += 2 + 4; // type |
872 | } | 887 | } |
888 | |||
873 | if (_sculptEntry) | 889 | if (_sculptEntry) |
874 | { | 890 | { |
875 | ExtraParamsNum++; | 891 | ExtraParamsNum++; |
876 | TotalBytesLength += 17;// data | 892 | TotalBytesLength += 17;// data |
877 | TotalBytesLength += 2 + 4; // type | 893 | TotalBytesLength += 2 + 4; // type |
878 | } | 894 | } |
895 | |||
879 | if (_projectionEntry) | 896 | if (_projectionEntry) |
880 | { | 897 | { |
881 | ExtraParamsNum++; | 898 | ExtraParamsNum++; |
@@ -885,7 +902,6 @@ namespace OpenSim.Framework | |||
885 | 902 | ||
886 | byte[] returnbytes = new byte[TotalBytesLength]; | 903 | byte[] returnbytes = new byte[TotalBytesLength]; |
887 | 904 | ||
888 | |||
889 | // uint paramlength = ExtraParamsNum; | 905 | // uint paramlength = ExtraParamsNum; |
890 | 906 | ||
891 | // Stick in the number of parameters | 907 | // Stick in the number of parameters |
@@ -905,6 +921,7 @@ namespace OpenSim.Framework | |||
905 | Array.Copy(FlexiData, 0, returnbytes, i, FlexiData.Length); | 921 | Array.Copy(FlexiData, 0, returnbytes, i, FlexiData.Length); |
906 | i += FlexiData.Length; | 922 | i += FlexiData.Length; |
907 | } | 923 | } |
924 | |||
908 | if (_lightEntry) | 925 | if (_lightEntry) |
909 | { | 926 | { |
910 | byte[] LightData = GetLightBytes(); | 927 | byte[] LightData = GetLightBytes(); |
@@ -919,6 +936,7 @@ namespace OpenSim.Framework | |||
919 | Array.Copy(LightData, 0, returnbytes, i, LightData.Length); | 936 | Array.Copy(LightData, 0, returnbytes, i, LightData.Length); |
920 | i += LightData.Length; | 937 | i += LightData.Length; |
921 | } | 938 | } |
939 | |||
922 | if (_sculptEntry) | 940 | if (_sculptEntry) |
923 | { | 941 | { |
924 | byte[] SculptData = GetSculptBytes(); | 942 | byte[] SculptData = GetSculptBytes(); |
@@ -933,6 +951,7 @@ namespace OpenSim.Framework | |||
933 | Array.Copy(SculptData, 0, returnbytes, i, SculptData.Length); | 951 | Array.Copy(SculptData, 0, returnbytes, i, SculptData.Length); |
934 | i += SculptData.Length; | 952 | i += SculptData.Length; |
935 | } | 953 | } |
954 | |||
936 | if (_projectionEntry) | 955 | if (_projectionEntry) |
937 | { | 956 | { |
938 | byte[] ProjectionData = GetProjectionBytes(); | 957 | byte[] ProjectionData = GetProjectionBytes(); |
@@ -946,6 +965,7 @@ namespace OpenSim.Framework | |||
946 | Array.Copy(ProjectionData, 0, returnbytes, i, ProjectionData.Length); | 965 | Array.Copy(ProjectionData, 0, returnbytes, i, ProjectionData.Length); |
947 | i += ProjectionData.Length; | 966 | i += ProjectionData.Length; |
948 | } | 967 | } |
968 | |||
949 | if (!_flexiEntry && !_lightEntry && !_sculptEntry && !_projectionEntry) | 969 | if (!_flexiEntry && !_lightEntry && !_sculptEntry && !_projectionEntry) |
950 | { | 970 | { |
951 | byte[] returnbyte = new byte[1]; | 971 | byte[] returnbyte = new byte[1]; |
@@ -953,10 +973,7 @@ namespace OpenSim.Framework | |||
953 | return returnbyte; | 973 | return returnbyte; |
954 | } | 974 | } |
955 | 975 | ||
956 | |||
957 | return returnbytes; | 976 | return returnbytes; |
958 | //m_log.Info("[EXTRAPARAMS]: Length = " + m_shape.ExtraParams.Length.ToString()); | ||
959 | |||
960 | } | 977 | } |
961 | 978 | ||
962 | public void ReadInUpdateExtraParam(ushort type, bool inUse, byte[] data) | 979 | public void ReadInUpdateExtraParam(ushort type, bool inUse, byte[] data) |
@@ -1027,7 +1044,6 @@ namespace OpenSim.Framework | |||
1027 | extraParamCount = data[i++]; | 1044 | extraParamCount = data[i++]; |
1028 | } | 1045 | } |
1029 | 1046 | ||
1030 | |||
1031 | for (int k = 0; k < extraParamCount; k++) | 1047 | for (int k = 0; k < extraParamCount; k++) |
1032 | { | 1048 | { |
1033 | ushort epType = Utils.BytesToUInt16(data, i); | 1049 | ushort epType = Utils.BytesToUInt16(data, i); |
@@ -1071,7 +1087,6 @@ namespace OpenSim.Framework | |||
1071 | _sculptEntry = false; | 1087 | _sculptEntry = false; |
1072 | if (!lGotFilter) | 1088 | if (!lGotFilter) |
1073 | _projectionEntry = false; | 1089 | _projectionEntry = false; |
1074 | |||
1075 | } | 1090 | } |
1076 | 1091 | ||
1077 | public void ReadSculptData(byte[] data, int pos) | 1092 | public void ReadSculptData(byte[] data, int pos) |
@@ -1100,6 +1115,7 @@ namespace OpenSim.Framework | |||
1100 | if (_sculptType != (byte)1 && _sculptType != (byte)2 && _sculptType != (byte)3 && _sculptType != (byte)4) | 1115 | if (_sculptType != (byte)1 && _sculptType != (byte)2 && _sculptType != (byte)3 && _sculptType != (byte)4) |
1101 | _sculptType = 4; | 1116 | _sculptType = 4; |
1102 | } | 1117 | } |
1118 | |||
1103 | _sculptTexture = SculptUUID; | 1119 | _sculptTexture = SculptUUID; |
1104 | _sculptType = SculptTypel; | 1120 | _sculptType = SculptTypel; |
1105 | //m_log.Info("[SCULPT]:" + SculptUUID.ToString()); | 1121 | //m_log.Info("[SCULPT]:" + SculptUUID.ToString()); |