added avatar updates for physics movement -- fixes gravity & avatar collision (ODE)

afrisby
dan miller 2007-09-09 21:21:09 +00:00
parent 907918e68e
commit 86e3fc3da2
2 changed files with 16 additions and 4 deletions

View File

@ -251,7 +251,7 @@ namespace OpenSim.Region.Environment.Scenes
{ {
if (phyScene.IsThreaded) if (phyScene.IsThreaded)
{ {
phyScene.GetResults(); phyScene.GetResults(); /// no engines implement this, and what does it have to do with threading? possible DEAD CODE
} }
List<EntityBase> moveEntities = new List<EntityBase>(Entities.Values); List<EntityBase> moveEntities = new List<EntityBase>(Entities.Values);

View File

@ -72,6 +72,7 @@ namespace OpenSim.Region.Environment.Scenes
private IScenePresenceBody m_body; private IScenePresenceBody m_body;
private Vector3[] Dir_Vectors = new Vector3[6]; private Vector3[] Dir_Vectors = new Vector3[6];
private libsecondlife.LLVector3 lastPhysPos = new libsecondlife.LLVector3();
private enum Dir_ControlFlags private enum Dir_ControlFlags
{ {
DIR_CONTROL_FLAG_FOWARD = MainAvatar.ControlFlags.AGENT_CONTROL_AT_POS, DIR_CONTROL_FLAG_FOWARD = MainAvatar.ControlFlags.AGENT_CONTROL_AT_POS,
@ -470,11 +471,15 @@ namespace OpenSim.Region.Environment.Scenes
if (this.childAgent == false) if (this.childAgent == false)
{ {
/// check for user movement 'forces' (ie commands to move)
if (this.newForce) if (this.newForce)
{ {
this.SendTerseUpdateToALLClients(); this.SendTerseUpdateToALLClients();
_updateCount = 0; _updateCount = 0;
} }
/// check for scripted movement (?)
else if (movementflag != 0) else if (movementflag != 0)
{ {
_updateCount++; _updateCount++;
@ -485,6 +490,13 @@ namespace OpenSim.Region.Environment.Scenes
} }
} }
/// check for physics-related movement
else if (this.lastPhysPos.GetDistanceTo(this.AbsolutePosition) > 0.02 )
{
this.SendTerseUpdateToALLClients();
_updateCount = 0;
this.lastPhysPos = this.AbsolutePosition;
}
this.CheckForSignificantMovement(); this.CheckForSignificantMovement();
this.CheckForBorderCrossing(); this.CheckForBorderCrossing();