From 1c3d84fe03811aad3896031a6391bd37e140f80c Mon Sep 17 00:00:00 2001 From: Robert Adams Date: Wed, 23 Jan 2013 16:14:15 -0800 Subject: BulletSim: pass up and report the real collision penetration. --- OpenSim/Region/Physics/BulletSPlugin/BSApiTemplate.cs | 1 + OpenSim/Region/Physics/BulletSPlugin/BSScene.cs | 5 +++-- 2 files changed, 4 insertions(+), 2 deletions(-) (limited to 'OpenSim/Region/Physics/BulletSPlugin') diff --git a/OpenSim/Region/Physics/BulletSPlugin/BSApiTemplate.cs b/OpenSim/Region/Physics/BulletSPlugin/BSApiTemplate.cs index 2828cab..f25b447 100644 --- a/OpenSim/Region/Physics/BulletSPlugin/BSApiTemplate.cs +++ b/OpenSim/Region/Physics/BulletSPlugin/BSApiTemplate.cs @@ -130,6 +130,7 @@ public struct CollisionDesc public uint bID; public Vector3 point; public Vector3 normal; + public float penetration; } [StructLayout(LayoutKind.Sequential)] public struct EntityProperties diff --git a/OpenSim/Region/Physics/BulletSPlugin/BSScene.cs b/OpenSim/Region/Physics/BulletSPlugin/BSScene.cs index 34fd2a0..35dba9b 100644 --- a/OpenSim/Region/Physics/BulletSPlugin/BSScene.cs +++ b/OpenSim/Region/Physics/BulletSPlugin/BSScene.cs @@ -557,8 +557,9 @@ public sealed class BSScene : PhysicsScene, IPhysicsParameters uint cB = m_collisionArray[ii].bID; Vector3 point = m_collisionArray[ii].point; Vector3 normal = m_collisionArray[ii].normal; - SendCollision(cA, cB, point, normal, 0.01f); - SendCollision(cB, cA, point, -normal, 0.01f); + float penetration = m_collisionArray[ii].penetration; + SendCollision(cA, cB, point, normal, penetration); + SendCollision(cB, cA, point, -normal, penetration); } } -- cgit v1.1