From cd1a23fc142a12bb14ddb9d88d39e6acb41937b4 Mon Sep 17 00:00:00 2001 From: Robert Adams Date: Mon, 4 Nov 2013 22:09:52 -0800 Subject: varregion: remove uses of region size constant. In particular, update scene to check for border crossings based on the size of the region. --- OpenSim/Region/Physics/BulletSPlugin/BSPrim.cs | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) (limited to 'OpenSim/Region/Physics') diff --git a/OpenSim/Region/Physics/BulletSPlugin/BSPrim.cs b/OpenSim/Region/Physics/BulletSPlugin/BSPrim.cs index 15b7090..edec949 100644 --- a/OpenSim/Region/Physics/BulletSPlugin/BSPrim.cs +++ b/OpenSim/Region/Physics/BulletSPlugin/BSPrim.cs @@ -376,18 +376,19 @@ public class BSPrim : BSPhysObject { bool ret = false; - uint wayOutThere = Constants.RegionSize * Constants.RegionSize; + int wayOverThere = -1000; + int wayOutThere = 10000; // There have been instances of objects getting thrown way out of bounds and crashing // the border crossing code. - if ( RawPosition.X < -Constants.RegionSize || RawPosition.X > wayOutThere - || RawPosition.Y < -Constants.RegionSize || RawPosition.Y > wayOutThere - || RawPosition.Z < -Constants.RegionSize || RawPosition.Z > wayOutThere) + if ( RawPosition.X < wayOverThere || RawPosition.X > wayOutThere + || RawPosition.Y < wayOverThere || RawPosition.X > wayOutThere + || RawPosition.Z < wayOverThere || RawPosition.X > wayOutThere) { RawPosition = new OMV.Vector3(10, 10, 50); ZeroMotion(inTaintTime); ret = true; } - if (RawVelocity.LengthSquared() > BSParam.MaxLinearVelocity) + if (RawVelocity.LengthSquared() > BSParam.MaxLinearVelocitySquared) { RawVelocity = Util.ClampV(RawVelocity, BSParam.MaxLinearVelocity); ret = true; -- cgit v1.1