From 04132d3af4c8f44639ea842091f86274513e2dfd Mon Sep 17 00:00:00 2001 From: Robert Adams Date: Tue, 1 Jan 2013 09:30:49 -0800 Subject: BulletSim: subclass Bullet[World|Body|Shape|Constraint] for unmanaged to have pointers and managed to have objects. Initial paste of XNA code. Commented out. --- OpenSim/Region/Physics/BulletSPlugin/BSPrim.cs | 37 +++++++++++++++----------- 1 file changed, 21 insertions(+), 16 deletions(-) (limited to 'OpenSim/Region/Physics/BulletSPlugin/BSPrim.cs') diff --git a/OpenSim/Region/Physics/BulletSPlugin/BSPrim.cs b/OpenSim/Region/Physics/BulletSPlugin/BSPrim.cs index 064ce3c..cb8108d 100644 --- a/OpenSim/Region/Physics/BulletSPlugin/BSPrim.cs +++ b/OpenSim/Region/Physics/BulletSPlugin/BSPrim.cs @@ -300,7 +300,7 @@ public sealed class BSPrim : BSPhysObject // All positions are given in world positions. if (_position == value) { - DetailLog("{0},BSPrim.setPosition,taint,positionNotChanging,pos={1},orient={2}", LocalID, _position, _orientation); + DetailLog("{0},BSPrim.setPosition,call,positionNotChanging,pos={1},orient={2}", LocalID, _position, _orientation); return; } _position = value; @@ -894,21 +894,26 @@ public sealed class BSPrim : BSPhysObject // Object MUST NOT already be in the world. // This routine exists because some assorted properties get mangled by adding to the world. internal void AddObjectToPhysicalWorld() - { - if (PhysBody.HasPhysicalBody) - { - PhysicsScene.PE.AddObjectToWorld(PhysicsScene.World, PhysBody); - - // TODO: Fix this. Total kludge because adding object to world resets its gravity to default. - // Replace this when the new AddObjectToWorld function is complete. - PhysicsScene.PE.SetGravity(PhysBody, ComputeGravity()); - - // Collision filter can be set only when the object is in the world - if (!PhysBody.ApplyCollisionMask(PhysicsScene)) - { - m_log.ErrorFormat("{0} Failed setting object collision mask: id={1}", LogHeader, LocalID); - DetailLog("{0},BSPrim.UpdatePhysicalParameters,failedSetMaskGroup,cType={1}", LocalID, PhysBody.collisionType); - } + { + if (PhysBody.HasPhysicalBody) + { + PhysicsScene.PE.AddObjectToWorld(PhysicsScene.World, PhysBody); + + // TODO: Fix this. Total kludge because adding object to world resets its gravity to default. + // Replace this when the new AddObjectToWorld function is complete. + PhysicsScene.PE.SetGravity(PhysBody, ComputeGravity()); + + // Collision filter can be set only when the object is in the world + if (!PhysBody.ApplyCollisionMask(PhysicsScene)) + { + m_log.ErrorFormat("{0} Failed setting object collision mask: id={1}", LogHeader, LocalID); + DetailLog("{0},BSPrim.UpdatePhysicalParameters,failedSetMaskGroup,cType={1}", LocalID, PhysBody.collisionType); + } + } + else + { + m_log.ErrorFormat("{0} Attempt to add physical object without body. id={1}", LogHeader, LocalID); + DetailLog("{0},BSPrim.UpdatePhysicalParameters,addObjectWithoutBody,cType={1}", LocalID, PhysBody.collisionType); } } -- cgit v1.1