diff options
author | Melanie | 2009-12-21 22:07:22 +0000 |
---|---|---|
committer | Melanie | 2009-12-21 22:07:22 +0000 |
commit | 84a1a0a72990ceea746055466f9cd1bef0ce01ad (patch) | |
tree | 4ce06ee7545cafebd375cbf68f74df29f5582b00 /OpenSim/Region/ScriptEngine | |
parent | Merge branch 'master' into careminster (diff) | |
parent | Merge branch 'master' of melanie@opensimulator.org:/var/git/opensim (diff) | |
download | opensim-SC-84a1a0a72990ceea746055466f9cd1bef0ce01ad.zip opensim-SC-84a1a0a72990ceea746055466f9cd1bef0ce01ad.tar.gz opensim-SC-84a1a0a72990ceea746055466f9cd1bef0ce01ad.tar.bz2 opensim-SC-84a1a0a72990ceea746055466f9cd1bef0ce01ad.tar.xz |
Merge branch 'master' into careminster
Diffstat (limited to 'OpenSim/Region/ScriptEngine')
-rw-r--r-- | OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs | 27 |
1 files changed, 20 insertions, 7 deletions
diff --git a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs index 2da498a..c3edaef 100644 --- a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs +++ b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs | |||
@@ -5866,7 +5866,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api | |||
5866 | m_host.AddScriptLPS(1); | 5866 | m_host.AddScriptLPS(1); |
5867 | return World.SimulatorFPS; | 5867 | return World.SimulatorFPS; |
5868 | } | 5868 | } |
5869 | 5869 | ||
5870 | 5870 | ||
5871 | /* particle system rules should be coming into this routine as doubles, that is | 5871 | /* particle system rules should be coming into this routine as doubles, that is |
5872 | rule[0] should be an integer from this list and rule[1] should be the arg | 5872 | rule[0] should be an integer from this list and rule[1] should be the arg |
@@ -7467,9 +7467,17 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api | |||
7467 | break; | 7467 | break; |
7468 | 7468 | ||
7469 | case (int)ScriptBaseClass.PRIM_POSITION: | 7469 | case (int)ScriptBaseClass.PRIM_POSITION: |
7470 | res.Add(new LSL_Vector(part.AbsolutePosition.X, | 7470 | LSL_Vector v = new LSL_Vector(part.AbsolutePosition.X, |
7471 | part.AbsolutePosition.Y, | 7471 | part.AbsolutePosition.Y, |
7472 | part.AbsolutePosition.Z)); | 7472 | part.AbsolutePosition.Z); |
7473 | // For some reason, the part.AbsolutePosition.* values do not change if the | ||
7474 | // linkset is rotated; they always reflect the child prim's world position | ||
7475 | // as though the linkset is unrotated. This is incompatible behavior with SL's | ||
7476 | // implementation, so will break scripts imported from there (not to mention it | ||
7477 | // makes it more difficult to determine a child prim's actual inworld position). | ||
7478 | if (part.ParentID != 0) | ||
7479 | v = ((v - llGetRootPosition()) * llGetRootRotation()) + llGetRootPosition(); | ||
7480 | res.Add( v ); | ||
7473 | break; | 7481 | break; |
7474 | 7482 | ||
7475 | case (int)ScriptBaseClass.PRIM_SIZE: | 7483 | case (int)ScriptBaseClass.PRIM_SIZE: |
@@ -7487,6 +7495,8 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api | |||
7487 | PrimitiveBaseShape Shape = part.Shape; | 7495 | PrimitiveBaseShape Shape = part.Shape; |
7488 | int primType = getScriptPrimType(part.Shape); | 7496 | int primType = getScriptPrimType(part.Shape); |
7489 | res.Add(new LSL_Integer(primType)); | 7497 | res.Add(new LSL_Integer(primType)); |
7498 | double topshearx = (double)(sbyte)Shape.PathShearX / 100.0; // Fix negative values for PathShearX | ||
7499 | double topsheary = (double)(sbyte)Shape.PathShearY / 100.0; // and PathShearY. | ||
7490 | switch (primType) | 7500 | switch (primType) |
7491 | { | 7501 | { |
7492 | case ScriptBaseClass.PRIM_TYPE_BOX: | 7502 | case ScriptBaseClass.PRIM_TYPE_BOX: |
@@ -7497,7 +7507,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api | |||
7497 | res.Add(new LSL_Float(Shape.ProfileHollow / 50000.0)); | 7507 | res.Add(new LSL_Float(Shape.ProfileHollow / 50000.0)); |
7498 | res.Add(new LSL_Vector(Shape.PathTwistBegin / 100.0, Shape.PathTwist / 100.0, 0)); | 7508 | res.Add(new LSL_Vector(Shape.PathTwistBegin / 100.0, Shape.PathTwist / 100.0, 0)); |
7499 | res.Add(new LSL_Vector(1 - (Shape.PathScaleX / 100.0 - 1), 1 - (Shape.PathScaleY / 100.0 - 1), 0)); | 7509 | res.Add(new LSL_Vector(1 - (Shape.PathScaleX / 100.0 - 1), 1 - (Shape.PathScaleY / 100.0 - 1), 0)); |
7500 | res.Add(new LSL_Vector(Shape.PathShearX / 100.0, Shape.PathShearY / 100.0, 0)); | 7510 | res.Add(new LSL_Vector(topshearx, topsheary, 0)); |
7501 | break; | 7511 | break; |
7502 | 7512 | ||
7503 | case ScriptBaseClass.PRIM_TYPE_SPHERE: | 7513 | case ScriptBaseClass.PRIM_TYPE_SPHERE: |
@@ -7532,7 +7542,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api | |||
7532 | res.Add(new LSL_Vector(1 - (Shape.PathScaleX / 100.0 - 1), 1 - (Shape.PathScaleY / 100.0 - 1), 0)); | 7542 | res.Add(new LSL_Vector(1 - (Shape.PathScaleX / 100.0 - 1), 1 - (Shape.PathScaleY / 100.0 - 1), 0)); |
7533 | 7543 | ||
7534 | // vector topshear | 7544 | // vector topshear |
7535 | res.Add(new LSL_Vector(Shape.PathShearX / 100.0, Shape.PathShearY / 100.0, 0)); | 7545 | res.Add(new LSL_Vector(topshearx, topsheary, 0)); |
7536 | 7546 | ||
7537 | // vector profilecut | 7547 | // vector profilecut |
7538 | res.Add(new LSL_Vector(Shape.ProfileBegin / 50000.0, 1 - Shape.ProfileEnd / 50000.0, 0)); | 7548 | res.Add(new LSL_Vector(Shape.ProfileBegin / 50000.0, 1 - Shape.ProfileEnd / 50000.0, 0)); |
@@ -7541,8 +7551,11 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api | |||
7541 | res.Add(new LSL_Vector(Shape.PathTaperX / 100.0, Shape.PathTaperY / 100.0, 0)); | 7551 | res.Add(new LSL_Vector(Shape.PathTaperX / 100.0, Shape.PathTaperY / 100.0, 0)); |
7542 | 7552 | ||
7543 | // float revolutions | 7553 | // float revolutions |
7544 | res.Add(new LSL_Float(Shape.PathRevolutions / 50.0)); // needs fixing :( | 7554 | res.Add(new LSL_Float((Shape.PathRevolutions * 0.015) + 1.0)); // Slightly inaccurate, because an unsigned |
7545 | 7555 | // byte is being used to represent the entire | |
7556 | // range of floating-point values from 1.0 | ||
7557 | // through 4.0 (which is how SL does it). | ||
7558 | |||
7546 | // float radiusoffset | 7559 | // float radiusoffset |
7547 | res.Add(new LSL_Float(Shape.PathRadiusOffset / 100.0)); | 7560 | res.Add(new LSL_Float(Shape.PathRadiusOffset / 100.0)); |
7548 | 7561 | ||