From f8e0cf0f1de3cabded7bce2e438cc37ce4bb989c Mon Sep 17 00:00:00 2001 From: darok Date: Sat, 3 Nov 2007 10:25:43 +0000 Subject: Changes in BulletXPlugin: Added new class BulletXActor class inherits from PhysicsActor and it's the ancestor for BulletXCharacter and BulletXPrim.Physical modifications: Changes for pass the value of Physical flag in the SceneObjectPart class to the Physics engines. New call for AddPrimShape so it has a new parameter called "isPhysical". The old call will be obselete soon (i believe). PhysActor and its descendants have a new property called IsPhysical. By the way no new special funcionallity added. It's more like preparing the way for new modifications. --- OpenSim/Region/Environment/Scenes/Scene.cs | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) (limited to 'OpenSim/Region/Environment/Scenes/Scene.cs') diff --git a/OpenSim/Region/Environment/Scenes/Scene.cs b/OpenSim/Region/Environment/Scenes/Scene.cs index d02f3e3..9eb3a71 100644 --- a/OpenSim/Region/Environment/Scenes/Scene.cs +++ b/OpenSim/Region/Environment/Scenes/Scene.cs @@ -533,6 +533,7 @@ namespace OpenSim.Region.Environment.Scenes { AddEntityFromStorage(prim); SceneObjectPart rootPart = prim.GetChildPart(prim.UUID); + bool UsePhysics = ((rootPart.ObjectFlags & (uint)LLObject.ObjectFlags.Physics) > 0); if ((rootPart.ObjectFlags & (uint) LLObject.ObjectFlags.Phantom) == 0) rootPart.PhysActor = phyScene.AddPrimShape( rootPart.Name, @@ -541,7 +542,7 @@ namespace OpenSim.Region.Environment.Scenes rootPart.AbsolutePosition.Z), new PhysicsVector(rootPart.Scale.X, rootPart.Scale.Y, rootPart.Scale.Z), new Quaternion(rootPart.RotationOffset.W, rootPart.RotationOffset.X, - rootPart.RotationOffset.Y, rootPart.RotationOffset.Z)); + rootPart.RotationOffset.Y, rootPart.RotationOffset.Z), UsePhysics); } MainLog.Instance.Verbose("Loaded " + PrimsFromDB.Count.ToString() + " SceneObject(s)"); } @@ -582,6 +583,7 @@ namespace OpenSim.Region.Environment.Scenes rootPart.ObjectFlags += (uint) LLObject.ObjectFlags.Phantom; } // if not phantom, add to physics + bool UsePhysics = ((rootPart.ObjectFlags & (uint)LLObject.ObjectFlags.Physics) > 0); if ((rootPart.ObjectFlags & (uint) LLObject.ObjectFlags.Phantom) == 0) rootPart.PhysActor = phyScene.AddPrimShape( @@ -589,7 +591,7 @@ namespace OpenSim.Region.Environment.Scenes rootPart.Shape, new PhysicsVector(pos.X, pos.Y, pos.Z), new PhysicsVector(shape.Scale.X, shape.Scale.Y, shape.Scale.Z), - new Quaternion()); + new Quaternion(), UsePhysics); } } @@ -669,6 +671,7 @@ namespace OpenSim.Region.Environment.Scenes AddEntity(obj); SceneObjectPart rootPart = obj.GetChildPart(obj.UUID); + bool UsePhysics = ((rootPart.ObjectFlags & (uint)LLObject.ObjectFlags.Physics) > 0); if ((rootPart.ObjectFlags & (uint) LLObject.ObjectFlags.Phantom) == 0) rootPart.PhysActor = phyScene.AddPrimShape( rootPart.Name, @@ -677,7 +680,7 @@ namespace OpenSim.Region.Environment.Scenes rootPart.AbsolutePosition.Z), new PhysicsVector(rootPart.Scale.X, rootPart.Scale.Y, rootPart.Scale.Z), new Quaternion(rootPart.RotationOffset.W, rootPart.RotationOffset.X, - rootPart.RotationOffset.Y, rootPart.RotationOffset.Z)); + rootPart.RotationOffset.Y, rootPart.RotationOffset.Z), UsePhysics); primCount++; } } @@ -734,6 +737,7 @@ namespace OpenSim.Region.Environment.Scenes AddEntityFromStorage(obj); SceneObjectPart rootPart = obj.GetChildPart(obj.UUID); + bool UsePhysics = ((rootPart.ObjectFlags & (uint)LLObject.ObjectFlags.Physics) > 0); if ((rootPart.ObjectFlags & (uint) LLObject.ObjectFlags.Phantom) == 0) rootPart.PhysActor = phyScene.AddPrimShape( rootPart.Name, @@ -742,7 +746,7 @@ namespace OpenSim.Region.Environment.Scenes rootPart.AbsolutePosition.Z), new PhysicsVector(rootPart.Scale.X, rootPart.Scale.Y, rootPart.Scale.Z), new Quaternion(rootPart.RotationOffset.W, rootPart.RotationOffset.X, - rootPart.RotationOffset.Y, rootPart.RotationOffset.Z)); + rootPart.RotationOffset.Y, rootPart.RotationOffset.Z), UsePhysics); } public void SavePrimsToXml2(string fileName) -- cgit v1.1