aboutsummaryrefslogtreecommitdiffstatshomepage
diff options
context:
space:
mode:
authorRobert Adams2012-12-11 14:27:09 -0800
committerRobert Adams2012-12-11 14:27:09 -0800
commita082ce9da78ffb50454834fde4e3dd19e3b5bc74 (patch)
tree13c255035ebbad1430f869a1d8ba66dc2578e881
parentBulletSim: protect character property setting to remove crash from taints set... (diff)
downloadopensim-SC_OLD-a082ce9da78ffb50454834fde4e3dd19e3b5bc74.zip
opensim-SC_OLD-a082ce9da78ffb50454834fde4e3dd19e3b5bc74.tar.gz
opensim-SC_OLD-a082ce9da78ffb50454834fde4e3dd19e3b5bc74.tar.bz2
opensim-SC_OLD-a082ce9da78ffb50454834fde4e3dd19e3b5bc74.tar.xz
BulletSim: fix crash caused by the creation of a linkset child that is under the terrain. Users can sure find some interesting corner conditions.
-rw-r--r--OpenSim/Region/Physics/BulletSPlugin/BSPrim.cs8
1 files changed, 4 insertions, 4 deletions
diff --git a/OpenSim/Region/Physics/BulletSPlugin/BSPrim.cs b/OpenSim/Region/Physics/BulletSPlugin/BSPrim.cs
index 446e44c..35d22c0 100644
--- a/OpenSim/Region/Physics/BulletSPlugin/BSPrim.cs
+++ b/OpenSim/Region/Physics/BulletSPlugin/BSPrim.cs
@@ -332,12 +332,12 @@ public sealed class BSPrim : BSPhysObject
332 332
333 float terrainHeight = PhysicsScene.TerrainManager.GetTerrainHeightAtXYZ(_position); 333 float terrainHeight = PhysicsScene.TerrainManager.GetTerrainHeightAtXYZ(_position);
334 OMV.Vector3 upForce = OMV.Vector3.Zero; 334 OMV.Vector3 upForce = OMV.Vector3.Zero;
335 if (Position.Z < terrainHeight) 335 if (RawPosition.Z < terrainHeight)
336 { 336 {
337 DetailLog("{0},BSPrim.PositionAdjustUnderGround,call,pos={1},terrain={2}", LocalID, _position, terrainHeight); 337 DetailLog("{0},BSPrim.PositionAdjustUnderGround,call,pos={1},terrain={2}", LocalID, _position, terrainHeight);
338 float targetHeight = terrainHeight + (Size.Z / 2f); 338 float targetHeight = terrainHeight + (Size.Z / 2f);
339 // Upforce proportional to the distance away from the terrain. Correct the error in 1 sec. 339 // Upforce proportional to the distance away from the terrain. Correct the error in 1 sec.
340 upForce.Z = (terrainHeight - Position.Z) * 1f; 340 upForce.Z = (terrainHeight - RawPosition.Z) * 1f;
341 ret = true; 341 ret = true;
342 } 342 }
343 343
@@ -345,10 +345,10 @@ public sealed class BSPrim : BSPhysObject
345 { 345 {
346 float waterHeight = PhysicsScene.TerrainManager.GetWaterLevelAtXYZ(_position); 346 float waterHeight = PhysicsScene.TerrainManager.GetWaterLevelAtXYZ(_position);
347 // TODO: a floating motor so object will bob in the water 347 // TODO: a floating motor so object will bob in the water
348 if (Math.Abs(Position.Z - waterHeight) > 0.1f) 348 if (Math.Abs(RawPosition.Z - waterHeight) > 0.1f)
349 { 349 {
350 // Upforce proportional to the distance away from the water. Correct the error in 1 sec. 350 // Upforce proportional to the distance away from the water. Correct the error in 1 sec.
351 upForce.Z = (waterHeight - Position.Z) * 1f; 351 upForce.Z = (waterHeight - RawPosition.Z) * 1f;
352 ret = true; 352 ret = true;
353 } 353 }
354 } 354 }