Merge branch 'dev' into dev_demo_debug

dsg
Huaiyu (Kitty) Liu 2011-06-01 10:06:42 -07:00
commit 3c58a1c244
5 changed files with 47 additions and 21 deletions

View File

@ -353,6 +353,7 @@ namespace OpenSim.Region.CoreModules.RegionSync.RegionSyncModule
// pa.Size = data["size"].AsVector3(); // pa.Size = data["size"].AsVector3();
pa.Position = data["position"].AsVector3(); pa.Position = data["position"].AsVector3();
pa.Force = data["force"].AsVector3(); pa.Force = data["force"].AsVector3();
// m_log.DebugFormat("{0}: HandlePhysUpdateAttributes: receiving velocity = {1}", LogHeader, data["velocity"].AsVector3());
pa.Velocity = data["velocity"].AsVector3(); pa.Velocity = data["velocity"].AsVector3();
pa.RotationalVelocity = data["rotationalVelocity"].AsVector3(); pa.RotationalVelocity = data["rotationalVelocity"].AsVector3();
pa.Acceleration = data["acceleration"].AsVector3(); pa.Acceleration = data["acceleration"].AsVector3();
@ -416,6 +417,7 @@ namespace OpenSim.Region.CoreModules.RegionSync.RegionSyncModule
data["position"] = OSD.FromVector3(pa.Position); data["position"] = OSD.FromVector3(pa.Position);
data["force"] = OSD.FromVector3(pa.Force); data["force"] = OSD.FromVector3(pa.Force);
data["velocity"] = OSD.FromVector3(pa.Velocity); data["velocity"] = OSD.FromVector3(pa.Velocity);
// m_log.DebugFormat("{0}: HandlePhysUpdateAttributes: sending velocity = {1}", LogHeader, data["velocity"].AsVector3());
data["rotationalVelocity"] = OSD.FromVector3(pa.RotationalVelocity); data["rotationalVelocity"] = OSD.FromVector3(pa.RotationalVelocity);
data["acceleration"] = OSD.FromVector3(pa.Acceleration); data["acceleration"] = OSD.FromVector3(pa.Acceleration);
data["torque"] = OSD.FromVector3(pa.Torque); data["torque"] = OSD.FromVector3(pa.Torque);

View File

