From 7be41481f378baf4346f8fdf8e85fa6491c5b67d Mon Sep 17 00:00:00 2001 From: scatterlogical Date: Mon, 5 May 2025 09:26:56 +1000 Subject: [PATCH 1/3] Updated box2d to 3.1 --- Box2D.NET.Bindings/B2.g.cs | 876 +++++++++++++++--------- Box2D.NET.Examples/CSharp/HelloWorld.cs | 2 +- Box2D.NET.Native/build.zig | 5 +- Box2D.NET.Tests/WorldTests.cs | 2 +- native/box2d | 2 +- 5 files changed, 541 insertions(+), 346 deletions(-) diff --git a/Box2D.NET.Bindings/B2.g.cs b/Box2D.NET.Bindings/B2.g.cs index 69ec726..3387d47 100644 --- a/Box2D.NET.Bindings/B2.g.cs +++ b/Box2D.NET.Bindings/B2.g.cs @@ -13,9 +13,6 @@ public static unsafe partial class B2 [System.Runtime.InteropServices.DllImport(BindgenInternal.DllImportPath, EntryPoint = "b2AABB_Extents", CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl)] public static extern Vec2 AABBExtents(AABB a); - [System.Runtime.InteropServices.DllImport(BindgenInternal.DllImportPath, EntryPoint = "b2AABB_IsValid", CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl)] - public static extern byte AABBIsValid(AABB aabb); - [System.Runtime.InteropServices.DllImport(BindgenInternal.DllImportPath, EntryPoint = "b2AABB_Union", CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl)] public static extern AABB AABBUnion(AABB a, AABB b); @@ -31,6 +28,9 @@ public static unsafe partial class B2 [System.Runtime.InteropServices.DllImport(BindgenInternal.DllImportPath, EntryPoint = "b2Add", CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl)] public static extern Vec2 Add(Vec2 a, Vec2 b); + [System.Runtime.InteropServices.DllImport(BindgenInternal.DllImportPath, EntryPoint = "b2Atan2", CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl)] + public static extern float Atan2(float y, float x); + [System.Runtime.InteropServices.DllImport(BindgenInternal.DllImportPath, EntryPoint = "b2Body_ApplyAngularImpulse", CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl)] public static extern void BodyApplyAngularImpulse(BodyId bodyId, float impulse, byte wake); @@ -61,8 +61,11 @@ public static unsafe partial class B2 [System.Runtime.InteropServices.DllImport(BindgenInternal.DllImportPath, EntryPoint = "b2Body_Enable", CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl)] public static extern void BodyEnable(BodyId bodyId); + [System.Runtime.InteropServices.DllImport(BindgenInternal.DllImportPath, EntryPoint = "b2Body_EnableContactEvents", CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl)] + public static extern void BodyEnableContactEvents(BodyId bodyId, byte flag); + [System.Runtime.InteropServices.DllImport(BindgenInternal.DllImportPath, EntryPoint = "b2Body_EnableHitEvents", CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl)] - public static extern void BodyEnableHitEvents(BodyId bodyId, byte enableHitEvents); + public static extern void BodyEnableHitEvents(BodyId bodyId, byte flag); [System.Runtime.InteropServices.DllImport(BindgenInternal.DllImportPath, EntryPoint = "b2Body_EnableSleep", CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl)] public static extern void BodyEnableSleep(BodyId bodyId, byte enableSleep); @@ -73,9 +76,6 @@ public static unsafe partial class B2 [System.Runtime.InteropServices.DllImport(BindgenInternal.DllImportPath, EntryPoint = "b2Body_GetAngularVelocity", CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl)] public static extern float BodyGetAngularVelocity(BodyId bodyId); - [System.Runtime.InteropServices.DllImport(BindgenInternal.DllImportPath, EntryPoint = "b2Body_GetAutomaticMass", CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl)] - public static extern byte BodyGetAutomaticMass(BodyId bodyId); - [System.Runtime.InteropServices.DllImport(BindgenInternal.DllImportPath, EntryPoint = "b2Body_GetContactCapacity", CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl)] public static extern int BodyGetContactCapacity(BodyId bodyId); @@ -85,9 +85,6 @@ public static unsafe partial class B2 [System.Runtime.InteropServices.DllImport(BindgenInternal.DllImportPath, EntryPoint = "b2Body_GetGravityScale", CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl)] public static extern float BodyGetGravityScale(BodyId bodyId); - [System.Runtime.InteropServices.DllImport(BindgenInternal.DllImportPath, EntryPoint = "b2Body_GetInertiaTensor", CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl)] - public static extern float BodyGetInertiaTensor(BodyId bodyId); - [System.Runtime.InteropServices.DllImport(BindgenInternal.DllImportPath, EntryPoint = "b2Body_GetJointCount", CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl)] public static extern int BodyGetJointCount(BodyId bodyId); @@ -106,6 +103,9 @@ public static unsafe partial class B2 [System.Runtime.InteropServices.DllImport(BindgenInternal.DllImportPath, EntryPoint = "b2Body_GetLocalPoint", CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl)] public static extern Vec2 BodyGetLocalPoint(BodyId bodyId, Vec2 worldPoint); + [System.Runtime.InteropServices.DllImport(BindgenInternal.DllImportPath, EntryPoint = "b2Body_GetLocalPointVelocity", CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl)] + public static extern Vec2 BodyGetLocalPointVelocity(BodyId bodyId, Vec2 localPoint); + [System.Runtime.InteropServices.DllImport(BindgenInternal.DllImportPath, EntryPoint = "b2Body_GetLocalVector", CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl)] public static extern Vec2 BodyGetLocalVector(BodyId bodyId, Vec2 worldVector); @@ -115,12 +115,18 @@ public static unsafe partial class B2 [System.Runtime.InteropServices.DllImport(BindgenInternal.DllImportPath, EntryPoint = "b2Body_GetMassData", CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl)] public static extern MassData BodyGetMassData(BodyId bodyId); + [System.Runtime.InteropServices.DllImport(BindgenInternal.DllImportPath, EntryPoint = "b2Body_GetName", CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl)] + public static extern byte* BodyGetName(BodyId bodyId); + [System.Runtime.InteropServices.DllImport(BindgenInternal.DllImportPath, EntryPoint = "b2Body_GetPosition", CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl)] public static extern Vec2 BodyGetPosition(BodyId bodyId); [System.Runtime.InteropServices.DllImport(BindgenInternal.DllImportPath, EntryPoint = "b2Body_GetRotation", CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl)] public static extern Rot BodyGetRotation(BodyId bodyId); + [System.Runtime.InteropServices.DllImport(BindgenInternal.DllImportPath, EntryPoint = "b2Body_GetRotationalInertia", CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl)] + public static extern float BodyGetRotationalInertia(BodyId bodyId); + [System.Runtime.InteropServices.DllImport(BindgenInternal.DllImportPath, EntryPoint = "b2Body_GetShapeCount", CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl)] public static extern int BodyGetShapeCount(BodyId bodyId); @@ -139,12 +145,18 @@ public static unsafe partial class B2 [System.Runtime.InteropServices.DllImport(BindgenInternal.DllImportPath, EntryPoint = "b2Body_GetUserData", CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl)] public static extern void* BodyGetUserData(BodyId bodyId); + [System.Runtime.InteropServices.DllImport(BindgenInternal.DllImportPath, EntryPoint = "b2Body_GetWorld", CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl)] + public static extern WorldId BodyGetWorld(BodyId bodyId); + [System.Runtime.InteropServices.DllImport(BindgenInternal.DllImportPath, EntryPoint = "b2Body_GetWorldCenterOfMass", CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl)] public static extern Vec2 BodyGetWorldCenterOfMass(BodyId bodyId); [System.Runtime.InteropServices.DllImport(BindgenInternal.DllImportPath, EntryPoint = "b2Body_GetWorldPoint", CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl)] public static extern Vec2 BodyGetWorldPoint(BodyId bodyId, Vec2 localPoint); + [System.Runtime.InteropServices.DllImport(BindgenInternal.DllImportPath, EntryPoint = "b2Body_GetWorldPointVelocity", CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl)] + public static extern Vec2 BodyGetWorldPointVelocity(BodyId bodyId, Vec2 worldPoint); + [System.Runtime.InteropServices.DllImport(BindgenInternal.DllImportPath, EntryPoint = "b2Body_GetWorldVector", CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl)] public static extern Vec2 BodyGetWorldVector(BodyId bodyId, Vec2 localVector); @@ -172,9 +184,6 @@ 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_SetAutomaticMass", CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl)] - public static extern void BodySetAutomaticMass(BodyId bodyId, byte automaticMass); - [System.Runtime.InteropServices.DllImport(BindgenInternal.DllImportPath, EntryPoint = "b2Body_SetAwake", CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl)] public static extern void BodySetAwake(BodyId bodyId, byte awake); @@ -196,8 +205,14 @@ public static unsafe partial class B2 [System.Runtime.InteropServices.DllImport(BindgenInternal.DllImportPath, EntryPoint = "b2Body_SetMassData", CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl)] public static extern void BodySetMassData(BodyId bodyId, MassData massData); + [System.Runtime.InteropServices.DllImport(BindgenInternal.DllImportPath, EntryPoint = "b2Body_SetName", CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl)] + public static extern void BodySetName(BodyId bodyId, byte* name); + [System.Runtime.InteropServices.DllImport(BindgenInternal.DllImportPath, EntryPoint = "b2Body_SetSleepThreshold", CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl)] - public static extern void BodySetSleepThreshold(BodyId bodyId, float sleepVelocity); + public static extern void BodySetSleepThreshold(BodyId bodyId, float sleepThreshold); + + [System.Runtime.InteropServices.DllImport(BindgenInternal.DllImportPath, EntryPoint = "b2Body_SetTargetTransform", CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl)] + public static extern void BodySetTargetTransform(BodyId bodyId, Transform target, float timeStep); [System.Runtime.InteropServices.DllImport(BindgenInternal.DllImportPath, EntryPoint = "b2Body_SetTransform", CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl)] public static extern void BodySetTransform(BodyId bodyId, Vec2 position, Rot rotation); @@ -208,12 +223,33 @@ public static unsafe partial class B2 [System.Runtime.InteropServices.DllImport(BindgenInternal.DllImportPath, EntryPoint = "b2Body_SetUserData", CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl)] public static extern void BodySetUserData(BodyId bodyId, void* userData); + [System.Runtime.InteropServices.DllImport(BindgenInternal.DllImportPath, EntryPoint = "b2Chain_GetFriction", CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl)] + public static extern float ChainGetFriction(ChainId chainId); + + [System.Runtime.InteropServices.DllImport(BindgenInternal.DllImportPath, EntryPoint = "b2Chain_GetMaterial", CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl)] + public static extern int ChainGetMaterial(ChainId chainId); + + [System.Runtime.InteropServices.DllImport(BindgenInternal.DllImportPath, EntryPoint = "b2Chain_GetRestitution", CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl)] + public static extern float ChainGetRestitution(ChainId chainId); + + [System.Runtime.InteropServices.DllImport(BindgenInternal.DllImportPath, EntryPoint = "b2Chain_GetSegmentCount", CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl)] + public static extern int ChainGetSegmentCount(ChainId chainId); + + [System.Runtime.InteropServices.DllImport(BindgenInternal.DllImportPath, EntryPoint = "b2Chain_GetSegments", CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl)] + public static extern int ChainGetSegments(ChainId chainId, ShapeId* segmentArray, int capacity); + + [System.Runtime.InteropServices.DllImport(BindgenInternal.DllImportPath, EntryPoint = "b2Chain_GetWorld", CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl)] + public static extern WorldId ChainGetWorld(ChainId chainId); + [System.Runtime.InteropServices.DllImport(BindgenInternal.DllImportPath, EntryPoint = "b2Chain_IsValid", CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl)] public static extern byte ChainIsValid(ChainId id); [System.Runtime.InteropServices.DllImport(BindgenInternal.DllImportPath, EntryPoint = "b2Chain_SetFriction", CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl)] public static extern void ChainSetFriction(ChainId chainId, float friction); + [System.Runtime.InteropServices.DllImport(BindgenInternal.DllImportPath, EntryPoint = "b2Chain_SetMaterial", CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl)] + public static extern void ChainSetMaterial(ChainId chainId, int material); + [System.Runtime.InteropServices.DllImport(BindgenInternal.DllImportPath, EntryPoint = "b2Chain_SetRestitution", CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl)] public static extern void ChainSetRestitution(ChainId chainId, float restitution); @@ -226,12 +262,24 @@ public static unsafe partial class B2 [System.Runtime.InteropServices.DllImport(BindgenInternal.DllImportPath, EntryPoint = "b2ClampInt", CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl)] public static extern int ClampInt(int a, int lower, int upper); + [System.Runtime.InteropServices.DllImport(BindgenInternal.DllImportPath, EntryPoint = "b2ClipVector", CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl)] + public static extern Vec2 ClipVector(Vec2 vector, CollisionPlane* planes, int count); + [System.Runtime.InteropServices.DllImport(BindgenInternal.DllImportPath, EntryPoint = "b2CollideCapsuleAndCircle", CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl)] public static extern Manifold CollideCapsuleAndCircle(Capsule* capsuleA, Transform xfA, Circle* circleB, Transform xfB); [System.Runtime.InteropServices.DllImport(BindgenInternal.DllImportPath, EntryPoint = "b2CollideCapsules", CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl)] public static extern Manifold CollideCapsules(Capsule* capsuleA, Transform xfA, Capsule* capsuleB, Transform xfB); + [System.Runtime.InteropServices.DllImport(BindgenInternal.DllImportPath, EntryPoint = "b2CollideChainSegmentAndCapsule", CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl)] + public static extern Manifold CollideChainSegmentAndCapsule(ChainSegment* segmentA, Transform xfA, Capsule* capsuleB, Transform xfB, SimplexCache* cache); + + [System.Runtime.InteropServices.DllImport(BindgenInternal.DllImportPath, EntryPoint = "b2CollideChainSegmentAndCircle", CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl)] + public static extern Manifold CollideChainSegmentAndCircle(ChainSegment* segmentA, Transform xfA, Circle* circleB, Transform xfB); + + [System.Runtime.InteropServices.DllImport(BindgenInternal.DllImportPath, EntryPoint = "b2CollideChainSegmentAndPolygon", CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl)] + public static extern Manifold CollideChainSegmentAndPolygon(ChainSegment* segmentA, Transform xfA, Polygon* polygonB, Transform xfB, SimplexCache* cache); + [System.Runtime.InteropServices.DllImport(BindgenInternal.DllImportPath, EntryPoint = "b2CollideCircles", CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl)] public static extern Manifold CollideCircles(Circle* circleA, Transform xfA, Circle* circleB, Transform xfB); @@ -253,15 +301,6 @@ public static unsafe partial class B2 [System.Runtime.InteropServices.DllImport(BindgenInternal.DllImportPath, EntryPoint = "b2CollideSegmentAndPolygon", CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl)] public static extern Manifold CollideSegmentAndPolygon(Segment* segmentA, Transform xfA, Polygon* polygonB, Transform xfB); - [System.Runtime.InteropServices.DllImport(BindgenInternal.DllImportPath, EntryPoint = "b2CollideSmoothSegmentAndCapsule", CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl)] - public static extern Manifold CollideSmoothSegmentAndCapsule(SmoothSegment* smoothSegmentA, Transform xfA, Capsule* capsuleB, Transform xfB, DistanceCache* cache); - - [System.Runtime.InteropServices.DllImport(BindgenInternal.DllImportPath, EntryPoint = "b2CollideSmoothSegmentAndCircle", CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl)] - public static extern Manifold CollideSmoothSegmentAndCircle(SmoothSegment* smoothSegmentA, Transform xfA, Circle* circleB, Transform xfB); - - [System.Runtime.InteropServices.DllImport(BindgenInternal.DllImportPath, EntryPoint = "b2CollideSmoothSegmentAndPolygon", CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl)] - public static extern Manifold CollideSmoothSegmentAndPolygon(SmoothSegment* smoothSegmentA, Transform xfA, Polygon* polygonB, Transform xfB, DistanceCache* cache); - [System.Runtime.InteropServices.DllImport(BindgenInternal.DllImportPath, EntryPoint = "b2ComputeAngularVelocity", CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl)] public static extern float ComputeAngularVelocity(Rot q1, Rot q2, float inv_h); @@ -277,6 +316,9 @@ public static unsafe partial class B2 [System.Runtime.InteropServices.DllImport(BindgenInternal.DllImportPath, EntryPoint = "b2ComputeCircleMass", CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl)] public static extern MassData ComputeCircleMass(Circle* shape, float density); + [System.Runtime.InteropServices.DllImport(BindgenInternal.DllImportPath, EntryPoint = "b2ComputeCosSin", CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl)] + public static extern CosSin ComputeCosSin(float radians); + [System.Runtime.InteropServices.DllImport(BindgenInternal.DllImportPath, EntryPoint = "b2ComputeHull", CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl)] public static extern Hull ComputeHull(Vec2* points, int count); @@ -286,6 +328,9 @@ public static unsafe partial class B2 [System.Runtime.InteropServices.DllImport(BindgenInternal.DllImportPath, EntryPoint = "b2ComputePolygonMass", CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl)] public static extern MassData ComputePolygonMass(Polygon* shape, float density); + [System.Runtime.InteropServices.DllImport(BindgenInternal.DllImportPath, EntryPoint = "b2ComputeRotationBetweenUnitVectors", CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl)] + public static extern Rot ComputeRotationBetweenUnitVectors(Vec2 v1, Vec2 v2); + [System.Runtime.InteropServices.DllImport(BindgenInternal.DllImportPath, EntryPoint = "b2ComputeSegmentAABB", CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl)] public static extern AABB ComputeSegmentAABB(Segment* shape, Transform transform); @@ -304,6 +349,9 @@ public static unsafe partial class B2 [System.Runtime.InteropServices.DllImport(BindgenInternal.DllImportPath, EntryPoint = "b2CreateDistanceJoint", CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl)] public static extern JointId CreateDistanceJoint(WorldId worldId, DistanceJointDef* def); + [System.Runtime.InteropServices.DllImport(BindgenInternal.DllImportPath, EntryPoint = "b2CreateFilterJoint", CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl)] + public static extern JointId CreateFilterJoint(WorldId worldId, FilterJointDef* def); + [System.Runtime.InteropServices.DllImport(BindgenInternal.DllImportPath, EntryPoint = "b2CreateMotorJoint", CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl)] public static extern JointId CreateMotorJoint(WorldId worldId, MotorJointDef* def); @@ -322,9 +370,6 @@ public static unsafe partial class B2 [System.Runtime.InteropServices.DllImport(BindgenInternal.DllImportPath, EntryPoint = "b2CreateSegmentShape", CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl)] public static extern ShapeId CreateSegmentShape(BodyId bodyId, ShapeDef* def, Segment* segment); - [System.Runtime.InteropServices.DllImport(BindgenInternal.DllImportPath, EntryPoint = "b2CreateTimer", CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl)] - public static extern Timer CreateTimer(); - [System.Runtime.InteropServices.DllImport(BindgenInternal.DllImportPath, EntryPoint = "b2CreateWeldJoint", CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl)] public static extern JointId CreateWeldJoint(WorldId worldId, WeldJointDef* def); @@ -349,12 +394,21 @@ public static unsafe partial class B2 [System.Runtime.InteropServices.DllImport(BindgenInternal.DllImportPath, EntryPoint = "b2DefaultChainDef", CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl)] public static extern ChainDef DefaultChainDef(); + [System.Runtime.InteropServices.DllImport(BindgenInternal.DllImportPath, EntryPoint = "b2DefaultDebugDraw", CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl)] + public static extern DebugDraw DefaultDebugDraw(); + [System.Runtime.InteropServices.DllImport(BindgenInternal.DllImportPath, EntryPoint = "b2DefaultDistanceJointDef", CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl)] public static extern DistanceJointDef DefaultDistanceJointDef(); + [System.Runtime.InteropServices.DllImport(BindgenInternal.DllImportPath, EntryPoint = "b2DefaultExplosionDef", CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl)] + public static extern ExplosionDef DefaultExplosionDef(); + [System.Runtime.InteropServices.DllImport(BindgenInternal.DllImportPath, EntryPoint = "b2DefaultFilter", CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl)] public static extern Filter DefaultFilter(); + [System.Runtime.InteropServices.DllImport(BindgenInternal.DllImportPath, EntryPoint = "b2DefaultFilterJointDef", CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl)] + public static extern FilterJointDef DefaultFilterJointDef(); + [System.Runtime.InteropServices.DllImport(BindgenInternal.DllImportPath, EntryPoint = "b2DefaultMotorJointDef", CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl)] public static extern MotorJointDef DefaultMotorJointDef(); @@ -373,6 +427,9 @@ public static unsafe partial class B2 [System.Runtime.InteropServices.DllImport(BindgenInternal.DllImportPath, EntryPoint = "b2DefaultShapeDef", CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl)] public static extern ShapeDef DefaultShapeDef(); + [System.Runtime.InteropServices.DllImport(BindgenInternal.DllImportPath, EntryPoint = "b2DefaultSurfaceMaterial", CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl)] + public static extern SurfaceMaterial DefaultSurfaceMaterial(); + [System.Runtime.InteropServices.DllImport(BindgenInternal.DllImportPath, EntryPoint = "b2DefaultWeldJointDef", CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl)] public static extern WeldJointDef DefaultWeldJointDef(); @@ -392,7 +449,7 @@ public static unsafe partial class B2 public static extern void DestroyJoint(JointId jointId); [System.Runtime.InteropServices.DllImport(BindgenInternal.DllImportPath, EntryPoint = "b2DestroyShape", CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl)] - public static extern void DestroyShape(ShapeId shapeId); + public static extern void DestroyShape(ShapeId shapeId, byte updateBodyMass); [System.Runtime.InteropServices.DllImport(BindgenInternal.DllImportPath, EntryPoint = "b2DestroyWorld", CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl)] public static extern void DestroyWorld(WorldId worldId); @@ -412,12 +469,6 @@ public static unsafe partial class B2 [System.Runtime.InteropServices.DllImport(BindgenInternal.DllImportPath, EntryPoint = "b2DistanceJoint_GetCurrentLength", CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl)] public static extern float DistanceJointGetCurrentLength(JointId jointId); - [System.Runtime.InteropServices.DllImport(BindgenInternal.DllImportPath, EntryPoint = "b2DistanceJoint_GetDampingRatio", CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl)] - public static extern float DistanceJointGetDampingRatio(JointId jointId); - - [System.Runtime.InteropServices.DllImport(BindgenInternal.DllImportPath, EntryPoint = "b2DistanceJoint_GetHertz", CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl)] - public static extern float DistanceJointGetHertz(JointId jointId); - [System.Runtime.InteropServices.DllImport(BindgenInternal.DllImportPath, EntryPoint = "b2DistanceJoint_GetLength", CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl)] public static extern float DistanceJointGetLength(JointId jointId); @@ -436,6 +487,12 @@ public static unsafe partial class B2 [System.Runtime.InteropServices.DllImport(BindgenInternal.DllImportPath, EntryPoint = "b2DistanceJoint_GetMotorSpeed", CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl)] public static extern float DistanceJointGetMotorSpeed(JointId jointId); + [System.Runtime.InteropServices.DllImport(BindgenInternal.DllImportPath, EntryPoint = "b2DistanceJoint_GetSpringDampingRatio", CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl)] + public static extern float DistanceJointGetSpringDampingRatio(JointId jointId); + + [System.Runtime.InteropServices.DllImport(BindgenInternal.DllImportPath, EntryPoint = "b2DistanceJoint_GetSpringHertz", CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl)] + public static extern float DistanceJointGetSpringHertz(JointId jointId); + [System.Runtime.InteropServices.DllImport(BindgenInternal.DllImportPath, EntryPoint = "b2DistanceJoint_IsLimitEnabled", CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl)] public static extern byte DistanceJointIsLimitEnabled(JointId jointId); @@ -473,7 +530,7 @@ public static unsafe partial class B2 public static extern DynamicTree DynamicTreeCreate(); [System.Runtime.InteropServices.DllImport(BindgenInternal.DllImportPath, EntryPoint = "b2DynamicTree_CreateProxy", CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl)] - public static extern int DynamicTreeCreateProxy(DynamicTree* tree, AABB aabb, uint categoryBits, int userData); + public static extern int DynamicTreeCreateProxy(DynamicTree* tree, AABB aabb, ulong categoryBits, ulong userData); [System.Runtime.InteropServices.DllImport(BindgenInternal.DllImportPath, EntryPoint = "b2DynamicTree_Destroy", CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl)] public static extern void DynamicTreeDestroy(DynamicTree* tree); @@ -493,42 +550,45 @@ public static unsafe partial class B2 [System.Runtime.InteropServices.DllImport(BindgenInternal.DllImportPath, EntryPoint = "b2DynamicTree_GetByteCount", CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl)] public static extern int DynamicTreeGetByteCount(DynamicTree* tree); + [System.Runtime.InteropServices.DllImport(BindgenInternal.DllImportPath, EntryPoint = "b2DynamicTree_GetCategoryBits", CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl)] + public static extern ulong DynamicTreeGetCategoryBits(DynamicTree* tree, int proxyId); + [System.Runtime.InteropServices.DllImport(BindgenInternal.DllImportPath, EntryPoint = "b2DynamicTree_GetHeight", CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl)] public static extern int DynamicTreeGetHeight(DynamicTree* tree); - [System.Runtime.InteropServices.DllImport(BindgenInternal.DllImportPath, EntryPoint = "b2DynamicTree_GetMaxBalance", CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl)] - public static extern int DynamicTreeGetMaxBalance(DynamicTree* tree); - [System.Runtime.InteropServices.DllImport(BindgenInternal.DllImportPath, EntryPoint = "b2DynamicTree_GetProxyCount", CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl)] public static extern int DynamicTreeGetProxyCount(DynamicTree* tree); + [System.Runtime.InteropServices.DllImport(BindgenInternal.DllImportPath, EntryPoint = "b2DynamicTree_GetRootBounds", CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl)] + public static extern AABB DynamicTreeGetRootBounds(DynamicTree* tree); + [System.Runtime.InteropServices.DllImport(BindgenInternal.DllImportPath, EntryPoint = "b2DynamicTree_GetUserData", CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl)] - public static extern int DynamicTreeGetUserData(DynamicTree* tree, int proxyId); + public static extern ulong DynamicTreeGetUserData(DynamicTree* tree, int proxyId); [System.Runtime.InteropServices.DllImport(BindgenInternal.DllImportPath, EntryPoint = "b2DynamicTree_MoveProxy", CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl)] public static extern void DynamicTreeMoveProxy(DynamicTree* tree, int proxyId, AABB aabb); [System.Runtime.InteropServices.DllImport(BindgenInternal.DllImportPath, EntryPoint = "b2DynamicTree_Query", CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl)] - public static extern void DynamicTreeQuery(DynamicTree* tree, AABB aabb, uint maskBits, System.IntPtr callback, void* context); + public static extern TreeStats DynamicTreeQuery(DynamicTree* tree, AABB aabb, ulong maskBits, System.IntPtr callback, void* context); [System.Runtime.InteropServices.DllImport(BindgenInternal.DllImportPath, EntryPoint = "b2DynamicTree_RayCast", CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl)] - public static extern void DynamicTreeRayCast(DynamicTree* tree, RayCastInput* input, uint maskBits, System.IntPtr callback, void* context); + public static extern TreeStats DynamicTreeRayCast(DynamicTree* tree, RayCastInput* input, ulong maskBits, System.IntPtr callback, void* context); [System.Runtime.InteropServices.DllImport(BindgenInternal.DllImportPath, EntryPoint = "b2DynamicTree_Rebuild", CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl)] public static extern int DynamicTreeRebuild(DynamicTree* tree, byte fullBuild); - [System.Runtime.InteropServices.DllImport(BindgenInternal.DllImportPath, EntryPoint = "b2DynamicTree_RebuildBottomUp", CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl)] - public static extern void DynamicTreeRebuildBottomUp(DynamicTree* tree); + [System.Runtime.InteropServices.DllImport(BindgenInternal.DllImportPath, EntryPoint = "b2DynamicTree_SetCategoryBits", CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl)] + public static extern void DynamicTreeSetCategoryBits(DynamicTree* tree, int proxyId, ulong categoryBits); [System.Runtime.InteropServices.DllImport(BindgenInternal.DllImportPath, EntryPoint = "b2DynamicTree_ShapeCast", CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl)] - public static extern void DynamicTreeShapeCast(DynamicTree* tree, ShapeCastInput* input, uint maskBits, System.IntPtr callback, void* context); - - [System.Runtime.InteropServices.DllImport(BindgenInternal.DllImportPath, EntryPoint = "b2DynamicTree_ShiftOrigin", CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl)] - public static extern void DynamicTreeShiftOrigin(DynamicTree* tree, Vec2 newOrigin); + public static extern TreeStats DynamicTreeShapeCast(DynamicTree* tree, ShapeCastInput* input, ulong maskBits, System.IntPtr callback, void* context); [System.Runtime.InteropServices.DllImport(BindgenInternal.DllImportPath, EntryPoint = "b2DynamicTree_Validate", CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl)] public static extern void DynamicTreeValidate(DynamicTree* tree); + [System.Runtime.InteropServices.DllImport(BindgenInternal.DllImportPath, EntryPoint = "b2DynamicTree_ValidateNoEnlarged", CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl)] + public static extern void DynamicTreeValidateNoEnlarged(DynamicTree* tree); + [System.Runtime.InteropServices.DllImport(BindgenInternal.DllImportPath, EntryPoint = "b2GetByteCount", CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl)] public static extern int GetByteCount(); @@ -542,23 +602,29 @@ public static unsafe partial class B2 public static extern float GetLengthUnitsPerMeter(); [System.Runtime.InteropServices.DllImport(BindgenInternal.DllImportPath, EntryPoint = "b2GetMilliseconds", CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl)] - public static extern float GetMilliseconds(Timer* timer); + public static extern float GetMilliseconds(ulong ticks); [System.Runtime.InteropServices.DllImport(BindgenInternal.DllImportPath, EntryPoint = "b2GetMillisecondsAndReset", CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl)] - public static extern float GetMillisecondsAndReset(Timer* timer); + public static extern float GetMillisecondsAndReset(ulong* ticks); [System.Runtime.InteropServices.DllImport(BindgenInternal.DllImportPath, EntryPoint = "b2GetSweepTransform", CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl)] public static extern Transform GetSweepTransform(Sweep* sweep, float time); [System.Runtime.InteropServices.DllImport(BindgenInternal.DllImportPath, EntryPoint = "b2GetTicks", CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl)] - public static extern long GetTicks(Timer* timer); + public static extern ulong GetTicks(); [System.Runtime.InteropServices.DllImport(BindgenInternal.DllImportPath, EntryPoint = "b2GetVersion", CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl)] public static extern Version GetVersion(); + [System.Runtime.InteropServices.DllImport(BindgenInternal.DllImportPath, EntryPoint = "b2Hash", CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl)] + public static extern uint Hash(uint hash, byte* data, int count); + [System.Runtime.InteropServices.DllImport(BindgenInternal.DllImportPath, EntryPoint = "b2IntegrateRotation", CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl)] public static extern Rot IntegrateRotation(Rot q1, float deltaAngle); + [System.Runtime.InteropServices.DllImport(BindgenInternal.DllImportPath, EntryPoint = "b2InternalAssertFcn", CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl)] + public static extern int InternalAssertFcn(byte* condition, byte* fileName, int lineNumber); + [System.Runtime.InteropServices.DllImport(BindgenInternal.DllImportPath, EntryPoint = "b2InvMulRot", CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl)] public static extern Rot InvMulRot(Rot q, Rot r); @@ -572,14 +638,29 @@ public static unsafe partial class B2 public static extern Vec2 InvTransformPoint(Transform t, Vec2 p); [System.Runtime.InteropServices.DllImport(BindgenInternal.DllImportPath, EntryPoint = "b2IsNormalized", CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl)] - public static extern byte IsNormalized(Rot q); + public static extern byte IsNormalized(Vec2 a); + + [System.Runtime.InteropServices.DllImport(BindgenInternal.DllImportPath, EntryPoint = "b2IsNormalizedRot", CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl)] + public static extern byte IsNormalizedRot(Rot q); - [System.Runtime.InteropServices.DllImport(BindgenInternal.DllImportPath, EntryPoint = "b2IsValid", CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl)] - public static extern byte IsValid(float a); + [System.Runtime.InteropServices.DllImport(BindgenInternal.DllImportPath, EntryPoint = "b2IsValidAABB", CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl)] + public static extern byte IsValidAABB(AABB aabb); + + [System.Runtime.InteropServices.DllImport(BindgenInternal.DllImportPath, EntryPoint = "b2IsValidFloat", CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl)] + public static extern byte IsValidFloat(float a); + + [System.Runtime.InteropServices.DllImport(BindgenInternal.DllImportPath, EntryPoint = "b2IsValidPlane", CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl)] + public static extern byte IsValidPlane(Plane a); [System.Runtime.InteropServices.DllImport(BindgenInternal.DllImportPath, EntryPoint = "b2IsValidRay", CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl)] public static extern byte IsValidRay(RayCastInput* input); + [System.Runtime.InteropServices.DllImport(BindgenInternal.DllImportPath, EntryPoint = "b2IsValidRotation", CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl)] + public static extern byte IsValidRotation(Rot q); + + [System.Runtime.InteropServices.DllImport(BindgenInternal.DllImportPath, EntryPoint = "b2IsValidVec2", CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl)] + public static extern byte IsValidVec2(Vec2 v); + [System.Runtime.InteropServices.DllImport(BindgenInternal.DllImportPath, EntryPoint = "b2Joint_GetBodyA", CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl)] public static extern BodyId JointGetBodyA(JointId jointId); @@ -607,6 +688,9 @@ public static unsafe partial class B2 [System.Runtime.InteropServices.DllImport(BindgenInternal.DllImportPath, EntryPoint = "b2Joint_GetUserData", CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl)] public static extern void* JointGetUserData(JointId jointId); + [System.Runtime.InteropServices.DllImport(BindgenInternal.DllImportPath, EntryPoint = "b2Joint_GetWorld", CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl)] + public static extern WorldId JointGetWorld(JointId jointId); + [System.Runtime.InteropServices.DllImport(BindgenInternal.DllImportPath, EntryPoint = "b2Joint_IsValid", CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl)] public static extern byte JointIsValid(JointId id); @@ -631,29 +715,53 @@ public static unsafe partial class B2 [System.Runtime.InteropServices.DllImport(BindgenInternal.DllImportPath, EntryPoint = "b2Lerp", CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl)] public static extern Vec2 Lerp(Vec2 a, Vec2 b, float t); + [System.Runtime.InteropServices.DllImport(BindgenInternal.DllImportPath, EntryPoint = "b2LoadBodyId", CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl)] + public static extern BodyId LoadBodyId(ulong x); + + [System.Runtime.InteropServices.DllImport(BindgenInternal.DllImportPath, EntryPoint = "b2LoadChainId", CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl)] + public static extern ChainId LoadChainId(ulong x); + + [System.Runtime.InteropServices.DllImport(BindgenInternal.DllImportPath, EntryPoint = "b2LoadJointId", CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl)] + public static extern JointId LoadJointId(ulong x); + + [System.Runtime.InteropServices.DllImport(BindgenInternal.DllImportPath, EntryPoint = "b2LoadShapeId", CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl)] + public static extern ShapeId LoadShapeId(ulong x); + + [System.Runtime.InteropServices.DllImport(BindgenInternal.DllImportPath, EntryPoint = "b2MakeAABB", CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl)] + public static extern AABB MakeAABB(Vec2* points, int count, float radius); + [System.Runtime.InteropServices.DllImport(BindgenInternal.DllImportPath, EntryPoint = "b2MakeBox", CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl)] - public static extern Polygon MakeBox(float hx, float hy); + public static extern Polygon MakeBox(float halfWidth, float halfHeight); [System.Runtime.InteropServices.DllImport(BindgenInternal.DllImportPath, EntryPoint = "b2MakeOffsetBox", CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl)] - public static extern Polygon MakeOffsetBox(float hx, float hy, Vec2 center, float angle); + public static extern Polygon MakeOffsetBox(float halfWidth, float halfHeight, Vec2 center, Rot rotation); [System.Runtime.InteropServices.DllImport(BindgenInternal.DllImportPath, EntryPoint = "b2MakeOffsetPolygon", CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl)] - public static extern Polygon MakeOffsetPolygon(Hull* hull, float radius, Transform transform); + public static extern Polygon MakeOffsetPolygon(Hull* hull, Vec2 position, Rot rotation); + + [System.Runtime.InteropServices.DllImport(BindgenInternal.DllImportPath, EntryPoint = "b2MakeOffsetProxy", CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl)] + public static extern ShapeProxy MakeOffsetProxy(Vec2* points, int count, float radius, Vec2 position, Rot rotation); + + [System.Runtime.InteropServices.DllImport(BindgenInternal.DllImportPath, EntryPoint = "b2MakeOffsetRoundedBox", CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl)] + public static extern Polygon MakeOffsetRoundedBox(float halfWidth, float halfHeight, Vec2 center, Rot rotation, float radius); + + [System.Runtime.InteropServices.DllImport(BindgenInternal.DllImportPath, EntryPoint = "b2MakeOffsetRoundedPolygon", CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl)] + public static extern Polygon MakeOffsetRoundedPolygon(Hull* hull, Vec2 position, Rot rotation, float radius); [System.Runtime.InteropServices.DllImport(BindgenInternal.DllImportPath, EntryPoint = "b2MakePolygon", CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl)] public static extern Polygon MakePolygon(Hull* hull, float radius); [System.Runtime.InteropServices.DllImport(BindgenInternal.DllImportPath, EntryPoint = "b2MakeProxy", CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl)] - public static extern DistanceProxy MakeProxy(Vec2* vertices, int count, float radius); + public static extern ShapeProxy MakeProxy(Vec2* points, int count, float radius); [System.Runtime.InteropServices.DllImport(BindgenInternal.DllImportPath, EntryPoint = "b2MakeRot", CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl)] - public static extern Rot MakeRot(float angle); + public static extern Rot MakeRot(float radians); [System.Runtime.InteropServices.DllImport(BindgenInternal.DllImportPath, EntryPoint = "b2MakeRoundedBox", CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl)] - public static extern Polygon MakeRoundedBox(float hx, float hy, float radius); + public static extern Polygon MakeRoundedBox(float halfWidth, float halfHeight, float radius); [System.Runtime.InteropServices.DllImport(BindgenInternal.DllImportPath, EntryPoint = "b2MakeSquare", CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl)] - public static extern Polygon MakeSquare(float h); + public static extern Polygon MakeSquare(float halfWidth); [System.Runtime.InteropServices.DllImport(BindgenInternal.DllImportPath, EntryPoint = "b2Max", CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl)] public static extern Vec2 Max(Vec2 a, Vec2 b); @@ -757,12 +865,12 @@ public static unsafe partial class B2 [System.Runtime.InteropServices.DllImport(BindgenInternal.DllImportPath, EntryPoint = "b2Normalize", CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl)] public static extern Vec2 Normalize(Vec2 v); - [System.Runtime.InteropServices.DllImport(BindgenInternal.DllImportPath, EntryPoint = "b2NormalizeChecked", CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl)] - public static extern Vec2 NormalizeChecked(Vec2 v); - [System.Runtime.InteropServices.DllImport(BindgenInternal.DllImportPath, EntryPoint = "b2NormalizeRot", CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl)] public static extern Rot NormalizeRot(Rot q); + [System.Runtime.InteropServices.DllImport(BindgenInternal.DllImportPath, EntryPoint = "b2PlaneSeparation", CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl)] + public static extern float PlaneSeparation(Plane plane, Vec2 point); + [System.Runtime.InteropServices.DllImport(BindgenInternal.DllImportPath, EntryPoint = "b2PointInCapsule", CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl)] public static extern byte PointInCapsule(Vec2 point, Capsule* shape); @@ -793,12 +901,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_GetSpeed", CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl)] + public static extern float PrismaticJointGetSpeed(JointId jointId); + [System.Runtime.InteropServices.DllImport(BindgenInternal.DllImportPath, EntryPoint = "b2PrismaticJoint_GetSpringDampingRatio", CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl)] public static extern float PrismaticJointGetSpringDampingRatio(JointId jointId); [System.Runtime.InteropServices.DllImport(BindgenInternal.DllImportPath, EntryPoint = "b2PrismaticJoint_GetSpringHertz", CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl)] public static extern float PrismaticJointGetSpringHertz(JointId jointId); + [System.Runtime.InteropServices.DllImport(BindgenInternal.DllImportPath, EntryPoint = "b2PrismaticJoint_GetTranslation", CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl)] + public static extern float PrismaticJointGetTranslation(JointId jointId); + [System.Runtime.InteropServices.DllImport(BindgenInternal.DllImportPath, EntryPoint = "b2PrismaticJoint_GetUpperLimit", CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl)] public static extern float PrismaticJointGetUpperLimit(JointId jointId); @@ -880,6 +994,9 @@ public static unsafe partial class B2 [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_IsSpringEnabled", CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl)] + public static extern byte RevoluteJointIsSpringEnabled(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); @@ -907,9 +1024,6 @@ public static unsafe partial class B2 [System.Runtime.InteropServices.DllImport(BindgenInternal.DllImportPath, EntryPoint = "b2Rot_GetYAxis", CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl)] public static extern Vec2 RotGetYAxis(Rot q); - [System.Runtime.InteropServices.DllImport(BindgenInternal.DllImportPath, EntryPoint = "b2Rot_IsValid", CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl)] - public static extern byte RotIsValid(Rot q); - [System.Runtime.InteropServices.DllImport(BindgenInternal.DllImportPath, EntryPoint = "b2RotateVector", CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl)] public static extern Vec2 RotateVector(Rot q, Vec2 v); @@ -958,6 +1072,9 @@ public static unsafe partial class B2 [System.Runtime.InteropServices.DllImport(BindgenInternal.DllImportPath, EntryPoint = "b2Shape_GetCapsule", CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl)] public static extern Capsule ShapeGetCapsule(ShapeId shapeId); + [System.Runtime.InteropServices.DllImport(BindgenInternal.DllImportPath, EntryPoint = "b2Shape_GetChainSegment", CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl)] + public static extern ChainSegment ShapeGetChainSegment(ShapeId shapeId); + [System.Runtime.InteropServices.DllImport(BindgenInternal.DllImportPath, EntryPoint = "b2Shape_GetCircle", CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl)] public static extern Circle ShapeGetCircle(ShapeId shapeId); @@ -979,6 +1096,12 @@ public static unsafe partial class B2 [System.Runtime.InteropServices.DllImport(BindgenInternal.DllImportPath, EntryPoint = "b2Shape_GetFriction", CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl)] public static extern float ShapeGetFriction(ShapeId shapeId); + [System.Runtime.InteropServices.DllImport(BindgenInternal.DllImportPath, EntryPoint = "b2Shape_GetMassData", CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl)] + public static extern MassData ShapeGetMassData(ShapeId shapeId); + + [System.Runtime.InteropServices.DllImport(BindgenInternal.DllImportPath, EntryPoint = "b2Shape_GetMaterial", CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl)] + public static extern int ShapeGetMaterial(ShapeId shapeId); + [System.Runtime.InteropServices.DllImport(BindgenInternal.DllImportPath, EntryPoint = "b2Shape_GetParentChain", CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl)] public static extern ChainId ShapeGetParentChain(ShapeId shapeId); @@ -991,8 +1114,11 @@ public static unsafe partial class B2 [System.Runtime.InteropServices.DllImport(BindgenInternal.DllImportPath, EntryPoint = "b2Shape_GetSegment", CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl)] public static extern Segment ShapeGetSegment(ShapeId shapeId); - [System.Runtime.InteropServices.DllImport(BindgenInternal.DllImportPath, EntryPoint = "b2Shape_GetSmoothSegment", CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl)] - public static extern SmoothSegment ShapeGetSmoothSegment(ShapeId shapeId); + [System.Runtime.InteropServices.DllImport(BindgenInternal.DllImportPath, EntryPoint = "b2Shape_GetSensorCapacity", CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl)] + public static extern int ShapeGetSensorCapacity(ShapeId shapeId); + + [System.Runtime.InteropServices.DllImport(BindgenInternal.DllImportPath, EntryPoint = "b2Shape_GetSensorOverlaps", CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl)] + public static extern int ShapeGetSensorOverlaps(ShapeId shapeId, ShapeId* overlaps, int capacity); [System.Runtime.InteropServices.DllImport(BindgenInternal.DllImportPath, EntryPoint = "b2Shape_GetType", CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl)] public static extern ShapeType ShapeGetType(ShapeId shapeId); @@ -1000,6 +1126,9 @@ public static unsafe partial class B2 [System.Runtime.InteropServices.DllImport(BindgenInternal.DllImportPath, EntryPoint = "b2Shape_GetUserData", CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl)] public static extern void* ShapeGetUserData(ShapeId shapeId); + [System.Runtime.InteropServices.DllImport(BindgenInternal.DllImportPath, EntryPoint = "b2Shape_GetWorld", CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl)] + public static extern WorldId ShapeGetWorld(ShapeId shapeId); + [System.Runtime.InteropServices.DllImport(BindgenInternal.DllImportPath, EntryPoint = "b2Shape_IsSensor", CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl)] public static extern byte ShapeIsSensor(ShapeId shapeId); @@ -1007,7 +1136,7 @@ public static unsafe partial class B2 public static extern byte ShapeIsValid(ShapeId id); [System.Runtime.InteropServices.DllImport(BindgenInternal.DllImportPath, EntryPoint = "b2Shape_RayCast", CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl)] - public static extern CastOutput ShapeRayCast(ShapeId shapeId, Vec2 origin, Vec2 translation); + public static extern CastOutput ShapeRayCast(ShapeId shapeId, RayCastInput* input); [System.Runtime.InteropServices.DllImport(BindgenInternal.DllImportPath, EntryPoint = "b2Shape_SetCapsule", CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl)] public static extern void ShapeSetCapsule(ShapeId shapeId, Capsule* capsule); @@ -1016,7 +1145,7 @@ public static unsafe partial class B2 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); + public static extern void ShapeSetDensity(ShapeId shapeId, float density, byte updateBodyMass); [System.Runtime.InteropServices.DllImport(BindgenInternal.DllImportPath, EntryPoint = "b2Shape_SetFilter", CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl)] public static extern void ShapeSetFilter(ShapeId shapeId, Filter filter); @@ -1024,6 +1153,9 @@ public static unsafe partial class B2 [System.Runtime.InteropServices.DllImport(BindgenInternal.DllImportPath, EntryPoint = "b2Shape_SetFriction", CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl)] public static extern void ShapeSetFriction(ShapeId shapeId, float friction); + [System.Runtime.InteropServices.DllImport(BindgenInternal.DllImportPath, EntryPoint = "b2Shape_SetMaterial", CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl)] + public static extern void ShapeSetMaterial(ShapeId shapeId, int material); + [System.Runtime.InteropServices.DllImport(BindgenInternal.DllImportPath, EntryPoint = "b2Shape_SetPolygon", CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl)] public static extern void ShapeSetPolygon(ShapeId shapeId, Polygon* polygon); @@ -1055,14 +1187,26 @@ public static unsafe partial class B2 public static extern CastOutput ShapeCastSegment(ShapeCastInput* input, Segment* shape); [System.Runtime.InteropServices.DllImport(BindgenInternal.DllImportPath, EntryPoint = "b2ShapeDistance", CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl)] - public static extern DistanceOutput ShapeDistance(DistanceCache* cache, DistanceInput* input, Simplex* simplexes, int simplexCapacity); - - [System.Runtime.InteropServices.DllImport(BindgenInternal.DllImportPath, EntryPoint = "b2SleepMilliseconds", CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl)] - public static extern void SleepMilliseconds(int milliseconds); + public static extern DistanceOutput ShapeDistance(DistanceInput* input, SimplexCache* cache, Simplex* simplexes, int simplexCapacity); [System.Runtime.InteropServices.DllImport(BindgenInternal.DllImportPath, EntryPoint = "b2Solve22", CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl)] public static extern Vec2 Solve22(Mat22 A, Vec2 b); + [System.Runtime.InteropServices.DllImport(BindgenInternal.DllImportPath, EntryPoint = "b2SolvePlanes", CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl)] + public static extern PlaneSolverResult SolvePlanes(Vec2 position, CollisionPlane* planes, int count); + + [System.Runtime.InteropServices.DllImport(BindgenInternal.DllImportPath, EntryPoint = "b2StoreBodyId", CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl)] + public static extern ulong StoreBodyId(BodyId id); + + [System.Runtime.InteropServices.DllImport(BindgenInternal.DllImportPath, EntryPoint = "b2StoreChainId", CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl)] + public static extern ulong StoreChainId(ChainId id); + + [System.Runtime.InteropServices.DllImport(BindgenInternal.DllImportPath, EntryPoint = "b2StoreJointId", CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl)] + public static extern ulong StoreJointId(JointId id); + + [System.Runtime.InteropServices.DllImport(BindgenInternal.DllImportPath, EntryPoint = "b2StoreShapeId", CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl)] + public static extern ulong StoreShapeId(ShapeId id); + [System.Runtime.InteropServices.DllImport(BindgenInternal.DllImportPath, EntryPoint = "b2Sub", CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl)] public static extern Vec2 Sub(Vec2 a, Vec2 b); @@ -1076,14 +1220,14 @@ public static unsafe partial class B2 public static extern Polygon TransformPolygon(Transform transform, Polygon* polygon); [System.Runtime.InteropServices.DllImport(BindgenInternal.DllImportPath, EntryPoint = "b2UnwindAngle", CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl)] - public static extern float UnwindAngle(float angle); + public static extern float UnwindAngle(float radians); + + [System.Runtime.InteropServices.DllImport(BindgenInternal.DllImportPath, EntryPoint = "b2UnwindLargeAngle", CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl)] + public static extern float UnwindLargeAngle(float radians); [System.Runtime.InteropServices.DllImport(BindgenInternal.DllImportPath, EntryPoint = "b2ValidateHull", CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl)] public static extern byte ValidateHull(Hull* hull); - [System.Runtime.InteropServices.DllImport(BindgenInternal.DllImportPath, EntryPoint = "b2Vec2_IsValid", CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl)] - public static extern byte Vec2IsValid(Vec2 v); - [System.Runtime.InteropServices.DllImport(BindgenInternal.DllImportPath, EntryPoint = "b2WeldJoint_GetAngularDampingRatio", CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl)] public static extern float WeldJointGetAngularDampingRatio(JointId jointId); @@ -1096,6 +1240,9 @@ public static unsafe partial class B2 [System.Runtime.InteropServices.DllImport(BindgenInternal.DllImportPath, EntryPoint = "b2WeldJoint_GetLinearHertz", CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl)] public static extern float WeldJointGetLinearHertz(JointId jointId); + [System.Runtime.InteropServices.DllImport(BindgenInternal.DllImportPath, EntryPoint = "b2WeldJoint_GetReferenceAngle", CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl)] + public static extern float WeldJointGetReferenceAngle(JointId jointId); + [System.Runtime.InteropServices.DllImport(BindgenInternal.DllImportPath, EntryPoint = "b2WeldJoint_SetAngularDampingRatio", CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl)] public static extern void WeldJointSetAngularDampingRatio(JointId jointId, float dampingRatio); @@ -1108,6 +1255,9 @@ public static unsafe partial class B2 [System.Runtime.InteropServices.DllImport(BindgenInternal.DllImportPath, EntryPoint = "b2WeldJoint_SetLinearHertz", CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl)] public static extern void WeldJointSetLinearHertz(JointId jointId, float hertz); + [System.Runtime.InteropServices.DllImport(BindgenInternal.DllImportPath, EntryPoint = "b2WeldJoint_SetReferenceAngle", CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl)] + public static extern void WeldJointSetReferenceAngle(JointId jointId, float angleInRadians); + [System.Runtime.InteropServices.DllImport(BindgenInternal.DllImportPath, EntryPoint = "b2WheelJoint_EnableLimit", CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl)] public static extern void WheelJointEnableLimit(JointId jointId, byte enableLimit); @@ -1162,21 +1312,21 @@ public static unsafe partial class B2 [System.Runtime.InteropServices.DllImport(BindgenInternal.DllImportPath, EntryPoint = "b2WheelJoint_SetSpringHertz", CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl)] public static extern void WheelJointSetSpringHertz(JointId jointId, float hertz); - [System.Runtime.InteropServices.DllImport(BindgenInternal.DllImportPath, EntryPoint = "b2World_CastCapsule", CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl)] - public static extern void WorldCastCapsule(WorldId worldId, Capsule* capsule, Transform originTransform, Vec2 translation, QueryFilter filter, System.IntPtr fcn, void* context); - - [System.Runtime.InteropServices.DllImport(BindgenInternal.DllImportPath, EntryPoint = "b2World_CastCircle", CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl)] - public static extern void WorldCastCircle(WorldId worldId, Circle* circle, Transform originTransform, Vec2 translation, QueryFilter filter, System.IntPtr fcn, void* context); - - [System.Runtime.InteropServices.DllImport(BindgenInternal.DllImportPath, EntryPoint = "b2World_CastPolygon", CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl)] - public static extern void WorldCastPolygon(WorldId worldId, Polygon* polygon, Transform originTransform, Vec2 translation, QueryFilter filter, System.IntPtr fcn, void* context); + [System.Runtime.InteropServices.DllImport(BindgenInternal.DllImportPath, EntryPoint = "b2World_CastMover", CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl)] + public static extern float WorldCastMover(WorldId worldId, Capsule* mover, Vec2 translation, QueryFilter filter); [System.Runtime.InteropServices.DllImport(BindgenInternal.DllImportPath, EntryPoint = "b2World_CastRay", CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl)] - public static extern void WorldCastRay(WorldId worldId, Vec2 origin, Vec2 translation, QueryFilter filter, System.IntPtr fcn, void* context); + public static extern TreeStats WorldCastRay(WorldId worldId, Vec2 origin, Vec2 translation, QueryFilter filter, System.IntPtr fcn, void* context); [System.Runtime.InteropServices.DllImport(BindgenInternal.DllImportPath, EntryPoint = "b2World_CastRayClosest", CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl)] public static extern RayResult WorldCastRayClosest(WorldId worldId, Vec2 origin, Vec2 translation, QueryFilter filter); + [System.Runtime.InteropServices.DllImport(BindgenInternal.DllImportPath, EntryPoint = "b2World_CastShape", CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl)] + public static extern TreeStats WorldCastShape(WorldId worldId, ShapeProxy* proxy, Vec2 translation, QueryFilter filter, System.IntPtr fcn, void* context); + + [System.Runtime.InteropServices.DllImport(BindgenInternal.DllImportPath, EntryPoint = "b2World_CollideMover", CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl)] + public static extern void WorldCollideMover(WorldId worldId, Capsule* mover, QueryFilter filter, System.IntPtr fcn, void* context); + [System.Runtime.InteropServices.DllImport(BindgenInternal.DllImportPath, EntryPoint = "b2World_Draw", CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl)] public static extern void WorldDraw(WorldId worldId, DebugDraw* draw); @@ -1189,11 +1339,17 @@ public static unsafe partial class B2 [System.Runtime.InteropServices.DllImport(BindgenInternal.DllImportPath, EntryPoint = "b2World_EnableSleeping", CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl)] public static extern void WorldEnableSleeping(WorldId worldId, byte flag); + [System.Runtime.InteropServices.DllImport(BindgenInternal.DllImportPath, EntryPoint = "b2World_EnableSpeculative", CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl)] + public static extern void WorldEnableSpeculative(WorldId worldId, byte flag); + [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_Explode", CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl)] - public static extern void WorldExplode(WorldId worldId, Vec2 position, float radius, float impulse); + public static extern void WorldExplode(WorldId worldId, ExplosionDef* explosionDef); + + [System.Runtime.InteropServices.DllImport(BindgenInternal.DllImportPath, EntryPoint = "b2World_GetAwakeBodyCount", CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl)] + public static extern int WorldGetAwakeBodyCount(WorldId worldId); [System.Runtime.InteropServices.DllImport(BindgenInternal.DllImportPath, EntryPoint = "b2World_GetBodyEvents", CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl)] public static extern BodyEvents WorldGetBodyEvents(WorldId worldId); @@ -1207,45 +1363,78 @@ public static unsafe partial class B2 [System.Runtime.InteropServices.DllImport(BindgenInternal.DllImportPath, EntryPoint = "b2World_GetGravity", CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl)] public static extern Vec2 WorldGetGravity(WorldId worldId); + [System.Runtime.InteropServices.DllImport(BindgenInternal.DllImportPath, EntryPoint = "b2World_GetHitEventThreshold", CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl)] + public static extern float WorldGetHitEventThreshold(WorldId worldId); + + [System.Runtime.InteropServices.DllImport(BindgenInternal.DllImportPath, EntryPoint = "b2World_GetMaximumLinearSpeed", CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl)] + public static extern float WorldGetMaximumLinearSpeed(WorldId worldId); + [System.Runtime.InteropServices.DllImport(BindgenInternal.DllImportPath, EntryPoint = "b2World_GetProfile", CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl)] public static extern Profile WorldGetProfile(WorldId worldId); + [System.Runtime.InteropServices.DllImport(BindgenInternal.DllImportPath, EntryPoint = "b2World_GetRestitutionThreshold", CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl)] + public static extern float WorldGetRestitutionThreshold(WorldId worldId); + [System.Runtime.InteropServices.DllImport(BindgenInternal.DllImportPath, EntryPoint = "b2World_GetSensorEvents", CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl)] public static extern SensorEvents WorldGetSensorEvents(WorldId worldId); + [System.Runtime.InteropServices.DllImport(BindgenInternal.DllImportPath, EntryPoint = "b2World_GetUserData", CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl)] + public static extern void* WorldGetUserData(WorldId worldId); + + [System.Runtime.InteropServices.DllImport(BindgenInternal.DllImportPath, EntryPoint = "b2World_IsContinuousEnabled", CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl)] + public static extern byte WorldIsContinuousEnabled(WorldId worldId); + + [System.Runtime.InteropServices.DllImport(BindgenInternal.DllImportPath, EntryPoint = "b2World_IsSleepingEnabled", CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl)] + public static extern byte WorldIsSleepingEnabled(WorldId worldId); + [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_IsWarmStartingEnabled", CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl)] + public static extern byte WorldIsWarmStartingEnabled(WorldId worldId); - [System.Runtime.InteropServices.DllImport(BindgenInternal.DllImportPath, EntryPoint = "b2World_OverlapCapsule", CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl)] - 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_OverlapAABB", CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl)] + public static extern TreeStats WorldOverlapAABB(WorldId worldId, AABB aabb, 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, Circle* circle, Transform transform, QueryFilter filter, System.IntPtr fcn, void* context); + [System.Runtime.InteropServices.DllImport(BindgenInternal.DllImportPath, EntryPoint = "b2World_OverlapShape", CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl)] + public static extern TreeStats WorldOverlapShape(WorldId worldId, ShapeProxy* proxy, 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, Polygon* polygon, Transform transform, QueryFilter filter, System.IntPtr fcn, void* context); + [System.Runtime.InteropServices.DllImport(BindgenInternal.DllImportPath, EntryPoint = "b2World_RebuildStaticTree", CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl)] + public static extern void WorldRebuildStaticTree(WorldId worldId); [System.Runtime.InteropServices.DllImport(BindgenInternal.DllImportPath, EntryPoint = "b2World_SetContactTuning", CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl)] - public static extern void WorldSetContactTuning(WorldId worldId, float hertz, float dampingRatio, float pushVelocity); + public static extern void WorldSetContactTuning(WorldId worldId, float hertz, float dampingRatio, float pushSpeed); [System.Runtime.InteropServices.DllImport(BindgenInternal.DllImportPath, EntryPoint = "b2World_SetCustomFilterCallback", CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl)] public static extern void WorldSetCustomFilterCallback(WorldId worldId, System.IntPtr fcn, void* context); + [System.Runtime.InteropServices.DllImport(BindgenInternal.DllImportPath, EntryPoint = "b2World_SetFrictionCallback", CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl)] + public static extern void WorldSetFrictionCallback(WorldId worldId, System.IntPtr callback); + [System.Runtime.InteropServices.DllImport(BindgenInternal.DllImportPath, EntryPoint = "b2World_SetGravity", CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl)] public static extern void WorldSetGravity(WorldId worldId, Vec2 gravity); [System.Runtime.InteropServices.DllImport(BindgenInternal.DllImportPath, EntryPoint = "b2World_SetHitEventThreshold", CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl)] public static extern void WorldSetHitEventThreshold(WorldId worldId, float value); + [System.Runtime.InteropServices.DllImport(BindgenInternal.DllImportPath, EntryPoint = "b2World_SetJointTuning", CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl)] + public static extern void WorldSetJointTuning(WorldId worldId, float hertz, float dampingRatio); + + [System.Runtime.InteropServices.DllImport(BindgenInternal.DllImportPath, EntryPoint = "b2World_SetMaximumLinearSpeed", CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl)] + public static extern void WorldSetMaximumLinearSpeed(WorldId worldId, float maximumLinearSpeed); + [System.Runtime.InteropServices.DllImport(BindgenInternal.DllImportPath, EntryPoint = "b2World_SetPreSolveCallback", CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl)] public static extern void WorldSetPreSolveCallback(WorldId worldId, System.IntPtr fcn, void* context); + [System.Runtime.InteropServices.DllImport(BindgenInternal.DllImportPath, EntryPoint = "b2World_SetRestitutionCallback", CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl)] + public static extern void WorldSetRestitutionCallback(WorldId worldId, System.IntPtr callback); + [System.Runtime.InteropServices.DllImport(BindgenInternal.DllImportPath, EntryPoint = "b2World_SetRestitutionThreshold", CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl)] public static extern void WorldSetRestitutionThreshold(WorldId worldId, float value); + [System.Runtime.InteropServices.DllImport(BindgenInternal.DllImportPath, EntryPoint = "b2World_SetUserData", CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl)] + public static extern void WorldSetUserData(WorldId worldId, void* userData); + [System.Runtime.InteropServices.DllImport(BindgenInternal.DllImportPath, EntryPoint = "b2World_Step", CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl)] public static extern void WorldStep(WorldId worldId, float timeStep, int subStepCount); @@ -1279,6 +1468,8 @@ public partial struct BodyDef public float sleepThreshold; + public byte* name; + public void* userData; public byte enableSleep; @@ -1291,8 +1482,6 @@ public partial struct BodyDef public byte isEnabled; - public byte automaticMass; - public byte allowFastRotation; public int internalValue; @@ -1311,7 +1500,7 @@ public partial struct BodyId public ushort world0; - public ushort revision; + public ushort generation; } public partial struct BodyMoveEvent @@ -1355,14 +1544,16 @@ public partial struct ChainDef public int count; - public float friction; + public SurfaceMaterial* materials; - public float restitution; + public int materialCount; public Filter filter; public byte isLoop; + public byte enableSensorEvents; + public int internalValue; } @@ -1372,7 +1563,18 @@ public partial struct ChainId public ushort world0; - public ushort revision; + public ushort generation; + } + + public partial struct ChainSegment + { + public Vec2 ghost1; + + public Segment segment; + + public Vec2 ghost2; + + public int chainId; } public partial struct Circle @@ -1382,11 +1584,24 @@ public partial struct Circle public float radius; } + public partial struct CollisionPlane + { + public Plane plane; + + public float pushLimit; + + public float push; + + public byte clipVelocity; + } + public partial struct ContactBeginTouchEvent { public ShapeId shapeIdA; public ShapeId shapeIdB; + + public Manifold manifold; } public partial struct ContactData @@ -1433,10 +1648,15 @@ public partial struct ContactHitEvent public float approachSpeed; } - public partial struct Counters + public partial struct CosSin { - public int staticBodyCount; + public float cosine; + public float sine; + } + + public partial struct Counters + { public int bodyCount; public int shapeCount; @@ -1462,25 +1682,23 @@ public partial struct Counters public partial struct DebugDraw { - public System.IntPtr DrawPolygon; // delegate* + public System.IntPtr DrawPolygonFcn; // delegate* - public System.IntPtr DrawSolidPolygon; // delegate* + public System.IntPtr DrawSolidPolygonFcn; // delegate* - public System.IntPtr DrawCircle; // delegate* + public System.IntPtr DrawCircleFcn; // delegate* - public System.IntPtr DrawSolidCircle; // delegate* + public System.IntPtr DrawSolidCircleFcn; // delegate* - public System.IntPtr DrawCapsule; // delegate* + public System.IntPtr DrawSolidCapsuleFcn; // delegate* - public System.IntPtr DrawSolidCapsule; // delegate* + public System.IntPtr DrawSegmentFcn; // delegate* - public System.IntPtr DrawSegment; // delegate* + public System.IntPtr DrawTransformFcn; // delegate* - public System.IntPtr DrawTransform; // delegate* + public System.IntPtr DrawPointFcn; // delegate* - public System.IntPtr DrawPoint; // delegate* - - public System.IntPtr DrawString; // delegate* + public System.IntPtr DrawStringFcn; // delegate* public AABB drawingBounds; @@ -1492,10 +1710,12 @@ public partial struct DebugDraw public byte drawJointExtras; - public byte drawAABBs; + public byte drawBounds; public byte drawMass; + public byte drawBodyNames; + public byte drawContacts; public byte drawGraphColors; @@ -1504,25 +1724,20 @@ public partial struct DebugDraw public byte drawContactImpulses; - public byte drawFrictionImpulses; - - public void* context; - } + public byte drawContactFeatures; - public partial struct DistanceCache - { - public ushort count; + public byte drawFrictionImpulses; - public fixed byte indexA[3]; + public byte drawIslands; - public fixed byte indexB[3]; + public void* context; } public partial struct DistanceInput { - public DistanceProxy proxyA; + public ShapeProxy proxyA; - public DistanceProxy proxyB; + public ShapeProxy proxyB; public Transform transformA; @@ -1574,6 +1789,8 @@ public partial struct DistanceOutput public Vec2 pointB; + public Vec2 normal; + public float distance; public int iterations; @@ -1581,39 +1798,6 @@ public partial struct DistanceOutput public int simplexCount; } - public partial struct DistanceProxy - { - public points_FixedBuffer points; - - public int count; - - public float radius; - - public partial struct points_FixedBuffer - { - public Vec2 Item0; - - public Vec2 Item1; - - public Vec2 Item2; - - public Vec2 Item3; - - public Vec2 Item4; - - public Vec2 Item5; - - public Vec2 Item6; - - public Vec2 Item7; - - public ref Vec2 this[int index] => ref AsSpan()[index]; - - [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.AggressiveInlining)] - public System.Span AsSpan() => System.Runtime.InteropServices.MemoryMarshal.CreateSpan(ref Item0, 8); - } - } - public partial struct DynamicTree { public TreeNode* nodes; @@ -1637,17 +1821,45 @@ public partial struct DynamicTree public int* binIndices; public int rebuildCapacity; + + public partial struct TreeNode + { + } + } + + public partial struct ExplosionDef + { + public ulong maskBits; + + public Vec2 position; + + public float radius; + + public float falloff; + + public float impulsePerLength; } public partial struct Filter { - public uint categoryBits; + public ulong categoryBits; - public uint maskBits; + public ulong maskBits; public int groupIndex; } + public partial struct FilterJointDef + { + public BodyId bodyIdA; + + public BodyId bodyIdB; + + public void* userData; + + public int internalValue; + } + public partial struct Hull { public points_FixedBuffer points; @@ -1685,15 +1897,17 @@ public partial struct JointId public ushort world0; - public ushort revision; + public ushort generation; } public partial struct Manifold { - public points_FixedBuffer points; - public Vec2 normal; + public float rollingImpulse; + + public points_FixedBuffer points; + public int pointCount; public partial struct points_FixedBuffer @@ -1723,7 +1937,7 @@ public partial struct ManifoldPoint public float tangentImpulse; - public float maxNormalImpulse; + public float totalNormalImpulse; public float normalVelocity; @@ -1792,6 +2006,27 @@ public partial struct MouseJointDef public int internalValue; } + public partial struct Plane + { + public Vec2 normal; + + public float offset; + } + + public partial struct PlaneResult + { + public Plane plane; + + public byte hit; + } + + public partial struct PlaneSolverResult + { + public Vec2 position; + + public int iterationCount; + } + public partial struct Polygon { public vertices_FixedBuffer vertices; @@ -1902,13 +2137,11 @@ public partial struct Profile public float solve; - public float buildIslands; - - public float solveConstraints; + public float mergeIslands; - public float prepareTasks; + public float prepareStages; - public float solverTasks; + public float solveConstraints; public float prepareConstraints; @@ -1916,34 +2149,36 @@ public partial struct Profile public float warmStart; - public float solveVelocities; + public float solveImpulses; public float integratePositions; - public float relaxVelocities; + public float relaxImpulses; public float applyRestitution; public float storeImpulses; - public float finalizeBodies; - public float splitIslands; - public float sleepIslands; + public float transforms; public float hitEvents; - public float broadphase; + public float refit; + + public float bullets; + + public float sleepIslands; - public float continuous; + public float sensors; } public partial struct QueryFilter { - public uint categoryBits; + public ulong categoryBits; - public uint maskBits; + public ulong maskBits; } public partial struct RayCastInput @@ -1965,6 +2200,10 @@ public partial struct RayResult public float fraction; + public int nodeVisits; + + public int leafVisits; + public byte hit; } @@ -2061,46 +2300,20 @@ public partial struct SensorEvents public partial struct ShapeCastInput { - public points_FixedBuffer points; - - public int count; - - public float radius; + public ShapeProxy proxy; public Vec2 translation; public float maxFraction; - public partial struct points_FixedBuffer - { - public Vec2 Item0; - - public Vec2 Item1; - - public Vec2 Item2; - - public Vec2 Item3; - - public Vec2 Item4; - - public Vec2 Item5; - - public Vec2 Item6; - - public Vec2 Item7; - - public ref Vec2 this[int index] => ref AsSpan()[index]; - - [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.AggressiveInlining)] - public System.Span AsSpan() => System.Runtime.InteropServices.MemoryMarshal.CreateSpan(ref Item0, 8); - } + public byte canEncroach; } public partial struct ShapeCastPairInput { - public DistanceProxy proxyA; + public ShapeProxy proxyA; - public DistanceProxy proxyB; + public ShapeProxy proxyB; public Transform transformA; @@ -2109,22 +2322,20 @@ public partial struct ShapeCastPairInput public Vec2 translationB; public float maxFraction; + + public byte canEncroach; } public partial struct ShapeDef { public void* userData; - public float friction; - - public float restitution; + public SurfaceMaterial material; public float density; public Filter filter; - public uint customColor; - public byte isSensor; public byte enableSensorEvents; @@ -2135,7 +2346,9 @@ public partial struct ShapeDef public byte enablePreSolveEvents; - public byte forceContactCreation; + public byte invokeContactCreation; + + public byte updateBodyMass; public int internalValue; } @@ -2146,7 +2359,40 @@ public partial struct ShapeId public ushort world0; - public ushort revision; + public ushort generation; + } + + public partial struct ShapeProxy + { + public points_FixedBuffer points; + + public int count; + + public float radius; + + public partial struct points_FixedBuffer + { + public Vec2 Item0; + + public Vec2 Item1; + + public Vec2 Item2; + + public Vec2 Item3; + + public Vec2 Item4; + + public Vec2 Item5; + + public Vec2 Item6; + + public Vec2 Item7; + + public ref Vec2 this[int index] => ref AsSpan()[index]; + + [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.AggressiveInlining)] + public System.Span AsSpan() => System.Runtime.InteropServices.MemoryMarshal.CreateSpan(ref Item0, 8); + } } public partial struct Simplex @@ -2160,6 +2406,15 @@ public partial struct Simplex public int count; } + public partial struct SimplexCache + { + public ushort count; + + public fixed byte indexA[3]; + + public fixed byte indexB[3]; + } + public partial struct SimplexVertex { public Vec2 wA; @@ -2175,15 +2430,19 @@ public partial struct SimplexVertex public int indexB; } - public partial struct SmoothSegment + public partial struct SurfaceMaterial { - public Vec2 ghost1; + public float friction; - public Segment segment; + public float restitution; - public Vec2 ghost2; + public float rollingResistance; - public int chainId; + public float tangentSpeed; + + public int userMaterialId; + + public uint customColor; } public partial struct Sweep @@ -2199,31 +2458,24 @@ public partial struct Sweep public Rot q2; } - public partial struct Timer - { - public ulong start_sec; - - public ulong start_usec; - } - public partial struct TOIInput { - public DistanceProxy proxyA; + public ShapeProxy proxyA; - public DistanceProxy proxyB; + public ShapeProxy proxyB; public Sweep sweepA; public Sweep sweepB; - public float tMax; + public float maxFraction; } public partial struct TOIOutput { public TOIState state; - public float t; + public float fraction; } public partial struct Transform @@ -2233,39 +2485,11 @@ public partial struct Transform public Rot q; } - public partial struct TreeNode + public partial struct TreeStats { - public AABB aabb; - - public uint categoryBits; - - public AnonymousRecord_collision_L608_C2 AnonymousRecord_collision_L608_C2_Field; - - public int child1; - - public int child2; - - public int userData; - - public short height; - - public byte enlarged; - - public fixed byte pad[9]; - - public ref int parent => ref AnonymousRecord_collision_L608_C2_Field.parent; - - public ref int next => ref AnonymousRecord_collision_L608_C2_Field.next; - - [System.Runtime.InteropServices.StructLayout(System.Runtime.InteropServices.LayoutKind.Explicit)] - public partial struct AnonymousRecord_collision_L608_C2 - { - [System.Runtime.InteropServices.FieldOffset(0)] - public int parent; + public int nodeVisits; - [System.Runtime.InteropServices.FieldOffset(0)] - public int next; - } + public int leafVisits; } public partial struct Vec2 @@ -2354,23 +2578,27 @@ public partial struct WorldDef public float restitutionThreshold; - public float contactPushoutVelocity; - public float hitEventThreshold; public float contactHertz; public float contactDampingRatio; + public float maxContactPushSpeed; + public float jointHertz; public float jointDampingRatio; - public float maximumLinearVelocity; + public float maximumLinearSpeed; + + public System.IntPtr frictionCallback; // delegate* + + public System.IntPtr restitutionCallback; // delegate* public byte enableSleep; - public byte enableContinous; + public byte enableContinuous; public int workerCount; @@ -2380,6 +2608,8 @@ public partial struct WorldDef public void* userTaskContext; + public void* userData; + public int internalValue; } @@ -2387,7 +2617,7 @@ public partial struct WorldId { public ushort index1; - public ushort revision; + public ushort generation; } public enum BodyType : uint @@ -2423,7 +2653,7 @@ public enum HexColor : uint colorCyan = 65535, colorDarkBlue = 139, colorDarkCyan = 35723, - colorDarkGoldenrod = 12092939, + colorDarkGoldenRod = 12092939, colorDarkGray = 11119017, colorDarkGreen = 25600, colorDarkKhaki = 12433259, @@ -2442,27 +2672,18 @@ public enum HexColor : uint colorDeepSkyBlue = 49151, colorDimGray = 6908265, colorDodgerBlue = 2003199, - colorFirebrick = 11674146, + colorFireBrick = 11674146, colorFloralWhite = 16775920, colorForestGreen = 2263842, colorFuchsia = 16711935, colorGainsboro = 14474460, colorGhostWhite = 16316671, colorGold = 16766720, - colorGoldenrod = 14329120, - colorGray = 12500670, - colorGray1 = 1710618, - colorGray2 = 3355443, - colorGray3 = 5066061, - colorGray4 = 6710886, - colorGray5 = 8355711, - colorGray6 = 10066329, - colorGray7 = 11776947, - colorGray8 = 13421772, - colorGray9 = 15066597, - colorGreen = 65280, + colorGoldenRod = 14329120, + colorGray = 8421504, + colorGreen = 32768, colorGreenYellow = 11403055, - colorHoneydew = 15794160, + colorHoneyDew = 15794160, colorHotPink = 16738740, colorIndianRed = 13458524, colorIndigo = 4915330, @@ -2475,15 +2696,13 @@ public enum HexColor : uint colorLightBlue = 11393254, colorLightCoral = 15761536, colorLightCyan = 14745599, - colorLightGoldenrod = 15654274, - colorLightGoldenrodYellow = 16448210, + colorLightGoldenRodYellow = 16448210, colorLightGray = 13882323, colorLightGreen = 9498256, colorLightPink = 16758465, colorLightSalmon = 16752762, colorLightSeaGreen = 2142890, colorLightSkyBlue = 8900346, - colorLightSlateBlue = 8679679, colorLightSlateGray = 7833753, colorLightSteelBlue = 11584734, colorLightYellow = 16777184, @@ -2491,8 +2710,8 @@ public enum HexColor : uint colorLimeGreen = 3329330, colorLinen = 16445670, colorMagenta = 16711935, - colorMaroon = 11546720, - colorMediumAquamarine = 6737322, + colorMaroon = 8388608, + colorMediumAquaMarine = 6737322, colorMediumBlue = 205, colorMediumOrchid = 12211667, colorMediumPurple = 9662683, @@ -2507,14 +2726,13 @@ public enum HexColor : uint colorMoccasin = 16770229, colorNavajoWhite = 16768685, colorNavy = 128, - colorNavyBlue = 128, colorOldLace = 16643558, colorOlive = 8421376, colorOliveDrab = 7048739, colorOrange = 16753920, colorOrangeRed = 16729344, colorOrchid = 14315734, - colorPaleGoldenrod = 15657130, + colorPaleGoldenRod = 15657130, colorPaleGreen = 10025880, colorPaleTurquoise = 11529966, colorPaleVioletRed = 14381203, @@ -2524,7 +2742,7 @@ public enum HexColor : uint colorPink = 16761035, colorPlum = 14524637, colorPowderBlue = 11591910, - colorPurple = 10494192, + colorPurple = 8388736, colorRebeccaPurple = 6697881, colorRed = 16711680, colorRosyBrown = 12357519, @@ -2533,7 +2751,7 @@ public enum HexColor : uint colorSalmon = 16416882, colorSandyBrown = 16032864, colorSeaGreen = 3050327, - colorSeashell = 16774638, + colorSeaShell = 16774638, colorSienna = 10506797, colorSilver = 12632256, colorSkyBlue = 8900331, @@ -2548,7 +2766,6 @@ public enum HexColor : uint colorTomato = 16737095, colorTurquoise = 4251856, colorViolet = 15631086, - colorVioletRed = 13639824, colorWheat = 16113331, colorWhite = 16777215, colorWhiteSmoke = 16119285, @@ -2563,12 +2780,13 @@ public enum HexColor : uint public enum JointType : uint { distanceJoint = 0, - motorJoint = 1, - mouseJoint = 2, - prismaticJoint = 3, - revoluteJoint = 4, - weldJoint = 5, - wheelJoint = 6 + filterJoint = 1, + motorJoint = 2, + mouseJoint = 3, + prismaticJoint = 4, + revoluteJoint = 5, + weldJoint = 6, + wheelJoint = 7 } public enum ShapeType : uint @@ -2577,7 +2795,7 @@ public enum ShapeType : uint capsuleShape = 1, segmentShape = 2, polygonShape = 3, - smoothSegmentShape = 4, + chainSegmentShape = 4, shapeTypeCount = 5 } @@ -2644,7 +2862,7 @@ public enum TOIState : uint public const HexColor colorDarkCyan = HexColor.colorDarkCyan; - public const HexColor colorDarkGoldenrod = HexColor.colorDarkGoldenrod; + public const HexColor colorDarkGoldenRod = HexColor.colorDarkGoldenRod; public const HexColor colorDarkGray = HexColor.colorDarkGray; @@ -2682,7 +2900,7 @@ public enum TOIState : uint public const HexColor colorDodgerBlue = HexColor.colorDodgerBlue; - public const HexColor colorFirebrick = HexColor.colorFirebrick; + public const HexColor colorFireBrick = HexColor.colorFireBrick; public const HexColor colorFloralWhite = HexColor.colorFloralWhite; @@ -2696,33 +2914,15 @@ public enum TOIState : uint public const HexColor colorGold = HexColor.colorGold; - public const HexColor colorGoldenrod = HexColor.colorGoldenrod; + public const HexColor colorGoldenRod = HexColor.colorGoldenRod; public const HexColor colorGray = HexColor.colorGray; - public const HexColor colorGray1 = HexColor.colorGray1; - - public const HexColor colorGray2 = HexColor.colorGray2; - - public const HexColor colorGray3 = HexColor.colorGray3; - - public const HexColor colorGray4 = HexColor.colorGray4; - - public const HexColor colorGray5 = HexColor.colorGray5; - - public const HexColor colorGray6 = HexColor.colorGray6; - - public const HexColor colorGray7 = HexColor.colorGray7; - - public const HexColor colorGray8 = HexColor.colorGray8; - - public const HexColor colorGray9 = HexColor.colorGray9; - public const HexColor colorGreen = HexColor.colorGreen; public const HexColor colorGreenYellow = HexColor.colorGreenYellow; - public const HexColor colorHoneydew = HexColor.colorHoneydew; + public const HexColor colorHoneyDew = HexColor.colorHoneyDew; public const HexColor colorHotPink = HexColor.colorHotPink; @@ -2748,9 +2948,7 @@ public enum TOIState : uint public const HexColor colorLightCyan = HexColor.colorLightCyan; - public const HexColor colorLightGoldenrod = HexColor.colorLightGoldenrod; - - public const HexColor colorLightGoldenrodYellow = HexColor.colorLightGoldenrodYellow; + public const HexColor colorLightGoldenRodYellow = HexColor.colorLightGoldenRodYellow; public const HexColor colorLightGray = HexColor.colorLightGray; @@ -2764,8 +2962,6 @@ public enum TOIState : uint public const HexColor colorLightSkyBlue = HexColor.colorLightSkyBlue; - public const HexColor colorLightSlateBlue = HexColor.colorLightSlateBlue; - public const HexColor colorLightSlateGray = HexColor.colorLightSlateGray; public const HexColor colorLightSteelBlue = HexColor.colorLightSteelBlue; @@ -2782,7 +2978,7 @@ public enum TOIState : uint public const HexColor colorMaroon = HexColor.colorMaroon; - public const HexColor colorMediumAquamarine = HexColor.colorMediumAquamarine; + public const HexColor colorMediumAquaMarine = HexColor.colorMediumAquaMarine; public const HexColor colorMediumBlue = HexColor.colorMediumBlue; @@ -2812,8 +3008,6 @@ public enum TOIState : uint public const HexColor colorNavy = HexColor.colorNavy; - public const HexColor colorNavyBlue = HexColor.colorNavyBlue; - public const HexColor colorOldLace = HexColor.colorOldLace; public const HexColor colorOlive = HexColor.colorOlive; @@ -2826,7 +3020,7 @@ public enum TOIState : uint public const HexColor colorOrchid = HexColor.colorOrchid; - public const HexColor colorPaleGoldenrod = HexColor.colorPaleGoldenrod; + public const HexColor colorPaleGoldenRod = HexColor.colorPaleGoldenRod; public const HexColor colorPaleGreen = HexColor.colorPaleGreen; @@ -2864,7 +3058,7 @@ public enum TOIState : uint public const HexColor colorSeaGreen = HexColor.colorSeaGreen; - public const HexColor colorSeashell = HexColor.colorSeashell; + public const HexColor colorSeaShell = HexColor.colorSeaShell; public const HexColor colorSienna = HexColor.colorSienna; @@ -2894,8 +3088,6 @@ public enum TOIState : uint public const HexColor colorViolet = HexColor.colorViolet; - public const HexColor colorVioletRed = HexColor.colorVioletRed; - public const HexColor colorWheat = HexColor.colorWheat; public const HexColor colorWhite = HexColor.colorWhite; @@ -2916,6 +3108,8 @@ public enum TOIState : uint public const JointType distanceJoint = JointType.distanceJoint; + public const JointType filterJoint = JointType.filterJoint; + public const JointType motorJoint = JointType.motorJoint; public const JointType mouseJoint = JointType.mouseJoint; @@ -2936,7 +3130,7 @@ public enum TOIState : uint public const ShapeType polygonShape = ShapeType.polygonShape; - public const ShapeType smoothSegmentShape = ShapeType.smoothSegmentShape; + public const ShapeType chainSegmentShape = ShapeType.chainSegmentShape; public const ShapeType shapeTypeCount = ShapeType.shapeTypeCount; @@ -2950,13 +3144,15 @@ public enum TOIState : uint public const TOIState toiStateSeparated = TOIState.toiStateSeparated; - public const int defaultCategoryBits = 1; + public const int B2_DEFAULT_CATEGORY_BITS = 1; + + public const ulong B2_DEFAULT_MASK_BITS = 18446744073709551615; - public const uint defaultMaskBits = 4294967295; + public const int B2_HASH_INIT = 5381; - public const int maxPolygonVertices = 8; + public const int B2_MAX_POLYGON_VERTICES = 8; - public const float pi = 3.1415927f; + public const float B2_PI = 3.1415927f; public partial class BindgenInternal { diff --git a/Box2D.NET.Examples/CSharp/HelloWorld.cs b/Box2D.NET.Examples/CSharp/HelloWorld.cs index 33ab63b..10b2cc4 100644 --- a/Box2D.NET.Examples/CSharp/HelloWorld.cs +++ b/Box2D.NET.Examples/CSharp/HelloWorld.cs @@ -19,7 +19,7 @@ public static void Main() // Create a shape B2.Polygon box = B2.MakeBox(1, 1); B2.ShapeDef shapeDef = B2.DefaultShapeDef(); - shapeDef.friction = 0.6f; + shapeDef.material.friction = 0.6f; shapeDef.density = 1.0f; B2.ShapeId shapeId = B2.CreatePolygonShape(bodyId, &shapeDef, &box); diff --git a/Box2D.NET.Native/build.zig b/Box2D.NET.Native/build.zig index 4e9f309..478b3fb 100644 --- a/Box2D.NET.Native/build.zig +++ b/Box2D.NET.Native/build.zig @@ -26,10 +26,9 @@ pub fn build(b: *Build) void { lib.addCSourceFiles(.{ .files = &.{ "../native/box2d/src/aabb.c", - "../native/box2d/src/allocate.c", + "../native/box2d/src/arena_allocator.c", "../native/box2d/src/array.c", "../native/box2d/src/bitset.c", - "../native/box2d/src/block_array.c", "../native/box2d/src/body.c", "../native/box2d/src/broad_phase.c", "../native/box2d/src/constraint_graph.c", @@ -50,10 +49,10 @@ pub fn build(b: *Build) void { "../native/box2d/src/mouse_joint.c", "../native/box2d/src/prismatic_joint.c", "../native/box2d/src/revolute_joint.c", + "../native/box2d/src/sensor.c", "../native/box2d/src/shape.c", "../native/box2d/src/solver.c", "../native/box2d/src/solver_set.c", - "../native/box2d/src/stack_allocator.c", "../native/box2d/src/table.c", "../native/box2d/src/timer.c", "../native/box2d/src/types.c", diff --git a/Box2D.NET.Tests/WorldTests.cs b/Box2D.NET.Tests/WorldTests.cs index 5cab2c9..bed22f1 100644 --- a/Box2D.NET.Tests/WorldTests.cs +++ b/Box2D.NET.Tests/WorldTests.cs @@ -50,7 +50,7 @@ public void HelloWorld() shapeDef.density = 1.0f; // Override the default friction. - shapeDef.friction = 0.3f; + shapeDef.material.friction = 0.3f; // Add the shape to the body. B2.CreatePolygonShape(bodyId, &shapeDef, &dynamicBox); diff --git a/native/box2d b/native/box2d index 8e7a17c..0f2b024 160000 --- a/native/box2d +++ b/native/box2d @@ -1 +1 @@ -Subproject commit 8e7a17c5c942dbf2fdea8b9d09983410dcc0429d +Subproject commit 0f2b0246f39594e93fcc8dde0fe0bb1b20b403f9 From 30be8695581fba5883baafd0a33160a1b1f2b0a5 Mon Sep 17 00:00:00 2001 From: scatterlogical Date: Wed, 7 May 2025 07:57:49 +1000 Subject: [PATCH 2/3] forgot Mover.c in build.zig fixed versioning & enabled nuget creation on build --- Box2D.NET.Bindings/Box2D.NET.Bindings.csproj | 7 ++++--- Box2D.NET.Native/Box2D.NET.Native.csproj | 7 ++++--- Box2D.NET.Native/build.zig | 1 + Box2D.NET/Box2D.NET.csproj | 7 ++++--- 4 files changed, 13 insertions(+), 9 deletions(-) diff --git a/Box2D.NET.Bindings/Box2D.NET.Bindings.csproj b/Box2D.NET.Bindings/Box2D.NET.Bindings.csproj index a1aa96a..153fbe4 100644 --- a/Box2D.NET.Bindings/Box2D.NET.Bindings.csproj +++ b/Box2D.NET.Bindings/Box2D.NET.Bindings.csproj @@ -3,18 +3,19 @@ netstandard2.1;net6.0;net7.0 true + true true true - 3.0.0 + 3.1.0 Box2D.NET.Bindings.Debug Box2D.NET.Bindings.Release - BeanCheeseBurrito + BeanCheeseBurrito, Scatterlogical BeanCheeseBurrito - Raw C# bindings for Box2D 3.0 + Raw C# bindings for Box2D 3.1 $(Title) https://github.com/BeanCheeseBurrito/Box2D.NET true diff --git a/Box2D.NET.Native/Box2D.NET.Native.csproj b/Box2D.NET.Native/Box2D.NET.Native.csproj index cc4ad81..890da1f 100644 --- a/Box2D.NET.Native/Box2D.NET.Native.csproj +++ b/Box2D.NET.Native/Box2D.NET.Native.csproj @@ -3,6 +3,7 @@ netstandard1.0 $(NoWarn);NU5128 + true @@ -10,12 +11,12 @@ true false - 3.0.0 + 3.1.0 Box2D.NET.Native.Debug Box2D.NET.Native.Release - BeanCheeseBurrito + BeanCheeseBurrito, Scatterlogical BeanCheeseBurrito - Native libraries for Box2D 3.0 + Native libraries for Box2D 3.1 $(Title) https://github.com/BeanCheeseBurrito/Box2D.NET true diff --git a/Box2D.NET.Native/build.zig b/Box2D.NET.Native/build.zig index 478b3fb..098adc6 100644 --- a/Box2D.NET.Native/build.zig +++ b/Box2D.NET.Native/build.zig @@ -47,6 +47,7 @@ pub fn build(b: *Build) void { "../native/box2d/src/math_functions.c", "../native/box2d/src/motor_joint.c", "../native/box2d/src/mouse_joint.c", + "../native/box2d/src/mover.c", "../native/box2d/src/prismatic_joint.c", "../native/box2d/src/revolute_joint.c", "../native/box2d/src/sensor.c", diff --git a/Box2D.NET/Box2D.NET.csproj b/Box2D.NET/Box2D.NET.csproj index c169757..c135258 100644 --- a/Box2D.NET/Box2D.NET.csproj +++ b/Box2D.NET/Box2D.NET.csproj @@ -3,18 +3,19 @@ netstandard2.1;net6.0;net7.0 enable + true true true - 3.0.0 + 3.1.0 Box2D.NET.Debug Box2D.NET.Release - BeanCheeseBurrito + BeanCheeseBurrito, Scatterlogical BeanCheeseBurrito - Raw C# bindings for Box2D 3.0 + Raw C# bindings for Box2D 3.1 $(Title) https://github.com/BeanCheeseBurrito/Box2D.NET true From cf5f33e6c325c3d8330ca0119c448df8f1f0c419 Mon Sep 17 00:00:00 2001 From: scatterlogical Date: Thu, 15 May 2025 14:51:53 +1000 Subject: [PATCH 3/3] fix(submodules): box2d fix up for box2d submodules after branch and rebase of MGUI attempts --- native/box2d | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/native/box2d b/native/box2d index 0f2b024..7f050d7 160000 --- a/native/box2d +++ b/native/box2d @@ -1 +1 @@ -Subproject commit 0f2b0246f39594e93fcc8dde0fe0bb1b20b403f9 +Subproject commit 7f050d7ce7edb55428cfa0e03759361114a0e357