aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Region/Framework
diff options
context:
space:
mode:
Diffstat (limited to 'OpenSim/Region/Framework')
-rw-r--r--OpenSim/Region/Framework/Scenes/SceneObjectPart.cs64
1 files changed, 38 insertions, 26 deletions
diff --git a/OpenSim/Region/Framework/Scenes/SceneObjectPart.cs b/OpenSim/Region/Framework/Scenes/SceneObjectPart.cs
index 4ab0f15..13b3ffb 100644
--- a/OpenSim/Region/Framework/Scenes/SceneObjectPart.cs
+++ b/OpenSim/Region/Framework/Scenes/SceneObjectPart.cs
@@ -248,11 +248,7 @@ namespace OpenSim.Region.Framework.Scenes
248 248
249 public scriptEvents AggregateScriptEvents; 249 public scriptEvents AggregateScriptEvents;
250 250
251 public Vector3 AttachedPos 251 public Vector3 AttachedPos { get; set; }
252 {
253 get;
254 set;
255 }
256 252
257 // rotation locks on local X,Y and or Z axis bit flags 253 // rotation locks on local X,Y and or Z axis bit flags
258 // bits are as in llSetStatus defined in SceneObjectGroup.axisSelect enum 254 // bits are as in llSetStatus defined in SceneObjectGroup.axisSelect enum
@@ -955,13 +951,6 @@ namespace OpenSim.Region.Framework.Scenes
955 m_log.Error("[SCENEOBJECTPART]: ROTATIONOFFSET" + ex.Message); 951 m_log.Error("[SCENEOBJECTPART]: ROTATIONOFFSET" + ex.Message);
956 } 952 }
957 } 953 }
958
959// float roll, pitch, yaw = 0;
960// m_rotationOffset.GetEulerAngles(out roll, out pitch, out yaw);
961//
962// m_log.DebugFormat(
963// "[SCENE OBJECT PART]: Set euler {0} for RotationOffset on {1} {2}",
964// new Vector3(roll, pitch, yaw), Name, LocalId);
965 } 954 }
966 } 955 }
967 956
@@ -2266,7 +2255,8 @@ namespace OpenSim.Region.Framework.Scenes
2266 dupe.KeyframeMotion = null; 2255 dupe.KeyframeMotion = null;
2267 dupe.PayPrice = (int[])PayPrice.Clone(); 2256 dupe.PayPrice = (int[])PayPrice.Clone();
2268 2257
2269 dupe.DynAttrs.CopyFrom(DynAttrs); 2258 if(DynAttrs != null)
2259 dupe.DynAttrs.CopyFrom(DynAttrs);
2270 2260
2271 if (userExposed) 2261 if (userExposed)
2272 { 2262 {
@@ -3834,7 +3824,7 @@ namespace OpenSim.Region.Framework.Scenes
3834 texcolor.A = clippedAlpha; 3824 texcolor.A = clippedAlpha;
3835 } 3825 }
3836 tex.FaceTextures[face].RGBA = texcolor; 3826 tex.FaceTextures[face].RGBA = texcolor;
3837 UpdateTextureEntry(tex.GetBytes()); 3827 UpdateTextureEntry(tex);
3838 return; 3828 return;
3839 } 3829 }
3840 else if (face == ALL_SIDES) 3830 else if (face == ALL_SIDES)
@@ -3863,7 +3853,7 @@ namespace OpenSim.Region.Framework.Scenes
3863 } 3853 }
3864 tex.DefaultTexture.RGBA = texcolor; 3854 tex.DefaultTexture.RGBA = texcolor;
3865 } 3855 }
3866 UpdateTextureEntry(tex.GetBytes()); 3856 UpdateTextureEntry(tex);
3867 return; 3857 return;
3868 } 3858 }
3869 } 3859 }
@@ -5178,15 +5168,7 @@ namespace OpenSim.Region.Framework.Scenes
5178 /// <param name="serializedTextureEntry"></param> 5168 /// <param name="serializedTextureEntry"></param>
5179 public void UpdateTextureEntry(byte[] serializedTextureEntry) 5169 public void UpdateTextureEntry(byte[] serializedTextureEntry)
5180 { 5170 {
5181 UpdateTextureEntry(new Primitive.TextureEntry(serializedTextureEntry, 0, serializedTextureEntry.Length)); 5171 Primitive.TextureEntry newTex = new Primitive.TextureEntry(serializedTextureEntry, 0, serializedTextureEntry.Length);
5182 }
5183
5184 /// <summary>
5185 /// Update the texture entry for this part.
5186 /// </summary>
5187 /// <param name="newTex"></param>
5188 public void UpdateTextureEntry(Primitive.TextureEntry newTex)
5189 {
5190 Primitive.TextureEntry oldTex = Shape.Textures; 5172 Primitive.TextureEntry oldTex = Shape.Textures;
5191 5173
5192 Changed changeFlags = 0; 5174 Changed changeFlags = 0;
@@ -5215,7 +5197,7 @@ namespace OpenSim.Region.Framework.Scenes
5215 5197
5216 bool otherFieldsChanged = false; 5198 bool otherFieldsChanged = false;
5217 int nsides = GetNumberOfSides(); 5199 int nsides = GetNumberOfSides();
5218 for (int i = 0 ; i < nsides; i++) 5200 for (int i = 0; i < nsides; i++)
5219 { 5201 {
5220 Primitive.TextureEntryFace newFace = defaultNewFace; 5202 Primitive.TextureEntryFace newFace = defaultNewFace;
5221 Primitive.TextureEntryFace oldFace = defaultOldFace; 5203 Primitive.TextureEntryFace oldFace = defaultOldFace;
@@ -5253,7 +5235,7 @@ namespace OpenSim.Region.Framework.Scenes
5253 if (oldFace.Rotation != newFace.Rotation) otherFieldsChanged = true; 5235 if (oldFace.Rotation != newFace.Rotation) otherFieldsChanged = true;
5254 if (oldFace.Shiny != newFace.Shiny) otherFieldsChanged = true; 5236 if (oldFace.Shiny != newFace.Shiny) otherFieldsChanged = true;
5255 if (oldFace.TexMapType != newFace.TexMapType) otherFieldsChanged = true; 5237 if (oldFace.TexMapType != newFace.TexMapType) otherFieldsChanged = true;
5256 if(otherFieldsChanged) 5238 if (otherFieldsChanged)
5257 changeFlags |= Changed.TEXTURE; 5239 changeFlags |= Changed.TEXTURE;
5258 } 5240 }
5259 } 5241 }
@@ -5264,6 +5246,36 @@ namespace OpenSim.Region.Framework.Scenes
5264 TriggerScriptChangedEvent(changeFlags); 5246 TriggerScriptChangedEvent(changeFlags);
5265 ParentGroup.HasGroupChanged = true; 5247 ParentGroup.HasGroupChanged = true;
5266 ScheduleFullUpdate(); 5248 ScheduleFullUpdate();
5249
5250 }
5251
5252 /// <summary>
5253 /// Update the texture entry for this part.
5254 /// </summary>
5255 /// <param name="newTex"></param>
5256 public void UpdateTextureEntry(Primitive.TextureEntry newTex)
5257 {
5258 TextureAttributes dirty = newTex.GetDirtyFlags(32, true);
5259 dirty &= ~TextureAttributes.MaterialID;
5260 if(dirty == TextureAttributes.None)
5261 return;
5262
5263 Changed changeFlags = 0;
5264 if((dirty & TextureAttributes.RGBA) != 0)
5265 {
5266 changeFlags = Changed.COLOR;
5267 dirty &= ~TextureAttributes.RGBA;
5268 }
5269 if (dirty != TextureAttributes.None)
5270 changeFlags |= Changed.TEXTURE;
5271
5272 if (changeFlags == 0)
5273 return;
5274
5275 m_shape.TextureEntry = newTex.GetBytes();
5276 TriggerScriptChangedEvent(changeFlags);
5277 ParentGroup.HasGroupChanged = true;
5278 ScheduleFullUpdate();
5267 } 5279 }
5268 5280
5269 internal void UpdatePhysicsSubscribedEvents() 5281 internal void UpdatePhysicsSubscribedEvents()