Hollow prims (box only), thanks Gerard! Enjoy

This commit is contained in:
dan miller
2007-09-29 03:56:36 +00:00
parent e4b276a63b
commit a0265300aa
10 changed files with 264 additions and 35 deletions

View File

@@ -429,12 +429,17 @@ namespace OpenSim.Region.Environment.Scenes
group.AbsolutePosition = pos;
SceneObjectPart rootPart = group.GetChildPart(group.UUID);
if ((rootPart.ObjectFlags & (uint) LLObject.ObjectFlags.Phantom) == 0)
rootPart.PhysActor = phyScene.AddPrim(
{
PrimitiveBaseShape pbs = rootPart.Shape;
rootPart.PhysActor = phyScene.AddPrimShape(
rootPart.Name,
pbs,
new PhysicsVector(rootPart.AbsolutePosition.X, rootPart.AbsolutePosition.Y,
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));
}
}
}
}
}

View File

@@ -531,7 +531,9 @@ namespace OpenSim.Region.Environment.Scenes
AddEntityFromStorage(prim);
SceneObjectPart rootPart = prim.GetChildPart(prim.UUID);
if ((rootPart.ObjectFlags & (uint)LLObject.ObjectFlags.Phantom) == 0)
rootPart.PhysActor = phyScene.AddPrim(
rootPart.PhysActor = phyScene.AddPrimShape(
rootPart.Name,
rootPart.Shape,
new PhysicsVector(rootPart.AbsolutePosition.X, rootPart.AbsolutePosition.Y,
rootPart.AbsolutePosition.Z),
new PhysicsVector(rootPart.Scale.X, rootPart.Scale.Y, rootPart.Scale.Z),
@@ -579,7 +581,10 @@ namespace OpenSim.Region.Environment.Scenes
// if not phantom, add to physics
if ((rootPart.ObjectFlags & (uint)LLObject.ObjectFlags.Phantom) == 0)
rootPart.PhysActor =
phyScene.AddPrim(new PhysicsVector(pos.X, pos.Y, pos.Z),
phyScene.AddPrimShape(
rootPart.Name,
rootPart.Shape,
new PhysicsVector(pos.X, pos.Y, pos.Z),
new PhysicsVector(shape.Scale.X, shape.Scale.Y, shape.Scale.Z),
new Quaternion());
}
@@ -662,7 +667,9 @@ namespace OpenSim.Region.Environment.Scenes
SceneObjectPart rootPart = obj.GetChildPart(obj.UUID);
if ((rootPart.ObjectFlags & (uint)LLObject.ObjectFlags.Phantom) == 0)
rootPart.PhysActor = phyScene.AddPrim(
rootPart.PhysActor = phyScene.AddPrimShape(
rootPart.Name,
rootPart.Shape,
new PhysicsVector(rootPart.AbsolutePosition.X, rootPart.AbsolutePosition.Y,
rootPart.AbsolutePosition.Z),
new PhysicsVector(rootPart.Scale.X, rootPart.Scale.Y, rootPart.Scale.Z),

View File

@@ -314,12 +314,16 @@ namespace OpenSim.Region.Environment.Scenes
/// may need to create a new Physics actor.
if (dupe.RootPart.PhysActor != null)
{
dupe.RootPart.PhysActor = m_scene.PhysScene.AddPrim(
new PhysicsVector(dupe.RootPart.AbsolutePosition.X, dupe.RootPart.AbsolutePosition.Y,
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));
PrimitiveBaseShape pbs = dupe.RootPart.Shape;
dupe.RootPart.PhysActor = m_scene.PhysScene.AddPrimShape(
dupe.RootPart.Name,
pbs,
new PhysicsVector(dupe.RootPart.AbsolutePosition.X, dupe.RootPart.AbsolutePosition.Y, dupe.RootPart.AbsolutePosition.Z),
new PhysicsVector(dupe.RootPart.Scale.X, dupe.RootPart.Scale.Y, dupe.RootPart.Scale.Z),
new Axiom.Math.Quaternion(dupe.RootPart.RotationOffset.W, dupe.RootPart.RotationOffset.X,
dupe.RootPart.RotationOffset.Y, dupe.RootPart.RotationOffset.Z));
}
List<SceneObjectPart> partList = new List<SceneObjectPart>(m_parts.Values);
@@ -838,6 +842,17 @@ namespace OpenSim.Region.Environment.Scenes
{
part.UpdateShape(shapeBlock);
}
if (m_rootPart.PhysActor != null)
{
this.m_scene.PhysScene.RemovePrim(m_rootPart.PhysActor);
m_rootPart.PhysActor = m_scene.PhysScene.AddPrimShape(
m_rootPart.Name,
m_rootPart.Shape,
new PhysicsVector(m_rootPart.AbsolutePosition.X, m_rootPart.AbsolutePosition.Y, m_rootPart.AbsolutePosition.Z),
new PhysicsVector(m_rootPart.Scale.X, m_rootPart.Scale.Y, m_rootPart.Scale.Z),
new Axiom.Math.Quaternion(m_rootPart.RotationOffset.W, m_rootPart.RotationOffset.X,
m_rootPart.RotationOffset.Y, m_rootPart.RotationOffset.Z));
}
}
#endregion
@@ -1252,4 +1267,4 @@ namespace OpenSim.Region.Environment.Scenes
Text = text;
}
}
}
}

View File

@@ -914,7 +914,7 @@ namespace OpenSim.Region.Environment.Scenes
new PhysicsVector(AbsolutePosition.X, AbsolutePosition.Y,
AbsolutePosition.Z);
m_physicsActor = scene.AddAvatar(pVec);
m_physicsActor = scene.AddAvatar(this.Firstname+"."+this.Lastname, pVec);
}
internal void Close()