diff options
Diffstat (limited to 'OpenSim')
-rw-r--r-- | OpenSim/Region/Framework/Scenes/SceneObjectPart.cs | 8 | ||||
-rw-r--r-- | OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs | 62 |
2 files changed, 59 insertions, 11 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: |