aboutsummaryrefslogtreecommitdiffstatshomepage
diff options
context:
space:
mode:
authorUbitUmarov2019-03-19 21:37:58 +0000
committerUbitUmarov2019-03-19 21:37:58 +0000
commitfe6317f009cbdbe9b075c32584e1188cb59ddf94 (patch)
tree1681027c7c277a01ac13d4642c3b4a5f92e2b934
parentprevent spurius acceleration values (diff)
downloadopensim-SC-fe6317f009cbdbe9b075c32584e1188cb59ddf94.zip
opensim-SC-fe6317f009cbdbe9b075c32584e1188cb59ddf94.tar.gz
opensim-SC-fe6317f009cbdbe9b075c32584e1188cb59ddf94.tar.bz2
opensim-SC-fe6317f009cbdbe9b075c32584e1188cb59ddf94.tar.xz
LSL update texture entry is heavy, set all parameters on same update
-rw-r--r--OpenSim/Region/Framework/Scenes/SceneObjectPart.cs8
-rw-r--r--OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs62
-rw-r--r--bin/OpenSimDefaults.ini2
3 files changed, 60 insertions, 12 deletions
diff --git a/OpenSim/Region/Framework/Scenes/SceneObjectPart.cs b/OpenSim/Region/Framework/Scenes/SceneObjectPart.cs
index 1a5e9d6..cf9dfee 100644
--- a/OpenSim/Region/Framework/Scenes/SceneObjectPart.cs
+++ b/OpenSim/Region/Framework/Scenes/SceneObjectPart.cs
@@ -2338,10 +2338,7 @@ namespace OpenSim.Region.Framework.Scenes
2338 { 2338 {
2339 ParentGroup.Scene.RemovePhysicalPrim(1); 2339 ParentGroup.Scene.RemovePhysicalPrim(1);
2340 2340
2341 Velocity = new Vector3(0, 0, 0); 2341 Stop();
2342 Acceleration = new Vector3(0, 0, 0);
2343 AngularVelocity = new Vector3(0, 0, 0);
2344 APIDActive = false;
2345 2342
2346 if (pa.Phantom && !VolumeDetectActive) 2343 if (pa.Phantom && !VolumeDetectActive)
2347 { 2344 {
@@ -4730,14 +4727,13 @@ namespace OpenSim.Region.Framework.Scenes
4730 if ((SetPhantom && !UsePhysics && !SetVD) || ParentGroup.IsAttachment || PhysicsShapeType == (byte)PhysShapeType.none 4727 if ((SetPhantom && !UsePhysics && !SetVD) || ParentGroup.IsAttachment || PhysicsShapeType == (byte)PhysShapeType.none
4731 || (Shape.PathCurve == (byte)Extrusion.Flexible)) 4728 || (Shape.PathCurve == (byte)Extrusion.Flexible))
4732 { 4729 {
4730 Stop();
4733 if (pa != null) 4731 if (pa != null)
4734 { 4732 {
4735 if(wasUsingPhysics) 4733 if(wasUsingPhysics)
4736 ParentGroup.Scene.RemovePhysicalPrim(1); 4734 ParentGroup.Scene.RemovePhysicalPrim(1);
4737 RemoveFromPhysics(); 4735 RemoveFromPhysics();
4738 } 4736 }
4739
4740 Stop();
4741 } 4737 }
4742 4738
4743 else 4739 else
diff --git a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs
index 5dc6260..ba35b55 100644
--- a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs
+++ b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs
@@ -2403,6 +2403,62 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
2403 ScriptSleep(m_sleepMsOnSetLinkTexture); 2403 ScriptSleep(m_sleepMsOnSetLinkTexture);
2404 } 2404 }
2405 2405
2406 protected void SetTextureParams(SceneObjectPart part, string texture, double scaleU, double ScaleV,
2407 double offsetU, double offsetV, double rotation, int face)
2408 {
2409 if (part == null || part.ParentGroup == null || part.ParentGroup.IsDeleted)
2410 return;
2411
2412 UUID textureID = new UUID();
2413
2414 textureID = ScriptUtils.GetAssetIdFromItemName(m_host, texture, (int)AssetType.Texture);
2415 if (textureID == UUID.Zero)
2416 {
2417 if (!UUID.TryParse(texture, out textureID))
2418 return;
2419 }
2420
2421 Primitive.TextureEntry tex = part.Shape.Textures;
2422 int nsides = GetNumberOfSides(part);
2423
2424 if (face >= 0 && face < nsides)
2425 {
2426 Primitive.TextureEntryFace texface = tex.CreateFace((uint)face);
2427 texface.TextureID = textureID;
2428 texface.RepeatU = (float)scaleU;
2429 texface.RepeatV = (float)ScaleV;
2430 texface.OffsetU = (float)offsetU;
2431 texface.OffsetV = (float)offsetV;
2432 texface.Rotation = (float)rotation;
2433 tex.FaceTextures[face] = texface;
2434 part.UpdateTextureEntry(tex);
2435 return;
2436 }
2437 else if (face == ScriptBaseClass.ALL_SIDES)
2438 {
2439 for (uint i = 0; i < nsides; i++)
2440 {
2441 if (tex.FaceTextures[i] != null)
2442 {
2443 tex.FaceTextures[i].TextureID = textureID;
2444 tex.FaceTextures[i].RepeatU = (float)scaleU;
2445 tex.FaceTextures[i].RepeatV = (float)ScaleV;
2446 tex.FaceTextures[i].OffsetU = (float)offsetU;
2447 tex.FaceTextures[i].OffsetV = (float)offsetV;
2448 tex.FaceTextures[i].Rotation = (float)rotation;
2449 }
2450 }
2451 tex.DefaultTexture.TextureID = textureID;
2452 tex.DefaultTexture.RepeatU = (float)scaleU;
2453 tex.DefaultTexture.RepeatV = (float)ScaleV;
2454 tex.DefaultTexture.OffsetU = (float)offsetU;
2455 tex.DefaultTexture.OffsetV = (float)offsetV;
2456 tex.DefaultTexture.Rotation = (float)rotation;
2457 part.UpdateTextureEntry(tex);
2458 return;
2459 }
2460 }
2461
2406 protected void SetTexture(SceneObjectPart part, string texture, int face) 2462 protected void SetTexture(SceneObjectPart part, string texture, int face)
2407 { 2463 {
2408 if (part == null || part.ParentGroup == null || part.ParentGroup.IsDeleted) 2464 if (part == null || part.ParentGroup == null || part.ParentGroup.IsDeleted)
@@ -9728,11 +9784,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
9728 return new LSL_List(); 9784 return new LSL_List();
9729 } 9785 }
9730 9786
9731 SetTexture(part, tex, face); 9787 SetTextureParams(part, tex, repeats.x, repeats.y, offsets.x, offsets.y, rotation, face);
9732 ScaleTexture(part, repeats.x, repeats.y, face);
9733 OffsetTexture(part, offsets.x, offsets.y, face);
9734 RotateTexture(part, rotation, face);
9735
9736 break; 9788 break;
9737 9789
9738 case ScriptBaseClass.PRIM_COLOR: 9790 case ScriptBaseClass.PRIM_COLOR:
diff --git a/bin/OpenSimDefaults.ini b/bin/OpenSimDefaults.ini
index cede84d..20dbd2e 100644
--- a/bin/OpenSimDefaults.ini
+++ b/bin/OpenSimDefaults.ini
@@ -454,7 +454,7 @@
454 454
455 ; warp3D rendering height limits for prims (relative to rez position not bounding box) 455 ; warp3D rendering height limits for prims (relative to rez position not bounding box)
456 ; prims above RenderMaxHeight are excluded 456 ; prims above RenderMaxHeight are excluded
457 ; valid values: 100 t0 4086 457 ; valid values: 100 to 4086
458 ;RenderMaxHeight = 4086 458 ;RenderMaxHeight = 4086
459 459
460 ; prims below RenderMinHeight are excluded 460 ; prims below RenderMinHeight are excluded