aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs
diff options
context:
space:
mode:
Diffstat (limited to 'OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs')
-rw-r--r--OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs28
1 files changed, 20 insertions, 8 deletions
diff --git a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs
index 84c2722..cc903e0 100644
--- a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs
+++ b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs
@@ -2781,7 +2781,6 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
2781 2781
2782 } 2782 }
2783 2783
2784
2785 public void llStopLookAt() 2784 public void llStopLookAt()
2786 { 2785 {
2787 m_host.AddScriptLPS(1); 2786 m_host.AddScriptLPS(1);
@@ -5905,7 +5904,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
5905 m_host.AddScriptLPS(1); 5904 m_host.AddScriptLPS(1);
5906 return World.SimulatorFPS; 5905 return World.SimulatorFPS;
5907 } 5906 }
5908 5907
5909 5908
5910 /* particle system rules should be coming into this routine as doubles, that is 5909 /* particle system rules should be coming into this routine as doubles, that is
5911 rule[0] should be an integer from this list and rule[1] should be the arg 5910 rule[0] should be an integer from this list and rule[1] should be the arg
@@ -7523,9 +7522,17 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
7523 break; 7522 break;
7524 7523
7525 case (int)ScriptBaseClass.PRIM_POSITION: 7524 case (int)ScriptBaseClass.PRIM_POSITION:
7526 res.Add(new LSL_Vector(part.AbsolutePosition.X, 7525 LSL_Vector v = new LSL_Vector(part.AbsolutePosition.X,
7527 part.AbsolutePosition.Y, 7526 part.AbsolutePosition.Y,
7528 part.AbsolutePosition.Z)); 7527 part.AbsolutePosition.Z);
7528 // For some reason, the part.AbsolutePosition.* values do not change if the
7529 // linkset is rotated; they always reflect the child prim's world position
7530 // as though the linkset is unrotated. This is incompatible behavior with SL's
7531 // implementation, so will break scripts imported from there (not to mention it
7532 // makes it more difficult to determine a child prim's actual inworld position).
7533 if (part.ParentID != 0)
7534 v = ((v - llGetRootPosition()) * llGetRootRotation()) + llGetRootPosition();
7535 res.Add( v );
7529 break; 7536 break;
7530 7537
7531 case (int)ScriptBaseClass.PRIM_SIZE: 7538 case (int)ScriptBaseClass.PRIM_SIZE:
@@ -7543,6 +7550,8 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
7543 PrimitiveBaseShape Shape = part.Shape; 7550 PrimitiveBaseShape Shape = part.Shape;
7544 int primType = getScriptPrimType(part.Shape); 7551 int primType = getScriptPrimType(part.Shape);
7545 res.Add(new LSL_Integer(primType)); 7552 res.Add(new LSL_Integer(primType));
7553 double topshearx = (double)(sbyte)Shape.PathShearX / 100.0; // Fix negative values for PathShearX
7554 double topsheary = (double)(sbyte)Shape.PathShearY / 100.0; // and PathShearY.
7546 switch (primType) 7555 switch (primType)
7547 { 7556 {
7548 case ScriptBaseClass.PRIM_TYPE_BOX: 7557 case ScriptBaseClass.PRIM_TYPE_BOX:
@@ -7553,7 +7562,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
7553 res.Add(new LSL_Float(Shape.ProfileHollow / 50000.0)); 7562 res.Add(new LSL_Float(Shape.ProfileHollow / 50000.0));
7554 res.Add(new LSL_Vector(Shape.PathTwistBegin / 100.0, Shape.PathTwist / 100.0, 0)); 7563 res.Add(new LSL_Vector(Shape.PathTwistBegin / 100.0, Shape.PathTwist / 100.0, 0));
7555 res.Add(new LSL_Vector(1 - (Shape.PathScaleX / 100.0 - 1), 1 - (Shape.PathScaleY / 100.0 - 1), 0)); 7564 res.Add(new LSL_Vector(1 - (Shape.PathScaleX / 100.0 - 1), 1 - (Shape.PathScaleY / 100.0 - 1), 0));
7556 res.Add(new LSL_Vector(Shape.PathShearX / 100.0, Shape.PathShearY / 100.0, 0)); 7565 res.Add(new LSL_Vector(topshearx, topsheary, 0));
7557 break; 7566 break;
7558 7567
7559 case ScriptBaseClass.PRIM_TYPE_SPHERE: 7568 case ScriptBaseClass.PRIM_TYPE_SPHERE:
@@ -7588,7 +7597,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
7588 res.Add(new LSL_Vector(1 - (Shape.PathScaleX / 100.0 - 1), 1 - (Shape.PathScaleY / 100.0 - 1), 0)); 7597 res.Add(new LSL_Vector(1 - (Shape.PathScaleX / 100.0 - 1), 1 - (Shape.PathScaleY / 100.0 - 1), 0));
7589 7598
7590 // vector topshear 7599 // vector topshear
7591 res.Add(new LSL_Vector(Shape.PathShearX / 100.0, Shape.PathShearY / 100.0, 0)); 7600 res.Add(new LSL_Vector(topshearx, topsheary, 0));
7592 7601
7593 // vector profilecut 7602 // vector profilecut
7594 res.Add(new LSL_Vector(Shape.ProfileBegin / 50000.0, 1 - Shape.ProfileEnd / 50000.0, 0)); 7603 res.Add(new LSL_Vector(Shape.ProfileBegin / 50000.0, 1 - Shape.ProfileEnd / 50000.0, 0));
@@ -7597,8 +7606,11 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
7597 res.Add(new LSL_Vector(Shape.PathTaperX / 100.0, Shape.PathTaperY / 100.0, 0)); 7606 res.Add(new LSL_Vector(Shape.PathTaperX / 100.0, Shape.PathTaperY / 100.0, 0));
7598 7607
7599 // float revolutions 7608 // float revolutions
7600 res.Add(new LSL_Float(Shape.PathRevolutions / 50.0)); // needs fixing :( 7609 res.Add(new LSL_Float((Shape.PathRevolutions * 0.015) + 1.0)); // Slightly inaccurate, because an unsigned
7601 7610 // byte is being used to represent the entire
7611 // range of floating-point values from 1.0
7612 // through 4.0 (which is how SL does it).
7613
7602 // float radiusoffset 7614 // float radiusoffset
7603 res.Add(new LSL_Float(Shape.PathRadiusOffset / 100.0)); 7615 res.Add(new LSL_Float(Shape.PathRadiusOffset / 100.0));
7604 7616