@ -459,9 +459,12 @@ namespace OpenSim.Region.CoreModules.RegionSync.RegionSyncModule
(presence.AgentControlFlags & (uint)AgentManager.ControlFlags.AGENT_CONTROL_TURN_RIGHT ) != (flags & (uint)AgentManager.ControlFlags.AGENT_CONTROL_TURN_RIGHT )); (presence.AgentControlFlags & (uint)AgentManager.ControlFlags.AGENT_CONTROL_TURN_RIGHT ) != (flags & (uint)AgentManager.ControlFlags.AGENT_CONTROL_TURN_RIGHT ));
*/ */
try try
{
if (!PhysEngineToSceneConnectorModule.IsPhysEngineActorS)
{ {
presence.AgentControlFlags = flags; presence.AgentControlFlags = flags;
presence.AbsolutePosition = pos; presence.AbsolutePosition = pos;
m_log.DebugFormat("{0}: UpdateAvatar. Setting vel={1}", LogHeader(), vel);
presence.Velocity = vel; presence.Velocity = vel;
presence.Rotation = rot; presence.Rotation = rot;
// It seems the physics scene can drop an avatar if the avatar makes it angry // It seems the physics scene can drop an avatar if the avatar makes it angry
@ -477,6 +480,7 @@ namespace OpenSim.Region.CoreModules.RegionSync.RegionSyncModule
presence.ParentID = parentID; presence.ParentID = parentID;
} }
} }
}
catch(Exception e) catch(Exception e)
{ {
m_log.ErrorFormat("{0} Caught exception in UpdatedAvatar handler (setting presence values) for {1}: {2}", LogHeader(), presence.Name, e.Message); m_log.ErrorFormat("{0} Caught exception in UpdatedAvatar handler (setting presence values) for {1}: {2}", LogHeader(), presence.Name, e.Message);

View File

@ -4357,11 +4357,13 @@ namespace OpenSim.Region.Framework.Scenes
int num = m_sceneGraph.GetNumberOfScenePresences(); int num = m_sceneGraph.GetNumberOfScenePresences();
if (num >= RegionInfo.RegionSettings.AgentLimit) // TEMP WORKAROUND for DSG DEMO
// REGION SYNC
/*if (num >= RegionInfo.RegionSettings.AgentLimit)
{ {
if (!Permissions.IsAdministrator(cAgentData.AgentID)) if (!Permissions.IsAdministrator(cAgentData.AgentID))
return false; return false;
} }*/
ScenePresence childAgentUpdate = WaitGetScenePresence(cAgentData.AgentID); ScenePresence childAgentUpdate = WaitGetScenePresence(cAgentData.AgentID);
@ -5729,14 +5731,16 @@ namespace OpenSim.Region.Framework.Scenes
{ {
int num = m_sceneGraph.GetNumberOfScenePresences(); int num = m_sceneGraph.GetNumberOfScenePresences();
if (num >= RegionInfo.RegionSettings.AgentLimit) // TEMP WORKAROUND for DSG DEMO
// REGION SYNC
/*if (num >= RegionInfo.RegionSettings.AgentLimit)
{ {
if (!Permissions.IsAdministrator(agentID)) if (!Permissions.IsAdministrator(agentID))
{ {
reason = "The region is full"; reason = "The region is full";
return false; return false;
} }
} }*/
reason = String.Empty; reason = String.Empty;
return true; return true;

View File

@ -208,9 +208,11 @@ namespace OpenSim.Region.Physics.OdePlugin
if (PhysEngineToSceneConnectorModule.IsPhysEngineActorS) if (PhysEngineToSceneConnectorModule.IsPhysEngineActorS)
{ {
// if the values have changed and it was I who changed them, send an update // if the values have changed and it was I who changed them, send an update
if (this.lastValues.Changed(this) && ChangingActorID == RegionSyncServerModule.ActorID) // if (this.lastValues.Changed(this) && ChangingActorID == RegionSyncServerModule.ActorID)
if (ChangingActorID == RegionSyncServerModule.ActorID)
{ {
// m_log.DebugFormat("[ODE CHARACTER]: Sending terse update for {0}", LocalID); // m_log.DebugFormat("[ODE CHARACTER]: Sending terse update for {0}", LocalID);
ChangingActorID = "XXX"; // it's been sent. I am not changing it.
PhysEngineToSceneConnectorModule.RouteUpdate(this); PhysEngineToSceneConnectorModule.RouteUpdate(this);
} }
} }
@ -795,6 +797,12 @@ namespace OpenSim.Region.Physics.OdePlugin
{ {
m_pidControllerActive = true; m_pidControllerActive = true;
_target_velocity = value; _target_velocity = value;
if (_target_velocity.X == 0 && _target_velocity.Y == 0 && _target_velocity.Z == 0)
{
// if stopping, force real velocity to zero
_velocity = Vector3.Zero;
// m_log.DebugFormat("{0}: Set velocity {1}", "[PHYSICS]", _target_velocity); // RADEBUG
}
base.ChangingActorID = RegionSyncServerModule.ActorID; base.ChangingActorID = RegionSyncServerModule.ActorID;
} }
else else
@ -983,10 +991,12 @@ namespace OpenSim.Region.Physics.OdePlugin
if (_target_velocity.X == 0.0f && _target_velocity.Y == 0.0f && _target_velocity.Z == 0.0f && m_iscolliding) if (_target_velocity.X == 0.0f && _target_velocity.Y == 0.0f && _target_velocity.Z == 0.0f && m_iscolliding)
{ {
// keep track of where we stopped. No more slippin' & slidin' // keep track of where we stopped. No more slippin' & slidin'
// m_log.DebugFormat("[PHYSICS]: Move setting zero. zeroFlag={0}, pidControllerActive={1}", _zeroFlag, m_pidControllerActive); // RADEBUG
if (!_zeroFlag) if (!_zeroFlag)
{ {
_zeroFlag = true; _zeroFlag = true;
_zeroPosition = d.BodyGetPosition(Body); _zeroPosition = d.BodyGetPosition(Body);
_velocity = _target_velocity;
} }
if (m_pidControllerActive) if (m_pidControllerActive)
{ {
@ -1164,13 +1174,15 @@ namespace OpenSim.Region.Physics.OdePlugin
_velocity.Y = 0.0f; _velocity.Y = 0.0f;
_velocity.Z = 0.0f; _velocity.Z = 0.0f;
/*
// Did we send out the 'stopped' message? // Did we send out the 'stopped' message?
if (!m_lastUpdateSent) if (!m_lastUpdateSent)
{ {
m_lastUpdateSent = true; m_lastUpdateSent = true;
// base.RequestPhysicsterseUpdate(); this.RequestPhysicsterseUpdate();
} }
*/
} }
else else
{ {
@ -1208,6 +1220,7 @@ namespace OpenSim.Region.Physics.OdePlugin
} }
if (!m_lastUpdateSent) if (!m_lastUpdateSent)
{ {
m_lastUpdateSent = true;
ChangingActorID = RegionSyncServerModule.ActorID; ChangingActorID = RegionSyncServerModule.ActorID;
this.RequestPhysicsterseUpdate(); this.RequestPhysicsterseUpdate();
} }

View File

@ -127,7 +127,8 @@ public class BSCharacter : PhysicsActor
if (PhysEngineToSceneConnectorModule.IsPhysEngineActorS) if (PhysEngineToSceneConnectorModule.IsPhysEngineActorS)
{ {
// if the values have changed and it was I who changed them, send an update // if the values have changed and it was I who changed them, send an update
if (this.lastValues.Changed(this) && ChangingActorID == RegionSyncServerModule.ActorID) // if (this.lastValues.Changed(this) && ChangingActorID == RegionSyncServerModule.ActorID)
if (ChangingActorID == RegionSyncServerModule.ActorID)
{ {
// m_log.DebugFormat("{0}: Sending terse update for {1}", LogHeader, LocalID); // m_log.DebugFormat("{0}: Sending terse update for {1}", LogHeader, LocalID);
PhysEngineToSceneConnectorModule.RouteUpdate(this); PhysEngineToSceneConnectorModule.RouteUpdate(this);
@ -193,6 +194,7 @@ public class BSCharacter : PhysicsActor
get { return _force; } get { return _force; }
set { set {
_force = value; _force = value;
base.ChangingActorID = RegionSyncServerModule.ActorID;
// m_log.DebugFormat("{0}: Force = {1}", LogHeader, _force); // m_log.DebugFormat("{0}: Force = {1}", LogHeader, _force);
_scene.TaintedObject(delegate() _scene.TaintedObject(delegate()
{ {
@ -404,6 +406,7 @@ public class BSCharacter : PhysicsActor
} }
if (changed) if (changed)
{ {
base.ChangingActorID = RegionSyncServerModule.ActorID;
this.RequestPhysicsterseUpdate(); this.RequestPhysicsterseUpdate();
} }
} }