fixed mantis bug 375 (copy broken with physics/ODE enabled)

afrisby
dan miller 2007-09-06 03:31:32 +00:00
parent aafc82cd18
commit 3586beb81b
2 changed files with 12 additions and 1 deletions

View File

@ -60,7 +60,7 @@ namespace OpenSim.Region.Environment.Scenes
protected Timer m_heartbeatTimer = new Timer(); protected Timer m_heartbeatTimer = new Timer();
protected Dictionary<LLUUID, ScenePresence> Avatars; protected Dictionary<LLUUID, ScenePresence> Avatars;
protected Dictionary<LLUUID, SceneObjectGroup> Prims; protected Dictionary<LLUUID, SceneObjectGroup> Prims;
protected PhysicsScene phyScene; public PhysicsScene phyScene; /// publicized so it can be accessed from SceneObjectGroup.
protected float timeStep = 0.1f; protected float timeStep = 0.1f;
private Random Rand = new Random(); private Random Rand = new Random();
private uint _primCount = 702000; private uint _primCount = 702000;

View File

@ -285,6 +285,17 @@ namespace OpenSim.Region.Environment.Scenes
dupe.m_regionHandle = this.m_regionHandle; dupe.m_regionHandle = this.m_regionHandle;
dupe.CopyRootPart(this.m_rootPart); dupe.CopyRootPart(this.m_rootPart);
/// may need to create a new Physics actor.
if (dupe.RootPart.PhysActor != null)
{
dupe.RootPart.PhysActor = m_scene.phyScene.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 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>(this.m_parts.Values); List<SceneObjectPart> partList = new List<SceneObjectPart>(this.m_parts.Values);
foreach (SceneObjectPart part in partList) foreach (SceneObjectPart part in partList)
{ {