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.afrisby
parent
9a8742e838
commit
8264ba849f
|
@ -503,11 +503,12 @@ namespace OpenSim.Region.Environment.Scenes
|
|||
foreach (SceneObjectGroup prim in PrimsFromDB)
|
||||
{
|
||||
AddEntityFromStorage(prim);
|
||||
// phyScene.AddPrim(
|
||||
// new PhysicsVector(prim.RootPart.AbsolutePosition.X, prim.RootPart.AbsolutePosition.Y, prim.RootPart.AbsolutePosition.Z),
|
||||
// new PhysicsVector(prim.RootPart.Scale.X, prim.RootPart.Scale.Y, prim.RootPart.Scale.Z),
|
||||
// new Axiom.Math.Quaternion(prim.RootPart.RotationOffset.W, prim.RootPart.RotationOffset.X,
|
||||
// prim.RootPart.RotationOffset.Y, prim.RootPart.RotationOffset.Z));
|
||||
SceneObjectPart rootPart = prim.GetChildPart(prim.UUID);
|
||||
// rootPart.PhysActor = phyScene.AddPrim(
|
||||
// new PhysicsVector(rootPart.AbsolutePosition.X, rootPart.AbsolutePosition.Y, rootPart.AbsolutePosition.Z),
|
||||
// new PhysicsVector(rootPart.Scale.X, rootPart.Scale.Y, rootPart.Scale.Z),
|
||||
// new Axiom.Math.Quaternion(rootPart.RotationOffset.W, rootPart.RotationOffset.X,
|
||||
// rootPart.RotationOffset.Y, rootPart.RotationOffset.Z));
|
||||
}
|
||||
MainLog.Instance.Verbose("Loaded " + PrimsFromDB.Count.ToString() + " SceneObject(s)");
|
||||
}
|
||||
|
@ -545,7 +546,8 @@ namespace OpenSim.Region.Environment.Scenes
|
|||
{
|
||||
SceneObjectGroup sceneOb = new SceneObjectGroup(this, this.m_regionHandle, ownerID, PrimIDAllocate(), pos, shape);
|
||||
AddEntity(sceneOb);
|
||||
//phyScene.AddPrim(new PhysicsVector(pos.X, pos.Y, pos.Z), new PhysicsVector(shape.Scale.X, shape.Scale.Y, shape.Scale.Z),
|
||||
SceneObjectPart rootPart = sceneOb.GetChildPart(sceneOb.UUID);
|
||||
// rootPart.PhysActor =phyScene.AddPrim(new PhysicsVector(pos.X, pos.Y, pos.Z), new PhysicsVector(shape.Scale.X, shape.Scale.Y, shape.Scale.Z),
|
||||
// new Axiom.Math.Quaternion());
|
||||
}
|
||||
|
||||
|
@ -622,11 +624,13 @@ namespace OpenSim.Region.Environment.Scenes
|
|||
//if we want this to be a import method then we need new uuids for the object to avoid any clashes
|
||||
//obj.RegenerateFullIDs();
|
||||
AddEntity(obj);
|
||||
// phyScene.AddPrim(
|
||||
// new PhysicsVector(obj.RootPart.AbsolutePosition.X, obj.RootPart.AbsolutePosition.Y, obj.RootPart.AbsolutePosition.Z),
|
||||
// new PhysicsVector(obj.RootPart.Scale.X, obj.RootPart.Scale.Y, obj.RootPart.Scale.Z),
|
||||
// new Axiom.Math.Quaternion(obj.RootPart.RotationOffset.W, obj.RootPart.RotationOffset.X,
|
||||
// obj.RootPart.RotationOffset.Y, obj.RootPart.RotationOffset.Z));
|
||||
|
||||
SceneObjectPart rootPart = obj.GetChildPart(obj.UUID);
|
||||
//rootPart.PhysActor = phyScene.AddPrim(
|
||||
// new PhysicsVector(rootPart.AbsolutePosition.X, rootPart.AbsolutePosition.Y, rootPart.AbsolutePosition.Z),
|
||||
// new PhysicsVector(rootPart.Scale.X, rootPart.Scale.Y, rootPart.Scale.Z),
|
||||
// new Axiom.Math.Quaternion(rootPart.RotationOffset.W, rootPart.RotationOffset.X,
|
||||
// rootPart.RotationOffset.Y, rootPart.RotationOffset.Z));
|
||||
primCount++;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -11,6 +11,7 @@ using OpenSim.Framework.Interfaces;
|
|||
using OpenSim.Framework.Types;
|
||||
using OpenSim.Physics.Manager;
|
||||
using OpenSim.Framework.Data;
|
||||
using OpenSim.Physics.Manager;
|
||||
|
||||
namespace OpenSim.Region.Environment.Scenes
|
||||
{
|
||||
|
@ -89,6 +90,10 @@ namespace OpenSim.Region.Environment.Scenes
|
|||
part.GroupPosition = value;
|
||||
}
|
||||
}
|
||||
if (m_rootPart.PhysActor != null)
|
||||
{
|
||||
m_rootPart.PhysActor.Position = new PhysicsVector(m_rootPart.GroupPosition.X, m_rootPart.GroupPosition.Y, m_rootPart.GroupPosition.Z);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -11,6 +11,7 @@ using OpenSim.Framework.Interfaces;
|
|||
using OpenSim.Framework.Types;
|
||||
using OpenSim.Region.Environment.Scenes.Scripting;
|
||||
using OpenSim.Framework.Utilities;
|
||||
using OpenSim.Physics.Manager;
|
||||
|
||||
namespace OpenSim.Region.Environment.Scenes
|
||||
{
|
||||
|
@ -22,6 +23,8 @@ namespace OpenSim.Region.Environment.Scenes
|
|||
private string m_inventoryFileName = "";
|
||||
private LLUUID m_folderID = LLUUID.Zero;
|
||||
|
||||
public PhysicsActor PhysActor = null;
|
||||
|
||||
protected Dictionary<LLUUID, TaskInventoryItem> TaskInventory = new Dictionary<LLUUID, TaskInventoryItem>();
|
||||
|
||||
public LLUUID CreatorID;
|
||||
|
|
Loading…
Reference in New Issue