BulletSim: fix line endings.

0.7.5-pf-bulletsim
Robert Adams 2013-01-01 09:32:21 -08:00
parent 04132d3af4
commit 0662d109c2
2 changed files with 52 additions and 52 deletions

View File

@ -55,10 +55,10 @@ private sealed class BulletBodyUnman : BulletBody
: base(id) : base(id)
{ {
ptr = xx; ptr = xx;
} }
public override bool HasPhysicalBody public override bool HasPhysicalBody
{ {
get { return ptr != IntPtr.Zero; } get { return ptr != IntPtr.Zero; }
} }
public override void Clear() public override void Clear()
{ {
@ -79,10 +79,10 @@ private sealed class BulletShapeUnman : BulletShape
ptr = xx; ptr = xx;
type = typ; type = typ;
} }
public override bool HasPhysicalShape public override bool HasPhysicalShape
{ {
get { return ptr != IntPtr.Zero; } get { return ptr != IntPtr.Zero; }
} }
public override void Clear() public override void Clear()
{ {
ptr = IntPtr.Zero; ptr = IntPtr.Zero;
@ -202,7 +202,7 @@ public override int PhysicsStep(BulletWorld world, float timeStep, int maxSubSte
public override void Shutdown(BulletWorld world) public override void Shutdown(BulletWorld world)
{ {
BulletWorldUnman worldu = world as BulletWorldUnman; BulletWorldUnman worldu = world as BulletWorldUnman;
BSAPICPP.Shutdown2(worldu.ptr); BSAPICPP.Shutdown2(worldu.ptr);
} }
@ -249,7 +249,7 @@ public override BulletShape BuildHullShapeFromMesh(BulletWorld world, BulletShap
public override BulletShape BuildNativeShape(BulletWorld world, ShapeData shapeData) public override BulletShape BuildNativeShape(BulletWorld world, ShapeData shapeData)
{ {
BulletWorldUnman worldu = world as BulletWorldUnman; BulletWorldUnman worldu = world as BulletWorldUnman;
return new BulletShapeUnman(BSAPICPP.BuildNativeShape2(worldu.ptr, shapeData), shapeData.Type); return new BulletShapeUnman(BSAPICPP.BuildNativeShape2(worldu.ptr, shapeData), shapeData.Type);
} }
@ -334,7 +334,7 @@ public override BulletShape DuplicateCollisionShape(BulletWorld world, BulletSha
public override bool DeleteCollisionShape(BulletWorld world, BulletShape shape) public override bool DeleteCollisionShape(BulletWorld world, BulletShape shape)
{ {
BulletWorldUnman worldu = world as BulletWorldUnman; BulletWorldUnman worldu = world as BulletWorldUnman;
BulletShapeUnman shapeu = shape as BulletShapeUnman; BulletShapeUnman shapeu = shape as BulletShapeUnman;
return BSAPICPP.DeleteCollisionShape2(worldu.ptr, shapeu.ptr); return BSAPICPP.DeleteCollisionShape2(worldu.ptr, shapeu.ptr);
} }
@ -360,7 +360,7 @@ public override BulletBody CreateBodyWithDefaultMotionState(BulletShape shape, u
public override BulletBody CreateGhostFromShape(BulletWorld world, BulletShape shape, uint id, Vector3 pos, Quaternion rot) public override BulletBody CreateGhostFromShape(BulletWorld world, BulletShape shape, uint id, Vector3 pos, Quaternion rot)
{ {
BulletWorldUnman worldu = world as BulletWorldUnman; BulletWorldUnman worldu = world as BulletWorldUnman;
BulletShapeUnman shapeu = shape as BulletShapeUnman; BulletShapeUnman shapeu = shape as BulletShapeUnman;
return new BulletBodyUnman(id, BSAPICPP.CreateGhostFromShape2(worldu.ptr, shapeu.ptr, id, pos, rot)); return new BulletBodyUnman(id, BSAPICPP.CreateGhostFromShape2(worldu.ptr, shapeu.ptr, id, pos, rot));
} }
@ -393,7 +393,7 @@ public override BulletConstraint Create6DofConstraint(BulletWorld world, BulletB
Vector3 frame2loc, Quaternion frame2rot, Vector3 frame2loc, Quaternion frame2rot,
bool useLinearReferenceFrameA, bool disableCollisionsBetweenLinkedBodies) bool useLinearReferenceFrameA, bool disableCollisionsBetweenLinkedBodies)
{ {
BulletWorldUnman worldu = world as BulletWorldUnman; BulletWorldUnman worldu = world as BulletWorldUnman;
BulletBodyUnman bodyu1 = obj1 as BulletBodyUnman; BulletBodyUnman bodyu1 = obj1 as BulletBodyUnman;
BulletBodyUnman bodyu2 = obj2 as BulletBodyUnman; BulletBodyUnman bodyu2 = obj2 as BulletBodyUnman;
return new BulletConstraintUnman(BSAPICPP.Create6DofConstraint2(worldu.ptr, bodyu1.ptr, bodyu2.ptr, frame1loc, frame1rot, return new BulletConstraintUnman(BSAPICPP.Create6DofConstraint2(worldu.ptr, bodyu1.ptr, bodyu2.ptr, frame1loc, frame1rot,
@ -404,7 +404,7 @@ public override BulletConstraint Create6DofConstraintToPoint(BulletWorld world,
Vector3 joinPoint, Vector3 joinPoint,
bool useLinearReferenceFrameA, bool disableCollisionsBetweenLinkedBodies) bool useLinearReferenceFrameA, bool disableCollisionsBetweenLinkedBodies)
{ {
BulletWorldUnman worldu = world as BulletWorldUnman; BulletWorldUnman worldu = world as BulletWorldUnman;
BulletBodyUnman bodyu1 = obj1 as BulletBodyUnman; BulletBodyUnman bodyu1 = obj1 as BulletBodyUnman;
BulletBodyUnman bodyu2 = obj2 as BulletBodyUnman; BulletBodyUnman bodyu2 = obj2 as BulletBodyUnman;
return new BulletConstraintUnman(BSAPICPP.Create6DofConstraintToPoint2(worldu.ptr, bodyu1.ptr, bodyu2.ptr, return new BulletConstraintUnman(BSAPICPP.Create6DofConstraintToPoint2(worldu.ptr, bodyu1.ptr, bodyu2.ptr,
@ -416,7 +416,7 @@ public override BulletConstraint CreateHingeConstraint(BulletWorld world, Bullet
Vector3 axisInA, Vector3 axisInB, Vector3 axisInA, Vector3 axisInB,
bool useLinearReferenceFrameA, bool disableCollisionsBetweenLinkedBodies) bool useLinearReferenceFrameA, bool disableCollisionsBetweenLinkedBodies)
{ {
BulletWorldUnman worldu = world as BulletWorldUnman; BulletWorldUnman worldu = world as BulletWorldUnman;
BulletBodyUnman bodyu1 = obj1 as BulletBodyUnman; BulletBodyUnman bodyu1 = obj1 as BulletBodyUnman;
BulletBodyUnman bodyu2 = obj2 as BulletBodyUnman; BulletBodyUnman bodyu2 = obj2 as BulletBodyUnman;
return new BulletConstraintUnman(BSAPICPP.CreateHingeConstraint2(worldu.ptr, bodyu1.ptr, bodyu2.ptr, return new BulletConstraintUnman(BSAPICPP.CreateHingeConstraint2(worldu.ptr, bodyu1.ptr, bodyu2.ptr,
@ -494,7 +494,7 @@ public override bool DestroyConstraint(BulletWorld world, BulletConstraint const
// ===================================================================================== // =====================================================================================
// btCollisionWorld entries // btCollisionWorld entries
public override void UpdateSingleAabb(BulletWorld world, BulletBody obj) public override void UpdateSingleAabb(BulletWorld world, BulletBody obj)
{ {
BulletWorldUnman worldu = world as BulletWorldUnman; BulletWorldUnman worldu = world as BulletWorldUnman;
BulletBodyUnman bodyu = obj as BulletBodyUnman; BulletBodyUnman bodyu = obj as BulletBodyUnman;
BSAPICPP.UpdateSingleAabb2(worldu.ptr, bodyu.ptr); BSAPICPP.UpdateSingleAabb2(worldu.ptr, bodyu.ptr);
@ -502,19 +502,19 @@ public override void UpdateSingleAabb(BulletWorld world, BulletBody obj)
public override void UpdateAabbs(BulletWorld world) public override void UpdateAabbs(BulletWorld world)
{ {
BulletWorldUnman worldu = world as BulletWorldUnman; BulletWorldUnman worldu = world as BulletWorldUnman;
BSAPICPP.UpdateAabbs2(worldu.ptr); BSAPICPP.UpdateAabbs2(worldu.ptr);
} }
public override bool GetForceUpdateAllAabbs(BulletWorld world) public override bool GetForceUpdateAllAabbs(BulletWorld world)
{ {
BulletWorldUnman worldu = world as BulletWorldUnman; BulletWorldUnman worldu = world as BulletWorldUnman;
return BSAPICPP.GetForceUpdateAllAabbs2(worldu.ptr); return BSAPICPP.GetForceUpdateAllAabbs2(worldu.ptr);
} }
public override void SetForceUpdateAllAabbs(BulletWorld world, bool force) public override void SetForceUpdateAllAabbs(BulletWorld world, bool force)
{ {
BulletWorldUnman worldu = world as BulletWorldUnman; BulletWorldUnman worldu = world as BulletWorldUnman;
BSAPICPP.SetForceUpdateAllAabbs2(worldu.ptr, force); BSAPICPP.SetForceUpdateAllAabbs2(worldu.ptr, force);
} }
@ -522,28 +522,28 @@ public override void SetForceUpdateAllAabbs(BulletWorld world, bool force)
// btDynamicsWorld entries // btDynamicsWorld entries
public override bool AddObjectToWorld(BulletWorld world, BulletBody obj) public override bool AddObjectToWorld(BulletWorld world, BulletBody obj)
{ {
BulletWorldUnman worldu = world as BulletWorldUnman; BulletWorldUnman worldu = world as BulletWorldUnman;
BulletBodyUnman bodyu = obj as BulletBodyUnman; BulletBodyUnman bodyu = obj as BulletBodyUnman;
return BSAPICPP.AddObjectToWorld2(worldu.ptr, bodyu.ptr); return BSAPICPP.AddObjectToWorld2(worldu.ptr, bodyu.ptr);
} }
public override bool RemoveObjectFromWorld(BulletWorld world, BulletBody obj) public override bool RemoveObjectFromWorld(BulletWorld world, BulletBody obj)
{ {
BulletWorldUnman worldu = world as BulletWorldUnman; BulletWorldUnman worldu = world as BulletWorldUnman;
BulletBodyUnman bodyu = obj as BulletBodyUnman; BulletBodyUnman bodyu = obj as BulletBodyUnman;
return BSAPICPP.RemoveObjectFromWorld2(worldu.ptr, bodyu.ptr); return BSAPICPP.RemoveObjectFromWorld2(worldu.ptr, bodyu.ptr);
} }
public override bool AddConstraintToWorld(BulletWorld world, BulletConstraint constrain, bool disableCollisionsBetweenLinkedObjects) public override bool AddConstraintToWorld(BulletWorld world, BulletConstraint constrain, bool disableCollisionsBetweenLinkedObjects)
{ {
BulletWorldUnman worldu = world as BulletWorldUnman; BulletWorldUnman worldu = world as BulletWorldUnman;
BulletConstraintUnman constrainu = constrain as BulletConstraintUnman; BulletConstraintUnman constrainu = constrain as BulletConstraintUnman;
return BSAPICPP.AddConstraintToWorld2(worldu.ptr, constrainu.ptr, disableCollisionsBetweenLinkedObjects); return BSAPICPP.AddConstraintToWorld2(worldu.ptr, constrainu.ptr, disableCollisionsBetweenLinkedObjects);
} }
public override bool RemoveConstraintFromWorld(BulletWorld world, BulletConstraint constrain) public override bool RemoveConstraintFromWorld(BulletWorld world, BulletConstraint constrain)
{ {
BulletWorldUnman worldu = world as BulletWorldUnman; BulletWorldUnman worldu = world as BulletWorldUnman;
BulletConstraintUnman constrainu = constrain as BulletConstraintUnman; BulletConstraintUnman constrainu = constrain as BulletConstraintUnman;
return BSAPICPP.RemoveConstraintFromWorld2(worldu.ptr, constrainu.ptr); return BSAPICPP.RemoveConstraintFromWorld2(worldu.ptr, constrainu.ptr);
} }
@ -605,16 +605,16 @@ public override bool HasContactResponse(BulletBody obj)
public override void SetCollisionShape(BulletWorld world, BulletBody obj, BulletShape shape) public override void SetCollisionShape(BulletWorld world, BulletBody obj, BulletShape shape)
{ {
BulletWorldUnman worldu = world as BulletWorldUnman; BulletWorldUnman worldu = world as BulletWorldUnman;
BulletBodyUnman bodyu = obj as BulletBodyUnman; BulletBodyUnman bodyu = obj as BulletBodyUnman;
BulletShapeUnman shapeu = shape as BulletShapeUnman; BulletShapeUnman shapeu = shape as BulletShapeUnman;
if (worldu != null && bodyu != null) if (worldu != null && bodyu != null)
{ {
// Special case to allow the caller to zero out the reference to any physical shape // Special case to allow the caller to zero out the reference to any physical shape
if (shapeu != null) if (shapeu != null)
BSAPICPP.SetCollisionShape2(worldu.ptr, bodyu.ptr, shapeu.ptr); BSAPICPP.SetCollisionShape2(worldu.ptr, bodyu.ptr, shapeu.ptr);
else else
BSAPICPP.SetCollisionShape2(worldu.ptr, bodyu.ptr, IntPtr.Zero); BSAPICPP.SetCollisionShape2(worldu.ptr, bodyu.ptr, IntPtr.Zero);
} }
} }

View File

@ -894,26 +894,26 @@ public sealed class BSPrim : BSPhysObject
// Object MUST NOT already be in the world. // Object MUST NOT already be in the world.
// This routine exists because some assorted properties get mangled by adding to the world. // This routine exists because some assorted properties get mangled by adding to the world.
internal void AddObjectToPhysicalWorld() internal void AddObjectToPhysicalWorld()
{ {
if (PhysBody.HasPhysicalBody) if (PhysBody.HasPhysicalBody)
{ {
PhysicsScene.PE.AddObjectToWorld(PhysicsScene.World, PhysBody); PhysicsScene.PE.AddObjectToWorld(PhysicsScene.World, PhysBody);
// TODO: Fix this. Total kludge because adding object to world resets its gravity to default. // TODO: Fix this. Total kludge because adding object to world resets its gravity to default.
// Replace this when the new AddObjectToWorld function is complete. // Replace this when the new AddObjectToWorld function is complete.
PhysicsScene.PE.SetGravity(PhysBody, ComputeGravity()); PhysicsScene.PE.SetGravity(PhysBody, ComputeGravity());
// Collision filter can be set only when the object is in the world // Collision filter can be set only when the object is in the world
if (!PhysBody.ApplyCollisionMask(PhysicsScene)) if (!PhysBody.ApplyCollisionMask(PhysicsScene))
{ {
m_log.ErrorFormat("{0} Failed setting object collision mask: id={1}", LogHeader, LocalID); m_log.ErrorFormat("{0} Failed setting object collision mask: id={1}", LogHeader, LocalID);
DetailLog("{0},BSPrim.UpdatePhysicalParameters,failedSetMaskGroup,cType={1}", LocalID, PhysBody.collisionType); DetailLog("{0},BSPrim.UpdatePhysicalParameters,failedSetMaskGroup,cType={1}", LocalID, PhysBody.collisionType);
} }
} }
else else
{ {
m_log.ErrorFormat("{0} Attempt to add physical object without body. id={1}", LogHeader, LocalID); 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); DetailLog("{0},BSPrim.UpdatePhysicalParameters,addObjectWithoutBody,cType={1}", LocalID, PhysBody.collisionType);
} }
} }