From 7ed860d3ac8307b2f404fea1c40471ee488cf70e Mon Sep 17 00:00:00 2001 From: Robert Adams Date: Sun, 16 Dec 2012 21:15:49 -0800 Subject: BulletSim: add check for border crossing in character position sanity check. --- OpenSim/Region/Physics/BulletSPlugin/BSCharacter.cs | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) (limited to 'OpenSim') diff --git a/OpenSim/Region/Physics/BulletSPlugin/BSCharacter.cs b/OpenSim/Region/Physics/BulletSPlugin/BSCharacter.cs index 0defb24..4dd6264 100644 --- a/OpenSim/Region/Physics/BulletSPlugin/BSCharacter.cs +++ b/OpenSim/Region/Physics/BulletSPlugin/BSCharacter.cs @@ -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(); -- cgit v1.1