diff options
Diffstat (limited to '')
-rw-r--r-- | OpenSim/Region/Environment/Scenes/SceneObjectPart.cs | 24 |
1 files changed, 20 insertions, 4 deletions
diff --git a/OpenSim/Region/Environment/Scenes/SceneObjectPart.cs b/OpenSim/Region/Environment/Scenes/SceneObjectPart.cs index b2ba70c..48177dc 100644 --- a/OpenSim/Region/Environment/Scenes/SceneObjectPart.cs +++ b/OpenSim/Region/Environment/Scenes/SceneObjectPart.cs | |||
@@ -560,13 +560,29 @@ namespace OpenSim.Region.Environment.Scenes | |||
560 | /// This is sent up to the group, which then finds the root prim | 560 | /// This is sent up to the group, which then finds the root prim |
561 | /// and applies the force on the root prim of the group | 561 | /// and applies the force on the root prim of the group |
562 | /// </summary> | 562 | /// </summary> |
563 | /// <param name="impulse">Vector force</param> | 563 | /// <param name="impulsei">Vector force</param> |
564 | public void ApplyImpulse(LLVector3 impulsei) | 564 | /// <param name="localGlobalTF">true for the local frame, false for the global frame</param> |
565 | public void ApplyImpulse(LLVector3 impulsei, bool localGlobalTF) | ||
565 | { | 566 | { |
566 | PhysicsVector impulse = new PhysicsVector(impulsei.X, impulsei.Y, impulsei.Z); | 567 | PhysicsVector impulse = new PhysicsVector(impulsei.X, impulsei.Y, impulsei.Z); |
567 | if (m_parentGroup != null) | 568 | |
569 | if (localGlobalTF) | ||
568 | { | 570 | { |
569 | m_parentGroup.applyImpulse(impulse); | 571 | |
572 | LLQuaternion grot = GetWorldRotation(); | ||
573 | Quaternion AXgrot = new Quaternion(grot.W,grot.X,grot.Y,grot.Z); | ||
574 | Vector3 AXimpulsei = new Vector3(impulsei.X, impulsei.Y, impulsei.Z); | ||
575 | Vector3 newimpulse = AXgrot * AXimpulsei; | ||
576 | impulse = new PhysicsVector(newimpulse.x, newimpulse.y, newimpulse.z); | ||
577 | |||
578 | } | ||
579 | else | ||
580 | { | ||
581 | |||
582 | if (m_parentGroup != null) | ||
583 | { | ||
584 | m_parentGroup.applyImpulse(impulse); | ||
585 | } | ||
570 | } | 586 | } |
571 | } | 587 | } |
572 | 588 | ||