aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Framework/PrimitiveBaseShape.cs
diff options
context:
space:
mode:
authorUbitUmarov2018-12-28 13:28:25 +0000
committerUbitUmarov2018-12-28 13:28:25 +0000
commit0cf5876c4521349a1f9734ee8331769a6a6f8ef8 (patch)
treede4fa1f9ac0675c882ba739ba2cf6bd22bc85fbd /OpenSim/Framework/PrimitiveBaseShape.cs
parentsome retouchs on animationset code (diff)
downloadopensim-SC-0cf5876c4521349a1f9734ee8331769a6a6f8ef8.zip
opensim-SC-0cf5876c4521349a1f9734ee8331769a6a6f8ef8.tar.gz
opensim-SC-0cf5876c4521349a1f9734ee8331769a6a6f8ef8.tar.bz2
opensim-SC-0cf5876c4521349a1f9734ee8331769a6a6f8ef8.tar.xz
update pbs
Diffstat (limited to '')
-rw-r--r--OpenSim/Framework/PrimitiveBaseShape.cs71
1 files changed, 64 insertions, 7 deletions
diff --git a/OpenSim/Framework/PrimitiveBaseShape.cs b/OpenSim/Framework/PrimitiveBaseShape.cs
index 5d02eec..a5f3ba6 100644
--- a/OpenSim/Framework/PrimitiveBaseShape.cs
+++ b/OpenSim/Framework/PrimitiveBaseShape.cs
@@ -133,17 +133,26 @@ namespace OpenSim.Framework
133 [XmlIgnore] private float _lightCutoff; 133 [XmlIgnore] private float _lightCutoff;
134 [XmlIgnore] private float _lightFalloff; 134 [XmlIgnore] private float _lightFalloff;
135 [XmlIgnore] private float _lightIntensity = 1.0f; 135 [XmlIgnore] private float _lightIntensity = 1.0f;
136 [XmlIgnore] private bool _flexiEntry; 136
137 [XmlIgnore] private bool _lightEntry;
138 [XmlIgnore] private bool _sculptEntry;
139 137
140 // Light Projection Filter 138 // Light Projection Filter
141 [XmlIgnore] private bool _projectionEntry;
142 [XmlIgnore] private UUID _projectionTextureID; 139 [XmlIgnore] private UUID _projectionTextureID;
143 [XmlIgnore] private float _projectionFOV; 140 [XmlIgnore] private float _projectionFOV;
144 [XmlIgnore] private float _projectionFocus; 141 [XmlIgnore] private float _projectionFocus;
145 [XmlIgnore] private float _projectionAmb; 142 [XmlIgnore] private float _projectionAmb;
146 143
144 [XmlIgnore] private uint _meshFlags;
145
146 [XmlIgnore] private bool _flexiEntry;
147 [XmlIgnore] private bool _lightEntry;
148 [XmlIgnore] private bool _sculptEntry;
149 [XmlIgnore] private bool _projectionEntry;
150 [XmlIgnore] private bool _meshFlagsEntry;
151
152 public bool MeshFlagEntry
153 {
154 get { return _meshFlagsEntry;}
155 }
147 public byte ProfileCurve 156 public byte ProfileCurve
148 { 157 {
149 get { return (byte)((byte)HollowShape | (byte)ProfileShape); } 158 get { return (byte)((byte)HollowShape | (byte)ProfileShape); }
@@ -1030,6 +1039,7 @@ namespace OpenSim.Framework
1030 const byte LightEP = 0x20; 1039 const byte LightEP = 0x20;
1031 const byte SculptEP = 0x30; 1040 const byte SculptEP = 0x30;
1032 const byte ProjectionEP = 0x40; 1041 const byte ProjectionEP = 0x40;
1042 const byte MeshFlagsEP = 0x70;
1033 1043
1034 int TotalBytesLength = 1; // ExtraParamsNum 1044 int TotalBytesLength = 1; // ExtraParamsNum
1035 1045
@@ -1058,6 +1068,11 @@ namespace OpenSim.Framework
1058 TotalBytesLength += 28 + 2 + 4; // data 1068 TotalBytesLength += 28 + 2 + 4; // data
1059 } 1069 }
1060 1070
1071 if (_meshFlagsEntry)
1072 {
1073 ExtraParamsNum++;
1074 TotalBytesLength += 4 + 2 + 4; // data
1075 }
1061 byte[] returnBytes = new byte[TotalBytesLength]; 1076 byte[] returnBytes = new byte[TotalBytesLength];
1062 1077
1063 returnBytes[0] = (byte)ExtraParamsNum; 1078 returnBytes[0] = (byte)ExtraParamsNum;
@@ -1124,12 +1139,23 @@ namespace OpenSim.Framework
1124 i += 4; 1139 i += 4;
1125 1140
1126 _projectionTextureID.GetBytes().CopyTo(returnBytes, i); 1141 _projectionTextureID.GetBytes().CopyTo(returnBytes, i);
1127 Utils.FloatToBytes(_projectionFOV).CopyTo(returnBytes, i + 16); 1142 Utils.FloatToBytes(_projectionFOV, returnBytes, i + 16);
1128 Utils.FloatToBytes(_projectionFocus).CopyTo(returnBytes, i + 20); 1143 Utils.FloatToBytes(_projectionFocus, returnBytes, i + 20);
1129 Utils.FloatToBytes(_projectionAmb).CopyTo(returnBytes, i + 24); 1144 Utils.FloatToBytes(_projectionAmb, returnBytes, i + 24);
1145 i += 28;
1146 }
1147
1148 if (_meshFlagsEntry)
1149 {
1150 returnBytes[i] = MeshFlagsEP;
1151 i += 2;
1152 returnBytes[i] = 4;
1153 i += 4;
1154 Utils.UIntToBytes(_meshFlags, returnBytes, i);
1130 } 1155 }
1131 1156
1132 return returnBytes; 1157 return returnBytes;
1158
1133 } 1159 }
1134 1160
1135 public void ReadInUpdateExtraParam(ushort type, bool inUse, byte[] data) 1161 public void ReadInUpdateExtraParam(ushort type, bool inUse, byte[] data)
@@ -1138,6 +1164,7 @@ namespace OpenSim.Framework
1138 const ushort LightEP = 0x20; 1164 const ushort LightEP = 0x20;
1139 const ushort SculptEP = 0x30; 1165 const ushort SculptEP = 0x30;
1140 const ushort ProjectionEP = 0x40; 1166 const ushort ProjectionEP = 0x40;
1167 const ushort MeshFlagsEP = 0x70;
1141 1168
1142 switch (type) 1169 switch (type)
1143 { 1170 {
@@ -1175,6 +1202,14 @@ namespace OpenSim.Framework
1175 } 1202 }
1176 ReadProjectionData(data, 0); 1203 ReadProjectionData(data, 0);
1177 break; 1204 break;
1205 case MeshFlagsEP:
1206 if (!inUse)
1207 {
1208 _meshFlagsEntry = false;
1209 return;
1210 }
1211 ReadMeshFlagsData(data, 0);
1212 break;
1178 } 1213 }
1179 } 1214 }
1180 1215
@@ -1187,6 +1222,7 @@ namespace OpenSim.Framework
1187 _lightEntry = false; 1222 _lightEntry = false;
1188 _sculptEntry = false; 1223 _sculptEntry = false;
1189 _projectionEntry = false; 1224 _projectionEntry = false;
1225 _meshFlagsEntry = false;
1190 1226
1191 if (data.Length == 1) 1227 if (data.Length == 1)
1192 return; 1228 return;
@@ -1195,6 +1231,7 @@ namespace OpenSim.Framework
1195 const byte LightEP = 0x20; 1231 const byte LightEP = 0x20;
1196 const byte SculptEP = 0x30; 1232 const byte SculptEP = 0x30;
1197 const byte ProjectionEP = 0x40; 1233 const byte ProjectionEP = 0x40;
1234 const byte MeshFlagsEP = 0x70;
1198 1235
1199 byte extraParamCount = data[0]; 1236 byte extraParamCount = data[0];
1200 int i = 1; 1237 int i = 1;
@@ -1219,10 +1256,16 @@ namespace OpenSim.Framework
1219 ReadSculptData(data, i); 1256 ReadSculptData(data, i);
1220 i += 17; 1257 i += 17;
1221 break; 1258 break;
1259
1222 case ProjectionEP: 1260 case ProjectionEP:
1223 ReadProjectionData(data, i); 1261 ReadProjectionData(data, i);
1224 i += 28; 1262 i += 28;
1225 break; 1263 break;
1264
1265 case MeshFlagsEP:
1266 ReadMeshFlagsData(data, i);
1267 i += 4;
1268 break;
1226 } 1269 }
1227 } 1270 }
1228 } 1271 }
@@ -1323,6 +1366,20 @@ namespace OpenSim.Framework
1323 } 1366 }
1324 } 1367 }
1325 1368
1369 public void ReadMeshFlagsData(byte[] data, int pos)
1370 {
1371 if (data.Length - pos >= 4)
1372 {
1373 _meshFlagsEntry = true;
1374 _meshFlags = Utils.BytesToUInt(data, pos);
1375 }
1376 else
1377 {
1378 _meshFlagsEntry = true;
1379 _meshFlags = 0;
1380 }
1381 }
1382
1326 /// <summary> 1383 /// <summary>
1327 /// Creates a OpenMetaverse.Primitive and populates it with converted PrimitiveBaseShape values 1384 /// Creates a OpenMetaverse.Primitive and populates it with converted PrimitiveBaseShape values
1328 /// </summary> 1385 /// </summary>