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.

This commit is contained in:
darok
2007-11-03 10:25:43 +00:00
parent a30866ed45
commit f8e0cf0f1d
10 changed files with 114 additions and 63 deletions

View File

@@ -456,6 +456,7 @@ namespace OpenSim.Region.Environment.Scenes
AddEntity(group);
group.AbsolutePosition = pos;
SceneObjectPart rootPart = group.GetChildPart(group.UUID);
bool UsePhysics = ((rootPart.ObjectFlags & (uint)LLObject.ObjectFlags.Physics) > 0);
if ((rootPart.ObjectFlags & (uint) LLObject.ObjectFlags.Phantom) == 0)
{
PrimitiveBaseShape pbs = rootPart.Shape;
@@ -466,7 +467,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);
}
}
}

View File

@@ -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)

View File

@@ -438,7 +438,8 @@ namespace OpenSim.Region.Environment.Scenes
dupe.RootPart.AbsolutePosition.Z),
new PhysicsVector(dupe.RootPart.Scale.X, dupe.RootPart.Scale.Y, dupe.RootPart.Scale.Z),
new Quaternion(dupe.RootPart.RotationOffset.W, dupe.RootPart.RotationOffset.X,
dupe.RootPart.RotationOffset.Y, dupe.RootPart.RotationOffset.Z));
dupe.RootPart.RotationOffset.Y, dupe.RootPart.RotationOffset.Z),
dupe.RootPart.PhysActor.IsPhysical);
}
List<SceneObjectPart> partList = new List<SceneObjectPart>(m_parts.Values);
@@ -977,7 +978,8 @@ namespace OpenSim.Region.Environment.Scenes
m_rootPart.AbsolutePosition.Z),
new PhysicsVector(m_rootPart.Scale.X, m_rootPart.Scale.Y, m_rootPart.Scale.Z),
new Quaternion(m_rootPart.RotationOffset.W, m_rootPart.RotationOffset.X,
m_rootPart.RotationOffset.Y, m_rootPart.RotationOffset.Z));
m_rootPart.RotationOffset.Y, m_rootPart.RotationOffset.Z),
m_rootPart.PhysActor.IsPhysical);
}
}

View File

@@ -672,6 +672,15 @@ namespace OpenSim.Region.Environment.Scenes
//Silently ignore it - TODO: FIXME Quick
}
if (UsePhysics)
{
AddFlag(LLObject.ObjectFlags.Physics);
}
else
{
RemFlag(LLObject.ObjectFlags.Physics);
}
if (IsPhantom)
{
AddFlag(LLObject.ObjectFlags.Phantom);
@@ -694,18 +703,10 @@ namespace OpenSim.Region.Environment.Scenes
AbsolutePosition.Z),
new PhysicsVector(Scale.X, Scale.Y, Scale.Z),
new Quaternion(RotationOffset.W, RotationOffset.X,
RotationOffset.Y, RotationOffset.Z));
RotationOffset.Y, RotationOffset.Z), UsePhysics);
}
}
if (UsePhysics)
{
AddFlag(LLObject.ObjectFlags.Physics);
}
else
{
RemFlag(LLObject.ObjectFlags.Physics);
}
if (IsTemporary)
{
AddFlag(LLObject.ObjectFlags.TemporaryOnRez);