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

View File

@ -460,21 +460,25 @@ namespace OpenSim.Region.CoreModules.RegionSync.RegionSyncModule
*/
try
{
presence.AgentControlFlags = flags;
presence.AbsolutePosition = pos;
presence.Velocity = vel;
presence.Rotation = rot;
// It seems the physics scene can drop an avatar if the avatar makes it angry
if (presence.PhysicsActor != null)
if (!PhysEngineToSceneConnectorModule.IsPhysEngineActorS)
{
presence.PhysicsActor.Flying = flying;
presence.PhysicsActor.CollidingGround = !flying;
}
if (doFullUpdate)
{
presence.CollisionPlane = collisionPlane;
presence.OffsetPosition = offsetPosition;
presence.ParentID = parentID;
presence.AgentControlFlags = flags;
presence.AbsolutePosition = pos;
m_log.DebugFormat("{0}: UpdateAvatar. Setting vel={1}", LogHeader(), vel);
presence.Velocity = vel;
presence.Rotation = rot;
// It seems the physics scene can drop an avatar if the avatar makes it angry
if (presence.PhysicsActor != null)
{
presence.PhysicsActor.Flying = flying;
presence.PhysicsActor.CollidingGround = !flying;
}
if (doFullUpdate)
{
presence.CollisionPlane = collisionPlane;
presence.OffsetPosition = offsetPosition;
presence.ParentID = parentID;
}
}
}
catch(Exception e)

View File

@ -4357,11 +4357,13 @@ namespace OpenSim.Region.Framework.Scenes
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))
return false;
}
}*/
ScenePresence childAgentUpdate = WaitGetScenePresence(cAgentData.AgentID);
@ -5729,14 +5731,16 @@ namespace OpenSim.Region.Framework.Scenes
{
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))
{
reason = "The region is full";
return false;
}
}
}*/
reason = String.Empty;
return true;

View File

@ -208,9 +208,11 @@ namespace OpenSim.Region.Physics.OdePlugin
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)
// if (this.lastValues.Changed(this) && ChangingActorID == RegionSyncServerModule.ActorID)
if (ChangingActorID == RegionSyncServerModule.ActorID)
{
// 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);
}
}
@ -795,6 +797,12 @@ namespace OpenSim.Region.Physics.OdePlugin
{
m_pidControllerActive = true;
_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;
}
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)
{
// 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)
{
_zeroFlag = true;
_zeroPosition = d.BodyGetPosition(Body);
_velocity = _target_velocity;
}
if (m_pidControllerActive)
{
@ -1164,13 +1174,15 @@ namespace OpenSim.Region.Physics.OdePlugin
_velocity.Y = 0.0f;
_velocity.Z = 0.0f;
/*
// Did we send out the 'stopped' message?
if (!m_lastUpdateSent)
{
m_lastUpdateSent = true;
// base.RequestPhysicsterseUpdate();
this.RequestPhysicsterseUpdate();
}
*/
}
else
{
@ -1208,6 +1220,7 @@ namespace OpenSim.Region.Physics.OdePlugin
}
if (!m_lastUpdateSent)
{
m_lastUpdateSent = true;
ChangingActorID = RegionSyncServerModule.ActorID;
this.RequestPhysicsterseUpdate();
}

View File

@ -127,7 +127,8 @@ public class BSCharacter : PhysicsActor
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)
// if (this.lastValues.Changed(this) && ChangingActorID == RegionSyncServerModule.ActorID)
if (ChangingActorID == RegionSyncServerModule.ActorID)
{
// m_log.DebugFormat("{0}: Sending terse update for {1}", LogHeader, LocalID);
PhysEngineToSceneConnectorModule.RouteUpdate(this);
@ -193,6 +194,7 @@ public class BSCharacter : PhysicsActor
get { return _force; }
set {
_force = value;
base.ChangingActorID = RegionSyncServerModule.ActorID;
// m_log.DebugFormat("{0}: Force = {1}", LogHeader, _force);
_scene.TaintedObject(delegate()
{
@ -404,6 +406,7 @@ public class BSCharacter : PhysicsActor
}
if (changed)
{
base.ChangingActorID = RegionSyncServerModule.ActorID;
this.RequestPhysicsterseUpdate();
}
}