diff --git a/Box2D.NET.Bindings/B2.g.cs b/Box2D.NET.Bindings/B2.g.cs index 97c14cc..e62a00a 100644 --- a/Box2D.NET.Bindings/B2.g.cs +++ b/Box2D.NET.Bindings/B2.g.cs @@ -130,9 +130,15 @@ public static unsafe partial class B2 [System.Runtime.InteropServices.DllImport(BindgenInternal.DllImportPath, EntryPoint = "b2Body_IsAwake", CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl)] public static extern byte BodyIsAwake(BodyId bodyId); + [System.Runtime.InteropServices.DllImport(BindgenInternal.DllImportPath, EntryPoint = "b2Body_IsBullet", CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl)] + public static extern byte BodyIsBullet(BodyId bodyId); + [System.Runtime.InteropServices.DllImport(BindgenInternal.DllImportPath, EntryPoint = "b2Body_IsEnabled", CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl)] public static extern byte BodyIsEnabled(BodyId bodyId); + [System.Runtime.InteropServices.DllImport(BindgenInternal.DllImportPath, EntryPoint = "b2Body_IsFixedRotation", CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl)] + public static extern byte BodyIsFixedRotation(BodyId bodyId); + [System.Runtime.InteropServices.DllImport(BindgenInternal.DllImportPath, EntryPoint = "b2Body_IsSleepEnabled", CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl)] public static extern byte BodyIsSleepEnabled(BodyId bodyId); @@ -148,6 +154,12 @@ public static unsafe partial class B2 [System.Runtime.InteropServices.DllImport(BindgenInternal.DllImportPath, EntryPoint = "b2Body_SetAngularVelocity", CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl)] public static extern void BodySetAngularVelocity(BodyId bodyId, float angularVelocity); + [System.Runtime.InteropServices.DllImport(BindgenInternal.DllImportPath, EntryPoint = "b2Body_SetBullet", CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl)] + public static extern void BodySetBullet(BodyId bodyId, byte flag); + + [System.Runtime.InteropServices.DllImport(BindgenInternal.DllImportPath, EntryPoint = "b2Body_SetFixedRotation", CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl)] + public static extern void BodySetFixedRotation(BodyId bodyId, byte flag); + [System.Runtime.InteropServices.DllImport(BindgenInternal.DllImportPath, EntryPoint = "b2Body_SetGravityScale", CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl)] public static extern void BodySetGravityScale(BodyId bodyId, float gravityScale); @@ -535,6 +547,9 @@ public static unsafe partial class B2 [System.Runtime.InteropServices.DllImport(BindgenInternal.DllImportPath, EntryPoint = "b2Joint_SetUserData", CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl)] public static extern void JointSetUserData(JointId jointId, void* userData); + [System.Runtime.InteropServices.DllImport(BindgenInternal.DllImportPath, EntryPoint = "b2Joint_WakeBodies", CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl)] + public static extern void JointWakeBodies(JointId jointId); + [System.Runtime.InteropServices.DllImport(BindgenInternal.DllImportPath, EntryPoint = "b2LeftPerp", CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl)] public static extern Vec2 LeftPerp(Vec2 v); @@ -691,6 +706,9 @@ public static unsafe partial class B2 [System.Runtime.InteropServices.DllImport(BindgenInternal.DllImportPath, EntryPoint = "b2PrismaticJoint_GetConstraintTorque", CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl)] public static extern float PrismaticJointGetConstraintTorque(JointId jointId); + [System.Runtime.InteropServices.DllImport(BindgenInternal.DllImportPath, EntryPoint = "b2PrismaticJoint_GetLowerLimit", CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl)] + public static extern float PrismaticJointGetLowerLimit(JointId jointId); + [System.Runtime.InteropServices.DllImport(BindgenInternal.DllImportPath, EntryPoint = "b2PrismaticJoint_GetMaxMotorForce", CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl)] public static extern float PrismaticJointGetMaxMotorForce(JointId jointId); @@ -700,12 +718,18 @@ public static unsafe partial class B2 [System.Runtime.InteropServices.DllImport(BindgenInternal.DllImportPath, EntryPoint = "b2PrismaticJoint_GetMotorSpeed", CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl)] public static extern float PrismaticJointGetMotorSpeed(JointId jointId); + [System.Runtime.InteropServices.DllImport(BindgenInternal.DllImportPath, EntryPoint = "b2PrismaticJoint_GetUpperLimit", CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl)] + public static extern float PrismaticJointGetUpperLimit(JointId jointId); + [System.Runtime.InteropServices.DllImport(BindgenInternal.DllImportPath, EntryPoint = "b2PrismaticJoint_IsLimitEnabled", CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl)] public static extern byte PrismaticJointIsLimitEnabled(JointId jointId); [System.Runtime.InteropServices.DllImport(BindgenInternal.DllImportPath, EntryPoint = "b2PrismaticJoint_IsMotorEnabled", CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl)] public static extern byte PrismaticJointIsMotorEnabled(JointId jointId); + [System.Runtime.InteropServices.DllImport(BindgenInternal.DllImportPath, EntryPoint = "b2PrismaticJoint_SetLimits", CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl)] + public static extern void PrismaticJointSetLimits(JointId jointId, float lower, float upper); + [System.Runtime.InteropServices.DllImport(BindgenInternal.DllImportPath, EntryPoint = "b2PrismaticJoint_SetMaxMotorForce", CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl)] public static extern void PrismaticJointSetMaxMotorForce(JointId jointId, float force); @@ -739,6 +763,9 @@ public static unsafe partial class B2 [System.Runtime.InteropServices.DllImport(BindgenInternal.DllImportPath, EntryPoint = "b2RevoluteJoint_GetConstraintTorque", CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl)] public static extern float RevoluteJointGetConstraintTorque(JointId jointId); + [System.Runtime.InteropServices.DllImport(BindgenInternal.DllImportPath, EntryPoint = "b2RevoluteJoint_GetLowerLimit", CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl)] + public static extern float RevoluteJointGetLowerLimit(JointId jointId); + [System.Runtime.InteropServices.DllImport(BindgenInternal.DllImportPath, EntryPoint = "b2RevoluteJoint_GetMaxMotorTorque", CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl)] public static extern float RevoluteJointGetMaxMotorTorque(JointId jointId); @@ -748,12 +775,18 @@ public static unsafe partial class B2 [System.Runtime.InteropServices.DllImport(BindgenInternal.DllImportPath, EntryPoint = "b2RevoluteJoint_GetMotorTorque", CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl)] public static extern float RevoluteJointGetMotorTorque(JointId jointId); + [System.Runtime.InteropServices.DllImport(BindgenInternal.DllImportPath, EntryPoint = "b2RevoluteJoint_GetUpperLimit", CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl)] + public static extern float RevoluteJointGetUpperLimit(JointId jointId); + [System.Runtime.InteropServices.DllImport(BindgenInternal.DllImportPath, EntryPoint = "b2RevoluteJoint_IsLimitEnabled", CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl)] public static extern byte RevoluteJointIsLimitEnabled(JointId jointId); [System.Runtime.InteropServices.DllImport(BindgenInternal.DllImportPath, EntryPoint = "b2RevoluteJoint_IsMotorEnabled", CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl)] public static extern byte RevoluteJointIsMotorEnabled(JointId jointId); + [System.Runtime.InteropServices.DllImport(BindgenInternal.DllImportPath, EntryPoint = "b2RevoluteJoint_SetLimits", CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl)] + public static extern void RevoluteJointSetLimits(JointId jointId, float lower, float upper); + [System.Runtime.InteropServices.DllImport(BindgenInternal.DllImportPath, EntryPoint = "b2RevoluteJoint_SetMaxMotorTorque", CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl)] public static extern void RevoluteJointSetMaxMotorTorque(JointId jointId, float torque); @@ -787,6 +820,24 @@ public static unsafe partial class B2 [System.Runtime.InteropServices.DllImport(BindgenInternal.DllImportPath, EntryPoint = "b2SetAssertFcn", CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl)] public static extern void SetAssertFcn(System.IntPtr* assertFcn); + [System.Runtime.InteropServices.DllImport(BindgenInternal.DllImportPath, EntryPoint = "b2Shape_AreContactEventsEnabled", CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl)] + public static extern byte ShapeAreContactEventsEnabled(ShapeId shapeId); + + [System.Runtime.InteropServices.DllImport(BindgenInternal.DllImportPath, EntryPoint = "b2Shape_ArePreSolveEventsEnabled", CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl)] + public static extern byte ShapeArePreSolveEventsEnabled(ShapeId shapeId); + + [System.Runtime.InteropServices.DllImport(BindgenInternal.DllImportPath, EntryPoint = "b2Shape_AreSensorEventsEnabled", CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl)] + public static extern byte ShapeAreSensorEventsEnabled(ShapeId shapeId); + + [System.Runtime.InteropServices.DllImport(BindgenInternal.DllImportPath, EntryPoint = "b2Shape_EnableContactEvents", CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl)] + public static extern void ShapeEnableContactEvents(ShapeId shapeId, byte flag); + + [System.Runtime.InteropServices.DllImport(BindgenInternal.DllImportPath, EntryPoint = "b2Shape_EnablePreSolveEvents", CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl)] + public static extern void ShapeEnablePreSolveEvents(ShapeId shapeId, byte flag); + + [System.Runtime.InteropServices.DllImport(BindgenInternal.DllImportPath, EntryPoint = "b2Shape_EnableSensorEvents", CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl)] + public static extern void ShapeEnableSensorEvents(ShapeId shapeId, byte flag); + [System.Runtime.InteropServices.DllImport(BindgenInternal.DllImportPath, EntryPoint = "b2Shape_GetAABB", CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl)] public static extern AABB ShapeGetAABB(ShapeId shapeId); @@ -845,10 +896,10 @@ public static unsafe partial class B2 public static extern CastOutput ShapeRayCast(ShapeId shapeId, Vec2 origin, Vec2 translation); [System.Runtime.InteropServices.DllImport(BindgenInternal.DllImportPath, EntryPoint = "b2Shape_SetCapsule", CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl)] - public static extern void ShapeSetCapsule(ShapeId shapeId, Capsule capsule); + public static extern void ShapeSetCapsule(ShapeId shapeId, Capsule* capsule); [System.Runtime.InteropServices.DllImport(BindgenInternal.DllImportPath, EntryPoint = "b2Shape_SetCircle", CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl)] - public static extern void ShapeSetCircle(ShapeId shapeId, Circle circle); + public static extern void ShapeSetCircle(ShapeId shapeId, Circle* circle); [System.Runtime.InteropServices.DllImport(BindgenInternal.DllImportPath, EntryPoint = "b2Shape_SetDensity", CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl)] public static extern void ShapeSetDensity(ShapeId shapeId, float density); @@ -860,13 +911,13 @@ public static unsafe partial class B2 public static extern void ShapeSetFriction(ShapeId shapeId, float friction); [System.Runtime.InteropServices.DllImport(BindgenInternal.DllImportPath, EntryPoint = "b2Shape_SetPolygon", CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl)] - public static extern void ShapeSetPolygon(ShapeId shapeId, Polygon polygon); + public static extern void ShapeSetPolygon(ShapeId shapeId, Polygon* polygon); [System.Runtime.InteropServices.DllImport(BindgenInternal.DllImportPath, EntryPoint = "b2Shape_SetRestitution", CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl)] public static extern void ShapeSetRestitution(ShapeId shapeId, float restitution); [System.Runtime.InteropServices.DllImport(BindgenInternal.DllImportPath, EntryPoint = "b2Shape_SetSegment", CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl)] - public static extern void ShapeSetSegment(ShapeId shapeId, Segment segment); + public static extern void ShapeSetSegment(ShapeId shapeId, Segment* segment); [System.Runtime.InteropServices.DllImport(BindgenInternal.DllImportPath, EntryPoint = "b2Shape_SetUserData", CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl)] public static extern void ShapeSetUserData(ShapeId shapeId, void* userData); @@ -952,6 +1003,9 @@ public static unsafe partial class B2 [System.Runtime.InteropServices.DllImport(BindgenInternal.DllImportPath, EntryPoint = "b2WheelJoint_GetConstraintTorque", CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl)] public static extern float WheelJointGetConstraintTorque(JointId jointId); + [System.Runtime.InteropServices.DllImport(BindgenInternal.DllImportPath, EntryPoint = "b2WheelJoint_GetLowerLimit", CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl)] + public static extern float WheelJointGetLowerLimit(JointId jointId); + [System.Runtime.InteropServices.DllImport(BindgenInternal.DllImportPath, EntryPoint = "b2WheelJoint_GetMaxMotorTorque", CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl)] public static extern float WheelJointGetMaxMotorTorque(JointId jointId); @@ -967,12 +1021,18 @@ public static unsafe partial class B2 [System.Runtime.InteropServices.DllImport(BindgenInternal.DllImportPath, EntryPoint = "b2WheelJoint_GetSpringHertz", CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl)] public static extern float WheelJointGetSpringHertz(JointId jointId); + [System.Runtime.InteropServices.DllImport(BindgenInternal.DllImportPath, EntryPoint = "b2WheelJoint_GetUpperLimit", CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl)] + public static extern float WheelJointGetUpperLimit(JointId jointId); + [System.Runtime.InteropServices.DllImport(BindgenInternal.DllImportPath, EntryPoint = "b2WheelJoint_IsLimitEnabled", CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl)] public static extern byte WheelJointIsLimitEnabled(JointId jointId); [System.Runtime.InteropServices.DllImport(BindgenInternal.DllImportPath, EntryPoint = "b2WheelJoint_IsMotorEnabled", CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl)] public static extern byte WheelJointIsMotorEnabled(JointId jointId); + [System.Runtime.InteropServices.DllImport(BindgenInternal.DllImportPath, EntryPoint = "b2WheelJoint_SetLimits", CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl)] + public static extern void WheelJointSetLimits(JointId jointId, float lower, float upper); + [System.Runtime.InteropServices.DllImport(BindgenInternal.DllImportPath, EntryPoint = "b2WheelJoint_SetMaxMotorTorque", CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl)] public static extern void WheelJointSetMaxMotorTorque(JointId jointId, float torque); @@ -1003,6 +1063,9 @@ public static unsafe partial class B2 [System.Runtime.InteropServices.DllImport(BindgenInternal.DllImportPath, EntryPoint = "b2World_EnableWarmStarting", CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl)] public static extern void WorldEnableWarmStarting(WorldId worldId, byte flag); + [System.Runtime.InteropServices.DllImport(BindgenInternal.DllImportPath, EntryPoint = "b2World_GetBodyEvents", CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl)] + public static extern BodyEvents WorldGetBodyEvents(WorldId worldId); + [System.Runtime.InteropServices.DllImport(BindgenInternal.DllImportPath, EntryPoint = "b2World_GetContactEvents", CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl)] public static extern ContactEvents WorldGetContactEvents(WorldId worldId); @@ -1018,21 +1081,21 @@ public static unsafe partial class B2 [System.Runtime.InteropServices.DllImport(BindgenInternal.DllImportPath, EntryPoint = "b2World_IsValid", CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl)] public static extern byte WorldIsValid(WorldId id); + [System.Runtime.InteropServices.DllImport(BindgenInternal.DllImportPath, EntryPoint = "b2World_OverlapAABB", CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl)] + public static extern void WorldOverlapAABB(WorldId worldId, AABB aabb, QueryFilter filter, System.IntPtr* fcn, void* context); + [System.Runtime.InteropServices.DllImport(BindgenInternal.DllImportPath, EntryPoint = "b2World_OverlapCapsule", CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl)] - public static extern void WorldOverlapCapsule(WorldId worldId, System.IntPtr* fcn, Capsule* capsule, Transform transform, QueryFilter filter, void* context); + public static extern void WorldOverlapCapsule(WorldId worldId, Capsule* capsule, Transform transform, QueryFilter filter, System.IntPtr* fcn, void* context); [System.Runtime.InteropServices.DllImport(BindgenInternal.DllImportPath, EntryPoint = "b2World_OverlapCircle", CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl)] - public static extern void WorldOverlapCircle(WorldId worldId, System.IntPtr* fcn, Circle* circle, Transform transform, QueryFilter filter, void* context); + public static extern void WorldOverlapCircle(WorldId worldId, Circle* circle, Transform transform, QueryFilter filter, System.IntPtr* fcn, void* context); [System.Runtime.InteropServices.DllImport(BindgenInternal.DllImportPath, EntryPoint = "b2World_OverlapPolygon", CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl)] - public static extern void WorldOverlapPolygon(WorldId worldId, System.IntPtr* fcn, Polygon* polygon, Transform transform, QueryFilter filter, void* context); + public static extern void WorldOverlapPolygon(WorldId worldId, Polygon* polygon, Transform transform, QueryFilter filter, System.IntPtr* fcn, void* context); [System.Runtime.InteropServices.DllImport(BindgenInternal.DllImportPath, EntryPoint = "b2World_PolygonCast", CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl)] public static extern void WorldPolygonCast(WorldId worldId, Polygon* polygon, Transform originTransform, Vec2 translation, QueryFilter filter, System.IntPtr* fcn, void* context); - [System.Runtime.InteropServices.DllImport(BindgenInternal.DllImportPath, EntryPoint = "b2World_QueryAABB", CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl)] - public static extern void WorldQueryAABB(WorldId worldId, System.IntPtr* fcn, AABB aabb, QueryFilter filter, void* context); - [System.Runtime.InteropServices.DllImport(BindgenInternal.DllImportPath, EntryPoint = "b2World_RayCast", CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl)] public static extern void WorldRayCast(WorldId worldId, Vec2 origin, Vec2 translation, QueryFilter filter, System.IntPtr* fcn, void* context); @@ -1084,9 +1147,18 @@ public partial struct BodyDef public byte fixedRotation; + public byte isBullet; + public byte isEnabled; } + public partial struct BodyEvents + { + public BodyMoveEvent* moveEvents; + + public int moveCount; + } + public partial struct BodyId { public int index; @@ -1096,6 +1168,17 @@ public partial struct BodyId public ushort revision; } + public partial struct BodyMoveEvent + { + public Transform transform; + + public BodyId bodyId; + + public void* userData; + + public byte fellAsleep; + } + public partial struct Capsule { public Vec2 point1; diff --git a/Box2D.NET.Bindings/Box2D.NET.Bindings.csproj b/Box2D.NET.Bindings/Box2D.NET.Bindings.csproj index be44eb0..a42d7f7 100644 --- a/Box2D.NET.Bindings/Box2D.NET.Bindings.csproj +++ b/Box2D.NET.Bindings/Box2D.NET.Bindings.csproj @@ -9,7 +9,7 @@ true true - 0.0.5 + 0.0.6 Box2D.NET.Bindings.Debug Box2D.NET.Bindings.Release BeanCheeseBurrito diff --git a/Box2D.NET.Native/Box2D.NET.Native.csproj b/Box2D.NET.Native/Box2D.NET.Native.csproj index da64029..f571115 100644 --- a/Box2D.NET.Native/Box2D.NET.Native.csproj +++ b/Box2D.NET.Native/Box2D.NET.Native.csproj @@ -10,7 +10,7 @@ true true - 0.0.5 + 0.0.6 Box2D.NET.Native.Debug Box2D.NET.Native.Release BeanCheeseBurrito diff --git a/Box2D.NET.Tests/WorldTests.cs b/Box2D.NET.Tests/WorldTests.cs index 8d70f9a..ce1b44a 100644 --- a/Box2D.NET.Tests/WorldTests.cs +++ b/Box2D.NET.Tests/WorldTests.cs @@ -65,7 +65,7 @@ public void HelloWorld() float angle = B2.BodyGetAngle(bodyId); // This is our little game loop. - for (int i = 0; i < 60; i++) + for (int i = 0; i < 90; i++) { // Instruct the world to perform a single step of simulation. // It is generally best to keep the time step and iterations fixed. diff --git a/Box2D.NET/Box2D.NET.csproj b/Box2D.NET/Box2D.NET.csproj index 4c0e438..16a54d0 100644 --- a/Box2D.NET/Box2D.NET.csproj +++ b/Box2D.NET/Box2D.NET.csproj @@ -9,7 +9,7 @@ true true - 0.0.5 + 0.0.6 Box2D.NET.Debug Box2D.NET.Release BeanCheeseBurrito