From 18c959df12983256d73240a86fa0bad12c4e36ce Mon Sep 17 00:00:00 2001 From: Teravus Ovares Date: Thu, 17 Jan 2008 14:59:05 +0000 Subject: * Added llApplyImpulse in the global frame. The object must be physical before this'll do anything. Be careful with this function as it's easy to loose prim. --- OpenSim/Region/Environment/Scenes/SceneObjectPart.cs | 15 +++++++++++++++ 1 file changed, 15 insertions(+) (limited to 'OpenSim/Region/Environment/Scenes/SceneObjectPart.cs') diff --git a/OpenSim/Region/Environment/Scenes/SceneObjectPart.cs b/OpenSim/Region/Environment/Scenes/SceneObjectPart.cs index 0cb4ae7..ce38bee 100644 --- a/OpenSim/Region/Environment/Scenes/SceneObjectPart.cs +++ b/OpenSim/Region/Environment/Scenes/SceneObjectPart.cs @@ -520,6 +520,21 @@ namespace OpenSim.Region.Environment.Scenes protected PrimitiveBaseShape m_shape; + /// + /// hook to the physics scene to apply impulse + /// This is sent up to the group, which then finds the root prim + /// and applies the force on the root prim of the group + /// + /// Vector force + public void ApplyImpulse(LLVector3 impulsei) + { + PhysicsVector impulse = new PhysicsVector(impulsei.X, impulsei.Y, impulsei.Z); + if (m_parentGroup != null) + { + m_parentGroup.applyImpulse(impulse); + } + } + public void TriggerScriptChangedEvent(Changed val) { if (m_parentGroup != null) -- cgit v1.1