Converted PhysicsActor identification from localID to UUID
parent
42563e77fa
commit
c541b42f7e
|
@ -379,10 +379,10 @@ namespace OpenSim.Region.CoreModules.RegionSync.RegionSyncModule
|
|||
OSDMap data = RegionSyncUtil.DeserializeMessage(msg, LogHeader);
|
||||
try
|
||||
{
|
||||
uint localID = data["localID"].AsUInteger();
|
||||
UUID uuid = data["uuid"].AsUUID();
|
||||
string actorID = data["actorID"].AsString();
|
||||
// m_log.DebugFormat("{0}: HandlPhysUpdateAttributes for {1}", LogHeader, localID);
|
||||
PhysicsActor pa = FindPhysicsActor(localID);
|
||||
// m_log.DebugFormat("{0}: HandlPhysUpdateAttributes for {1}", LogHeader, uuid);
|
||||
PhysicsActor pa = FindPhysicsActor(uuid);
|
||||
if (pa != null)
|
||||
{
|
||||
// pa.Size = data["size"].AsVector3();
|
||||
|
@ -396,7 +396,7 @@ namespace OpenSim.Region.CoreModules.RegionSync.RegionSyncModule
|
|||
pa.Flying = data["flying"].AsBoolean(); // receive??
|
||||
pa.Kinematic = data["kinematic"].AsBoolean(); // receive??
|
||||
pa.Buoyancy = (float)(data["buoyancy"].AsReal());
|
||||
SceneObjectPart sop = m_validLocalScene.GetSceneObjectPart(localID);
|
||||
SceneObjectPart sop = m_validLocalScene.GetSceneObjectPart(uuid);
|
||||
if (sop != null)
|
||||
{
|
||||
pa.Shape = sop.Shape;
|
||||
|
@ -405,7 +405,7 @@ namespace OpenSim.Region.CoreModules.RegionSync.RegionSyncModule
|
|||
}
|
||||
else
|
||||
{
|
||||
m_log.WarnFormat("{0}: attribute update for unknown localID {1}", LogHeader, localID);
|
||||
m_log.WarnFormat("{0}: attribute update for unknown uuid {1}", LogHeader, uuid);
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
@ -418,14 +418,14 @@ namespace OpenSim.Region.CoreModules.RegionSync.RegionSyncModule
|
|||
}
|
||||
|
||||
// Find the physics actor whether it is an object or a scene presence
|
||||
private PhysicsActor FindPhysicsActor(uint localID)
|
||||
private PhysicsActor FindPhysicsActor(UUID uuid)
|
||||
{
|
||||
SceneObjectPart sop = m_validLocalScene.GetSceneObjectPart(localID);
|
||||
SceneObjectPart sop = m_validLocalScene.GetSceneObjectPart(uuid);
|
||||
if (sop != null)
|
||||
{
|
||||
return sop.PhysActor;
|
||||
}
|
||||
ScenePresence sp = m_validLocalScene.GetScenePresence(localID);
|
||||
ScenePresence sp = m_validLocalScene.GetScenePresence(uuid);
|
||||
if (sp != null)
|
||||
{
|
||||
return sp.PhysicsActor;
|
||||
|
@ -435,9 +435,10 @@ namespace OpenSim.Region.CoreModules.RegionSync.RegionSyncModule
|
|||
|
||||
public void SendPhysUpdateAttributes(PhysicsActor pa)
|
||||
{
|
||||
// m_log.DebugFormat("{0}: SendPhysUpdateAttributes for {1}", LogHeader, pa.LocalID);
|
||||
// m_log.DebugFormat("{0}: SendPhysUpdateAttributes for {1}", LogHeader, pa.UUID);
|
||||
OSDMap data = new OSDMap(9);
|
||||
data["localID"] = OSD.FromUInteger(pa.LocalID);
|
||||
data["uuid"] = OSD.FromUUID(pa.UUID);
|
||||
data["actorID"] = OSD.FromString(RegionSyncServerModule.ActorID);
|
||||
data["size"] = OSD.FromVector3(pa.Size);
|
||||
data["position"] = OSD.FromVector3(pa.Position);
|
||||
|
|
|
@ -240,7 +240,7 @@ namespace OpenSim.Region.CoreModules.RegionSync.RegionSyncModule
|
|||
{
|
||||
try
|
||||
{
|
||||
sop = ss.GetSceneObjectPart(pa.LocalID);
|
||||
sop = ss.GetSceneObjectPart(pa.UUID);
|
||||
}
|
||||
catch
|
||||
{
|
||||
|
@ -253,7 +253,7 @@ namespace OpenSim.Region.CoreModules.RegionSync.RegionSyncModule
|
|||
}
|
||||
try
|
||||
{
|
||||
sp = ss.GetScenePresence(pa.LocalID);
|
||||
sp = ss.GetScenePresence(pa.UUID);
|
||||
}
|
||||
catch
|
||||
{
|
||||
|
@ -278,7 +278,7 @@ namespace OpenSim.Region.CoreModules.RegionSync.RegionSyncModule
|
|||
}
|
||||
else
|
||||
{
|
||||
Console.WriteLine("RouteUpdate: no SOP found for {0}", pa.LocalID);
|
||||
Console.WriteLine("RouteUpdate: no SOP found for {0}", pa.UUID);
|
||||
}
|
||||
return;
|
||||
}
|
||||
|
|
|
@ -296,16 +296,16 @@ namespace OpenSim.Region.CoreModules.RegionSync.RegionSyncModule
|
|||
OSDMap data = RegionSyncUtil.DeserializeMessage(msg, LogHeader);
|
||||
try
|
||||
{
|
||||
uint localID = data["localID"].AsUInteger();
|
||||
// m_log.DebugFormat("{0}: received PhysUpdateAttributes for {1}", LogHeader, localID);
|
||||
PhysicsActor pa = FindPhysicsActor(localID);
|
||||
UUID uuid = data["uuid"].AsUUID();
|
||||
// m_log.DebugFormat("{0}: received PhysUpdateAttributes for {1}", LogHeader, uuid);
|
||||
PhysicsActor pa = FindPhysicsActor(uuid);
|
||||
if (pa != null)
|
||||
{
|
||||
pa.RequestPhysicsterseUpdate();
|
||||
}
|
||||
else
|
||||
{
|
||||
m_log.WarnFormat("{0}: terse update for unknown localID {1}", LogHeader, localID);
|
||||
m_log.WarnFormat("{0}: terse update for unknown uuid {1}", LogHeader, uuid);
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
@ -339,10 +339,10 @@ namespace OpenSim.Region.CoreModules.RegionSync.RegionSyncModule
|
|||
OSDMap data = RegionSyncUtil.DeserializeMessage(msg, LogHeader);
|
||||
try
|
||||
{
|
||||
uint localID = data["localID"].AsUInteger();
|
||||
UUID uuid = data["uuid"].AsUUID();
|
||||
string actorID = data["actorID"].AsString();
|
||||
// m_log.DebugFormat("{0}: received PhysUpdateAttributes for {1}", LogHeader, localID);
|
||||
PhysicsActor pa = FindPhysicsActor(localID);
|
||||
// m_log.DebugFormat("{0}: received PhysUpdateAttributes for {1}", LogHeader, uuid);
|
||||
PhysicsActor pa = FindPhysicsActor(uuid);
|
||||
if (pa != null)
|
||||
{
|
||||
pa.ChangingActorID = actorID;
|
||||
|
@ -363,7 +363,7 @@ namespace OpenSim.Region.CoreModules.RegionSync.RegionSyncModule
|
|||
}
|
||||
else
|
||||
{
|
||||
m_log.WarnFormat("{0}: attribute update for unknown localID {1}", LogHeader, localID);
|
||||
m_log.WarnFormat("{0}: attribute update for unknown uuid {1}", LogHeader, uuid);
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
@ -376,14 +376,14 @@ namespace OpenSim.Region.CoreModules.RegionSync.RegionSyncModule
|
|||
}
|
||||
|
||||
// Find the physics actor whether it is an object or a scene presence
|
||||
private PhysicsActor FindPhysicsActor(uint localID)
|
||||
private PhysicsActor FindPhysicsActor(UUID uuid)
|
||||
{
|
||||
SceneObjectPart sop = m_scene.GetSceneObjectPart(localID);
|
||||
SceneObjectPart sop = m_scene.GetSceneObjectPart(uuid);
|
||||
if (sop != null)
|
||||
{
|
||||
return sop.PhysActor;
|
||||
}
|
||||
ScenePresence sp = m_scene.GetScenePresence(localID);
|
||||
ScenePresence sp = m_scene.GetScenePresence(uuid);
|
||||
if (sp != null)
|
||||
{
|
||||
return sp.PhysicsActor;
|
||||
|
@ -393,9 +393,10 @@ namespace OpenSim.Region.CoreModules.RegionSync.RegionSyncModule
|
|||
|
||||
public void SendPhysUpdateAttributes(PhysicsActor pa)
|
||||
{
|
||||
// m_log.DebugFormat("{0}: sending PhysUpdateAttributes for {1}", LogHeader, pa.LocalID);
|
||||
// m_log.DebugFormat("{0}: sending PhysUpdateAttributes for {1}", LogHeader, pa.UUID);
|
||||
OSDMap data = new OSDMap(9);
|
||||
data["localID"] = OSD.FromUInteger(pa.LocalID);
|
||||
data["uuid"] = OSD.FromUUID(pa.UUID);
|
||||
data["actorID"] = OSD.FromString(RegionSyncServerModule.ActorID);
|
||||
data["size"] = OSD.FromVector3(pa.Size);
|
||||
data["position"] = OSD.FromVector3(pa.Position);
|
||||
|
|
|
@ -231,7 +231,7 @@ namespace OpenSim.Region.CoreModules.RegionSync.RegionSyncModule
|
|||
{
|
||||
try
|
||||
{
|
||||
sop = ss.GetSceneObjectPart(pa.LocalID);
|
||||
sop = ss.GetSceneObjectPart(pa.UUID);
|
||||
}
|
||||
catch
|
||||
{
|
||||
|
@ -244,7 +244,7 @@ namespace OpenSim.Region.CoreModules.RegionSync.RegionSyncModule
|
|||
}
|
||||
else
|
||||
{
|
||||
ScenePresence sp = ss.GetScenePresence(pa.LocalID);
|
||||
ScenePresence sp = ss.GetScenePresence(pa.UUID);
|
||||
if (sp != null)
|
||||
{
|
||||
s = ss;
|
||||
|
@ -260,12 +260,12 @@ namespace OpenSim.Region.CoreModules.RegionSync.RegionSyncModule
|
|||
}
|
||||
else
|
||||
{
|
||||
Console.WriteLine("RouteUpdate: SceneToPhysEngineSyncServer is no available");
|
||||
Console.WriteLine("RouteUpdate: SceneToPhysEngineSyncServer is not available");
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
Console.WriteLine("RouteUpdate: no SOP for update of {0}", pa.LocalID);
|
||||
Console.WriteLine("RouteUpdate: no SOP for update of {0}", pa.UUID);
|
||||
}
|
||||
return;
|
||||
}
|
||||
|
|
|
@ -1468,6 +1468,7 @@ namespace OpenSim.Region.Framework.Scenes
|
|||
part.PhysActor.IsPhysical);
|
||||
|
||||
part.PhysActor.LocalID = part.LocalId;
|
||||
part.PhysActor.UUID = part.UUID;
|
||||
part.DoPhysicsPropertyUpdate(part.PhysActor.IsPhysical, true);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1593,6 +1593,7 @@ namespace OpenSim.Region.Framework.Scenes
|
|||
PhysActor.SOPName = this.Name; // save object name and desc into the PhysActor so ODE internals know the joint/body info
|
||||
PhysActor.SOPDescription = this.Description;
|
||||
PhysActor.LocalID = LocalId;
|
||||
PhysActor.UUID = UUID;
|
||||
DoPhysicsPropertyUpdate(RigidBody, true);
|
||||
PhysActor.SetVolumeDetect(VolumeDetectActive ? 1 : 0);
|
||||
}
|
||||
|
@ -4440,6 +4441,7 @@ namespace OpenSim.Region.Framework.Scenes
|
|||
if (pa != null)
|
||||
{
|
||||
pa.LocalID = LocalId;
|
||||
pa.UUID = this.UUID;
|
||||
DoPhysicsPropertyUpdate(UsePhysics, true);
|
||||
if (m_parentGroup != null)
|
||||
{
|
||||
|
|
|
@ -3342,6 +3342,7 @@ namespace OpenSim.Region.Framework.Scenes
|
|||
m_physicsActor.OnOutOfBounds += OutOfBoundsCall; // Called for PhysicsActors when there's something wrong
|
||||
m_physicsActor.SubscribeEvents(500);
|
||||
m_physicsActor.LocalID = LocalId;
|
||||
m_physicsActor.UUID = this.UUID;
|
||||
}
|
||||
|
||||
private void OutOfBoundsCall(Vector3 pos)
|
||||
|
|
|
@ -185,10 +185,17 @@ namespace OpenSim.Region.Physics.Manager
|
|||
|
||||
// RA: used to be abstract but changed to allow 'get' without changing all the phys engines
|
||||
uint m_baseLocalID;
|
||||
public virtual uint LocalID {
|
||||
public virtual uint LocalID
|
||||
{
|
||||
set { m_baseLocalID = value; }
|
||||
get { return m_baseLocalID; }
|
||||
}
|
||||
public UUID m_UUID;
|
||||
public virtual UUID UUID
|
||||
{
|
||||
set { m_UUID = value; }
|
||||
get { return m_UUID; }
|
||||
}
|
||||
public PhysActorLastValues lastValues;
|
||||
// ID of actor which last updated the values. Send if I did the change.
|
||||
public string ChangingActorID = "YY";
|
||||
|
|
Loading…
Reference in New Issue