diff options
Added a PhysicsActor PhysActor member to SceneObjectPart, and made it so this is set when registering the prims with the physics engine.
Position changes of the prim is now updated straight away to physic engine. (note at the moment, only root prim is registered with physics engine. Think we need to decide how we are going to manage child prims and physics.)
As before this is all currently disabled (in scene.cs) until its in a bit more working condition.
Diffstat (limited to 'OpenSim/Region')
-rw-r--r-- | OpenSim/Region/Environment/Scenes/Scene.cs | 26 | ||||
-rw-r--r-- | OpenSim/Region/Environment/Scenes/SceneObjectGroup.cs | 5 | ||||
-rw-r--r-- | OpenSim/Region/Environment/Scenes/SceneObjectPart.cs | 3 |
3 files changed, 23 insertions, 11 deletions
diff --git a/OpenSim/Region/Environment/Scenes/Scene.cs b/OpenSim/Region/Environment/Scenes/Scene.cs index 7317361..20624d5 100644 --- a/OpenSim/Region/Environment/Scenes/Scene.cs +++ b/OpenSim/Region/Environment/Scenes/Scene.cs | |||
@@ -503,11 +503,12 @@ namespace OpenSim.Region.Environment.Scenes | |||
503 | foreach (SceneObjectGroup prim in PrimsFromDB) | 503 | foreach (SceneObjectGroup prim in PrimsFromDB) |
504 | { | 504 | { |
505 | AddEntityFromStorage(prim); | 505 | AddEntityFromStorage(prim); |
506 | // phyScene.AddPrim( | 506 | SceneObjectPart rootPart = prim.GetChildPart(prim.UUID); |
507 | // new PhysicsVector(prim.RootPart.AbsolutePosition.X, prim.RootPart.AbsolutePosition.Y, prim.RootPart.AbsolutePosition.Z), | 507 | // rootPart.PhysActor = phyScene.AddPrim( |
508 | // new PhysicsVector(prim.RootPart.Scale.X, prim.RootPart.Scale.Y, prim.RootPart.Scale.Z), | 508 | // new PhysicsVector(rootPart.AbsolutePosition.X, rootPart.AbsolutePosition.Y, rootPart.AbsolutePosition.Z), |
509 | // new Axiom.Math.Quaternion(prim.RootPart.RotationOffset.W, prim.RootPart.RotationOffset.X, | 509 | // new PhysicsVector(rootPart.Scale.X, rootPart.Scale.Y, rootPart.Scale.Z), |
510 | // prim.RootPart.RotationOffset.Y, prim.RootPart.RotationOffset.Z)); | 510 | // new Axiom.Math.Quaternion(rootPart.RotationOffset.W, rootPart.RotationOffset.X, |
511 | // rootPart.RotationOffset.Y, rootPart.RotationOffset.Z)); | ||
511 | } | 512 | } |
512 | MainLog.Instance.Verbose("Loaded " + PrimsFromDB.Count.ToString() + " SceneObject(s)"); | 513 | MainLog.Instance.Verbose("Loaded " + PrimsFromDB.Count.ToString() + " SceneObject(s)"); |
513 | } | 514 | } |
@@ -545,7 +546,8 @@ namespace OpenSim.Region.Environment.Scenes | |||
545 | { | 546 | { |
546 | SceneObjectGroup sceneOb = new SceneObjectGroup(this, this.m_regionHandle, ownerID, PrimIDAllocate(), pos, shape); | 547 | SceneObjectGroup sceneOb = new SceneObjectGroup(this, this.m_regionHandle, ownerID, PrimIDAllocate(), pos, shape); |
547 | AddEntity(sceneOb); | 548 | AddEntity(sceneOb); |
548 | //phyScene.AddPrim(new PhysicsVector(pos.X, pos.Y, pos.Z), new PhysicsVector(shape.Scale.X, shape.Scale.Y, shape.Scale.Z), | 549 | SceneObjectPart rootPart = sceneOb.GetChildPart(sceneOb.UUID); |
550 | // rootPart.PhysActor =phyScene.AddPrim(new PhysicsVector(pos.X, pos.Y, pos.Z), new PhysicsVector(shape.Scale.X, shape.Scale.Y, shape.Scale.Z), | ||
549 | // new Axiom.Math.Quaternion()); | 551 | // new Axiom.Math.Quaternion()); |
550 | } | 552 | } |
551 | 553 | ||
@@ -622,11 +624,13 @@ namespace OpenSim.Region.Environment.Scenes | |||
622 | //if we want this to be a import method then we need new uuids for the object to avoid any clashes | 624 | //if we want this to be a import method then we need new uuids for the object to avoid any clashes |
623 | //obj.RegenerateFullIDs(); | 625 | //obj.RegenerateFullIDs(); |
624 | AddEntity(obj); | 626 | AddEntity(obj); |
625 | // phyScene.AddPrim( | 627 | |
626 | // new PhysicsVector(obj.RootPart.AbsolutePosition.X, obj.RootPart.AbsolutePosition.Y, obj.RootPart.AbsolutePosition.Z), | 628 | SceneObjectPart rootPart = obj.GetChildPart(obj.UUID); |
627 | // new PhysicsVector(obj.RootPart.Scale.X, obj.RootPart.Scale.Y, obj.RootPart.Scale.Z), | 629 | //rootPart.PhysActor = phyScene.AddPrim( |
628 | // new Axiom.Math.Quaternion(obj.RootPart.RotationOffset.W, obj.RootPart.RotationOffset.X, | 630 | // new PhysicsVector(rootPart.AbsolutePosition.X, rootPart.AbsolutePosition.Y, rootPart.AbsolutePosition.Z), |
629 | // obj.RootPart.RotationOffset.Y, obj.RootPart.RotationOffset.Z)); | 631 | // new PhysicsVector(rootPart.Scale.X, rootPart.Scale.Y, rootPart.Scale.Z), |
632 | // new Axiom.Math.Quaternion(rootPart.RotationOffset.W, rootPart.RotationOffset.X, | ||
633 | // rootPart.RotationOffset.Y, rootPart.RotationOffset.Z)); | ||
630 | primCount++; | 634 | primCount++; |
631 | } | 635 | } |
632 | } | 636 | } |
diff --git a/OpenSim/Region/Environment/Scenes/SceneObjectGroup.cs b/OpenSim/Region/Environment/Scenes/SceneObjectGroup.cs index 56ac9be..7e34637 100644 --- a/OpenSim/Region/Environment/Scenes/SceneObjectGroup.cs +++ b/OpenSim/Region/Environment/Scenes/SceneObjectGroup.cs | |||
@@ -11,6 +11,7 @@ using OpenSim.Framework.Interfaces; | |||
11 | using OpenSim.Framework.Types; | 11 | using OpenSim.Framework.Types; |
12 | using OpenSim.Physics.Manager; | 12 | using OpenSim.Physics.Manager; |
13 | using OpenSim.Framework.Data; | 13 | using OpenSim.Framework.Data; |
14 | using OpenSim.Physics.Manager; | ||
14 | 15 | ||
15 | namespace OpenSim.Region.Environment.Scenes | 16 | namespace OpenSim.Region.Environment.Scenes |
16 | { | 17 | { |
@@ -89,6 +90,10 @@ namespace OpenSim.Region.Environment.Scenes | |||
89 | part.GroupPosition = value; | 90 | part.GroupPosition = value; |
90 | } | 91 | } |
91 | } | 92 | } |
93 | if (m_rootPart.PhysActor != null) | ||
94 | { | ||
95 | m_rootPart.PhysActor.Position = new PhysicsVector(m_rootPart.GroupPosition.X, m_rootPart.GroupPosition.Y, m_rootPart.GroupPosition.Z); | ||
96 | } | ||
92 | } | 97 | } |
93 | } | 98 | } |
94 | 99 | ||
diff --git a/OpenSim/Region/Environment/Scenes/SceneObjectPart.cs b/OpenSim/Region/Environment/Scenes/SceneObjectPart.cs index 567681a..eea2d72 100644 --- a/OpenSim/Region/Environment/Scenes/SceneObjectPart.cs +++ b/OpenSim/Region/Environment/Scenes/SceneObjectPart.cs | |||
@@ -11,6 +11,7 @@ using OpenSim.Framework.Interfaces; | |||
11 | using OpenSim.Framework.Types; | 11 | using OpenSim.Framework.Types; |
12 | using OpenSim.Region.Environment.Scenes.Scripting; | 12 | using OpenSim.Region.Environment.Scenes.Scripting; |
13 | using OpenSim.Framework.Utilities; | 13 | using OpenSim.Framework.Utilities; |
14 | using OpenSim.Physics.Manager; | ||
14 | 15 | ||
15 | namespace OpenSim.Region.Environment.Scenes | 16 | namespace OpenSim.Region.Environment.Scenes |
16 | { | 17 | { |
@@ -22,6 +23,8 @@ namespace OpenSim.Region.Environment.Scenes | |||
22 | private string m_inventoryFileName = ""; | 23 | private string m_inventoryFileName = ""; |
23 | private LLUUID m_folderID = LLUUID.Zero; | 24 | private LLUUID m_folderID = LLUUID.Zero; |
24 | 25 | ||
26 | public PhysicsActor PhysActor = null; | ||
27 | |||
25 | protected Dictionary<LLUUID, TaskInventoryItem> TaskInventory = new Dictionary<LLUUID, TaskInventoryItem>(); | 28 | protected Dictionary<LLUUID, TaskInventoryItem> TaskInventory = new Dictionary<LLUUID, TaskInventoryItem>(); |
26 | 29 | ||
27 | public LLUUID CreatorID; | 30 | public LLUUID CreatorID; |