diff options
Diffstat (limited to 'OpenSim/Region/Environment/Scenes/SceneObjectPart.cs')
-rw-r--r-- | OpenSim/Region/Environment/Scenes/SceneObjectPart.cs | 22 |
1 files changed, 13 insertions, 9 deletions
diff --git a/OpenSim/Region/Environment/Scenes/SceneObjectPart.cs b/OpenSim/Region/Environment/Scenes/SceneObjectPart.cs index f2594a9..468e2d0 100644 --- a/OpenSim/Region/Environment/Scenes/SceneObjectPart.cs +++ b/OpenSim/Region/Environment/Scenes/SceneObjectPart.cs | |||
@@ -261,7 +261,7 @@ namespace OpenSim.Region.Environment.Scenes | |||
261 | try | 261 | try |
262 | { | 262 | { |
263 | // Hack to get the child prim to update positions in the physics engine | 263 | // Hack to get the child prim to update positions in the physics engine |
264 | ParentGroup.AbsolutePosition = ParentGroup.AbsolutePosition; | 264 | ParentGroup.ResetChildPrimPhysicsPositions(); |
265 | } | 265 | } |
266 | catch (System.NullReferenceException) | 266 | catch (System.NullReferenceException) |
267 | { | 267 | { |
@@ -646,14 +646,17 @@ namespace OpenSim.Region.Environment.Scenes | |||
646 | return newobject; | 646 | return newobject; |
647 | } | 647 | } |
648 | 648 | ||
649 | public void ApplyPhysics() | 649 | public void ApplyPhysics(uint rootObjectFlags, bool m_physicalPrim) |
650 | { | 650 | { |
651 | bool isPhysical = ((ObjectFlags & (uint) LLObject.ObjectFlags.Physics) != 0); | ||
652 | bool isPhantom = ((ObjectFlags & (uint) LLObject.ObjectFlags.Phantom) != 0); | ||
653 | 651 | ||
654 | bool usePhysics = isPhysical && !isPhantom; | 652 | bool isPhysical = (((rootObjectFlags & (uint) LLObject.ObjectFlags.Physics) != 0) && m_physicalPrim); |
653 | bool isPhantom = ((rootObjectFlags & (uint) LLObject.ObjectFlags.Phantom) != 0); | ||
655 | 654 | ||
656 | if (usePhysics) | 655 | // Added clarification.. since A rigid body is an object that you can kick around, etc. |
656 | bool RigidBody = isPhysical && !isPhantom; | ||
657 | |||
658 | // The only time the physics scene shouldn't know about the prim is if it's phantom | ||
659 | if (!isPhantom) | ||
657 | { | 660 | { |
658 | PhysActor = m_parentGroup.Scene.PhysicsScene.AddPrimShape( | 661 | PhysActor = m_parentGroup.Scene.PhysicsScene.AddPrimShape( |
659 | Name, | 662 | Name, |
@@ -662,10 +665,11 @@ namespace OpenSim.Region.Environment.Scenes | |||
662 | AbsolutePosition.Z), | 665 | AbsolutePosition.Z), |
663 | new PhysicsVector(Scale.X, Scale.Y, Scale.Z), | 666 | new PhysicsVector(Scale.X, Scale.Y, Scale.Z), |
664 | new Quaternion(RotationOffset.W, RotationOffset.X, | 667 | new Quaternion(RotationOffset.W, RotationOffset.X, |
665 | RotationOffset.Y, RotationOffset.Z), usePhysics); | 668 | RotationOffset.Y, RotationOffset.Z), RigidBody); |
666 | } | ||
667 | 669 | ||
668 | DoPhysicsPropertyUpdate(usePhysics, true); | 670 | |
671 | DoPhysicsPropertyUpdate(RigidBody, true); | ||
672 | } | ||
669 | } | 673 | } |
670 | 674 | ||
671 | public void ApplyNextOwnerPermissions() | 675 | public void ApplyNextOwnerPermissions() |