diff options
author | Teravus Ovares | 2008-01-15 04:14:27 +0000 |
---|---|---|
committer | Teravus Ovares | 2008-01-15 04:14:27 +0000 |
commit | 45e945616bfdab2ef57744670d3bb21acc1b3fcf (patch) | |
tree | c23956cef7294fc1f77062b41d63fdad3e19055e /OpenSim/Region/Environment/Scenes/SceneObjectPart.cs | |
parent | * Mother of all commits: (diff) | |
download | opensim-SC_OLD-45e945616bfdab2ef57744670d3bb21acc1b3fcf.zip opensim-SC_OLD-45e945616bfdab2ef57744670d3bb21acc1b3fcf.tar.gz opensim-SC_OLD-45e945616bfdab2ef57744670d3bb21acc1b3fcf.tar.bz2 opensim-SC_OLD-45e945616bfdab2ef57744670d3bb21acc1b3fcf.tar.xz |
* Pass 2 of collidable (non physical) linksets
* Linkset status is now persistent
* Tweaked a physics child prim positioning hack to generate less database saves
* Re-factored physics object creation calls into ApplyPhysics. To create a new physics representation of an object or linkset, it's only necessary to call *group*.ApplyPhysics(bool m_physicalPrim). *lbsa has been waiting for this refactoring*
* We have collidable linksets now. (they don't become phantom anymore)
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() |