Make PECharacter sync PhysActor info back to physics actor. Remove some chatty debug messages. Add checks to warn if PhysicsActor synchronization is acting on a prim rather than a character.

dsg
Robert Adams 2011-03-01 12:42:05 -08:00
parent 400c9b5293
commit 6b9d58b99b
5 changed files with 47 additions and 8 deletions

View File

@ -379,10 +379,14 @@ namespace OpenSim.Region.CoreModules.RegionSync.RegionSyncModule
{
UUID uuid = data["uuid"].AsUUID();
string actorID = data["actorID"].AsString();
// m_log.DebugFormat("{0}: HandlPhysUpdateAttributes for {1}", LogHeader, uuid);
m_log.DebugFormat("{0}: HandlPhysUpdateAttributes for {1}", LogHeader, uuid);
PhysicsActor pa = FindPhysicsActor(uuid);
if (pa != null)
{
if (pa.PhysicsActorType == (int)ActorTypes.Prim)
{
m_log.WarnFormat("{0}: HandlePhysUpdateAttributes for an prim: {1}", LogHeader, pa.UUID);
}
// pa.Size = data["size"].AsVector3();
pa.Position = data["position"].AsVector3();
pa.Force = data["force"].AsVector3();
@ -436,6 +440,10 @@ namespace OpenSim.Region.CoreModules.RegionSync.RegionSyncModule
public void SendPhysUpdateAttributes(PhysicsActor pa)
{
// m_log.DebugFormat("{0}: SendPhysUpdateAttributes for {1}", LogHeader, pa.UUID);
if (pa.PhysicsActorType == (int)ActorTypes.Prim)
{
m_log.WarnFormat("{0}: SendPhysUpdateAttributes for an prim: {1}", LogHeader, pa.UUID);
}
OSDMap data = new OSDMap(17);
data["time"] = OSD.FromString(DateTime.Now.ToString("yyyyMMddHHmmssfff"));
data["localID"] = OSD.FromUInteger(pa.LocalID);

View File

@ -346,6 +346,10 @@ namespace OpenSim.Region.CoreModules.RegionSync.RegionSyncModule
PhysicsActor pa = FindPhysicsActor(uuid);
if (pa != null)
{
if (pa.PhysicsActorType == (int)ActorTypes.Prim)
{
m_log.WarnFormat("{0}: HandlePhysUpdateAttributes for an prim: {1}", LogHeader, pa.UUID);
}
pa.Size = data["size"].AsVector3();
pa.Position = data["position"].AsVector3();
pa.Force = data["force"].AsVector3();
@ -397,6 +401,10 @@ namespace OpenSim.Region.CoreModules.RegionSync.RegionSyncModule
public void SendPhysUpdateAttributes(PhysicsActor pa)
{
// m_log.DebugFormat("{0}: sending PhysUpdateAttributes for {1}", LogHeader, pa.UUID);
if (pa.PhysicsActorType == (int)ActorTypes.Prim)
{
m_log.WarnFormat("{0}: SendPhysUpdateAttributes for an prim: {1}", LogHeader, pa.UUID);
}
OSDMap data = new OSDMap(15);
data["time"] = OSD.FromString(DateTime.Now.ToString("yyyyMMddHHmmssfff"));
data["localID"] = OSD.FromUInteger(pa.LocalID);

View File

@ -1643,7 +1643,7 @@ namespace OpenSim.Region.Framework.Scenes
{
// m_log.DebugFormat("{0} {1}", update_movementflag, (update_rotation && DCFlagKeyPressed));
// m_log.DebugFormat(
// "In {0} adding velocity to {1} of {2}", m_scene.RegionInfo.RegionName, Name, agent_control_v3);
// "[SCENE PRESENCE] In {0} adding velocity to {1} of {2}", m_scene.RegionInfo.RegionName, Name, agent_control_v3);
AddNewMovement(agent_control_v3, q);
@ -2443,7 +2443,7 @@ namespace OpenSim.Region.Framework.Scenes
/// </summary>
public void SendTerseUpdateToAllClients()
{
m_log.DebugFormat("[SCENE PRESENCE]: TerseUpdate: UUID={0}, pos={1}", m_physicsActor.UUID.ToString(), m_physicsActor.Position.ToString());
// m_log.DebugFormat("[SCENE PRESENCE]: TerseUpdate: UUID={0}, pos={1}", m_physicsActor.UUID.ToString(), m_physicsActor.Position.ToString());
// REGION SYNC
if (m_scene.IsSyncedServer())
{

View File

@ -30,6 +30,7 @@ using log4net;
using OpenMetaverse;
using OpenSim.Framework;
using OpenSim.Region.Physics.Manager;
using OpenSim.Region.CoreModules.RegionSync.RegionSyncModule;
namespace OpenSim.Region.Physics.PEPlugin
{
@ -86,6 +87,24 @@ public class PECharacter : PhysicsActor
return;
}
public override void RequestPhysicsterseUpdate()
{
if (PhysEngineToSceneConnectorModule.IsPhysEngineActorS)
{
// if the values have changed and it was I who changed them, send an update
if (this.lastValues.Changed(this) && ChangingActorID == RegionSyncServerModule.ActorID)
{
// m_log.DebugFormat("[ODE CHARACTER]: Sending terse update for {0}", LocalID);
PhysEngineToSceneConnectorModule.RouteUpdate(this);
}
}
else
{
base.RequestPhysicsterseUpdate();
}
}
public override bool Stopped {
get { return _stopped; }
}
@ -105,12 +124,12 @@ public class PECharacter : PhysicsActor
}
public override bool Grabbed {
set { _grabbed = value;
m_log.Debug("[RPE] PEChar set Grabbed");
// m_log.Debug("[RPE] PEChar set Grabbed");
}
}
public override bool Selected {
set { _selected = value;
m_log.Debug("[RPE] PEChar set Selected");
// m_log.Debug("[RPE] PEChar set Selected");
}
}
public override void CrossingFailure() { return; }
@ -121,6 +140,7 @@ public class PECharacter : PhysicsActor
public override Vector3 Position {
get { return _position; }
set { _position = value;
base.ChangingActorID = RegionSyncServerModule.ActorID;
}
}
public override float Mass {
@ -133,6 +153,7 @@ public class PECharacter : PhysicsActor
public override Vector3 Force {
get { return _force; }
set { _force = value;
base.ChangingActorID = RegionSyncServerModule.ActorID;
}
}
@ -153,6 +174,7 @@ public class PECharacter : PhysicsActor
public override Vector3 Velocity {
get { return _velocity; }
set { _velocity = value;
base.ChangingActorID = RegionSyncServerModule.ActorID;
}
}
public override Vector3 Torque {
@ -171,6 +193,7 @@ public class PECharacter : PhysicsActor
public override Quaternion Orientation {
get { return _orientation; }
set { _orientation = value;
base.ChangingActorID = RegionSyncServerModule.ActorID;
}
}
public override int PhysicsActorType {

View File

@ -96,7 +96,7 @@ public sealed class PEPrim : PhysicsActor
}
public override PrimitiveBaseShape Shape {
set { _pbs = value;
m_log.Debug("[REMOTE PRIM ENGINE] PEPrim set Shape");
// m_log.Debug("[REMOTE PRIM ENGINE] PEPrim set Shape");
// SyncUpdated = true;
}
}
@ -109,12 +109,12 @@ public sealed class PEPrim : PhysicsActor
}
public override bool Grabbed {
set { _grabbed = value;
m_log.Debug("[REMOTE PRIM ENGINE] PEPrim set Grabbed");
// m_log.Debug("[REMOTE PRIM ENGINE] PEPrim set Grabbed");
}
}
public override bool Selected {
set { _selected = value;
m_log.Debug("[REMOTE PRIM ENGINE] PEPrim set Selected");
// m_log.Debug("[REMOTE PRIM ENGINE] PEPrim set Selected");
}
}
public override void CrossingFailure() { return; }