BulletSim: add check for border crossing in character position sanity check.

0.7.5-pf-bulletsim
Robert Adams 2012-12-16 21:15:49 -08:00
parent 4cbc5082ff
commit 7ed860d3ac
1 changed files with 10 additions and 2 deletions

View File

@ -311,6 +311,15 @@ public sealed class BSCharacter : BSPhysObject
{
bool ret = false;
// TODO: check for out of bounds
if (!PhysicsScene.TerrainManager.IsWithinKnownTerrain(_position))
{
// The character is out of the known/simulated area.
// Upper levels of code will handle the transition to other areas so, for
// the time, we just ignore the position.
return ret;
}
// If below the ground, move the avatar up
float terrainHeight = PhysicsScene.TerrainManager.GetTerrainHeightAtXYZ(_position);
if (Position.Z < terrainHeight)
@ -329,7 +338,6 @@ public sealed class BSCharacter : BSPhysObject
}
}
// TODO: check for out of bounds
return ret;
}
@ -700,7 +708,7 @@ public sealed class BSCharacter : BSPhysObject
}
// Tell the linkset about value changes
Linkset.UpdateProperties(this);
Linkset.UpdateProperties(this, true);
// Avatars don't report their changes the usual way. Changes are checked for in the heartbeat loop.
// base.RequestPhysicsterseUpdate();