Skip to content

Commit 62aa533

Browse files
committed
Regen for latest Box2D commits
1 parent 9ebc276 commit 62aa533

6 files changed

Lines changed: 62 additions & 68 deletions

File tree

Box2dNet.Samples/Sample.cs

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -58,10 +58,6 @@ public void CreateWorld()
5858
}
5959

6060
var worldDef = m_context.workerCount > 1 ? B2Api.b2DefaultWorldDef_WithDotNetTpl(m_context.workerCount) : B2Api.b2DefaultWorldDef();
61-
//worldDef.workerCount = m_context->workerCount; // we don't set parallellism here, because b2DefaultWorldDef_WithDotNetTpl() configures this.
62-
//worldDef.enqueueTask = EnqueueTask;
63-
//worldDef.finishTask = FinishTask;
64-
//worldDef.userTaskContext = this;
6561
worldDef.enableSleep = m_context.enableSleep;
6662
m_worldId = B2Api.b2CreateWorld(worldDef);
6763
}

Box2dNet/Box2dNet.csproj

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
<RepositoryUrl>https://github.com/thomasvt/Box2D3Net</RepositoryUrl>
1515
<GenerateDocumentationFile>true</GenerateDocumentationFile>
1616
<NoWarn>$(NoWarn);1591</NoWarn> <!-- suppress warnings for missing docs -->
17-
<Version>3.1.8.1</Version>
17+
<Version>3.1.8.2</Version>
1818
</PropertyGroup>
1919

2020
<ItemGroup>

Box2dNet/Interop/B2Api.cs

Lines changed: 57 additions & 63 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// Generated by Box2dNetGen for Box2D v3 on 22/06/2025 13:52:12
1+
// Generated by Box2dNetGen for Box2D v3 on 29/06/2025 12:50:38
22

33
using System.Runtime.InteropServices;
44
using System.Numerics;
@@ -872,7 +872,7 @@ public partial struct b2MassData
872872
public Vector2 center;
873873

874874
/// <summary>
875-
/// The rotational inertia of the shape about the local origin.
875+
/// The rotational inertia of the shape about the shape center.
876876
/// </summary>
877877
/// <returns>Original C type: float</returns>
878878
public float rotationalInertia;
@@ -2443,7 +2443,8 @@ public partial struct b2BodyDef
24432443
public IntPtr /* void* */ userData;
24442444

24452445
/// <summary>
2446-
/// Motions locks to restrict linear and angular movement
2446+
/// Motions locks to restrict linear and angular movement.
2447+
/// Caution: may lead to softer constraints along the locked direction
24472448
/// </summary>
24482449
/// <returns>Original C type: b2MotionLocks</returns>
24492450
public b2MotionLocks motionLocks;
@@ -2472,16 +2473,6 @@ public partial struct b2BodyDef
24722473
[MarshalAs(UnmanagedType.U1)]
24732474
public bool isBullet;
24742475

2475-
/// <summary>
2476-
/// Option to perform continuous collision checks with sensors. This only applies to dynamic bodies.
2477-
/// This is expensive and should be used sparingly. You still need to enable sensor events on the child shapes
2478-
/// for this to work. This only works if the body is awake. This will use a time of impact calculation to
2479-
/// generate sensor begin touch events, but not end events. End events are handled using regular overlap checks.
2480-
/// </summary>
2481-
/// <returns>Original C type: bool</returns>
2482-
[MarshalAs(UnmanagedType.U1)]
2483-
public bool enableSensorHits;
2484-
24852476
/// <summary>
24862477
/// Used to disable a body. A disabled body does not move or collide.
24872478
/// </summary>
@@ -4037,37 +4028,6 @@ public b2JointEvents(in IntPtr jointEvents, in int count)
40374028
this.count = count;
40384029
}
40394030

4040-
}
4041-
4042-
/// <summary>
4043-
/// The contact data for two shapes. By convention the manifold normal points
4044-
/// from shape A to shape B.
4045-
/// @see b2Shape_GetContactData() and b2Body_GetContactData()
4046-
/// </summary>
4047-
[StructLayout(LayoutKind.Sequential)]
4048-
public partial struct b2SensorData
4049-
{
4050-
4051-
/// <summary>
4052-
/// The visiting shape
4053-
/// </summary>
4054-
/// <returns>Original C type: b2ShapeId</returns>
4055-
public b2ShapeId visitorId;
4056-
4057-
/// <summary>
4058-
/// The transform of the body of the visiting shape. This is normally
4059-
/// the current transform of the body. However, for a sensor hit, this is
4060-
/// the transform of the visiting body when it hit.
4061-
/// </summary>
4062-
/// <returns>Original C type: b2Transform</returns>
4063-
public b2Transform visitTransform;
4064-
4065-
public b2SensorData(in b2ShapeId visitorId, in b2Transform visitTransform)
4066-
{
4067-
this.visitorId = visitorId;
4068-
this.visitTransform = visitTransform;
4069-
}
4070-
40714031
}
40724032

40734033
/// <summary>
@@ -5174,8 +5134,8 @@ public static void b2World_SetRestitutionCallback(b2WorldId worldId, b2Restituti
51745134
/// <summary>
51755135
/// Apply an angular impulse. The impulse is ignored if the body is not awake.
51765136
/// This optionally wakes the body.
5177-
/// @warning This should be used for one-shot impulses. If you need a steady force,
5178-
/// use a force instead, which will work better with the sub-stepping solver.
5137+
/// @warning This should be used for one-shot impulses. If you need a steady torque,
5138+
/// use a torque instead, which will work better with the sub-stepping solver.
51795139
/// </summary>
51805140
/// <returns>Original C type: void</returns>
51815141
/// <param name="bodyId">The body id
@@ -5387,7 +5347,7 @@ public static void b2World_SetRestitutionCallback(b2WorldId worldId, b2Restituti
53875347
public static extern void b2Body_Enable(b2BodyId bodyId);
53885348

53895349
/// <summary>
5390-
/// Set this body to have fixed rotation. This causes the mass to be reset in all cases.
5350+
/// Set the motion locks on this body.
53915351
/// </summary>
53925352
/// <returns>Original C type: void</returns>
53935353
/// <param name="bodyId">(Original C type: b2BodyId)</param>
@@ -5396,7 +5356,7 @@ public static void b2World_SetRestitutionCallback(b2WorldId worldId, b2Restituti
53965356
public static extern void b2Body_SetMotionLocks(b2BodyId bodyId, b2MotionLocks locks);
53975357

53985358
/// <summary>
5399-
/// Does this body have fixed rotation?
5359+
/// Get the motion locks for this body.
54005360
/// </summary>
54015361
/// <returns>Original C type: b2MotionLocks</returns>
54025362
/// <param name="bodyId">(Original C type: b2BodyId)</param>
@@ -5975,18 +5935,18 @@ public static void b2World_SetRestitutionCallback(b2WorldId worldId, b2Restituti
59755935
/// <returns>Original C type: int</returns>
59765936
/// <param name="shapeId">the id of a sensor shape
59775937
/// (Original C type: b2ShapeId)</param>
5978-
/// <param name="sensorData">a user allocated array that is filled with the overlapping shapes (visitors)
5979-
/// (Original C type: b2SensorData*)</param>
5938+
/// <param name="visitorIds">a user allocated array that is filled with the overlapping shapes (visitors)
5939+
/// (Original C type: b2ShapeId*)</param>
59805940
/// <param name="capacity">the capacity of overlappedShapes
59815941
/// (Original C type: int)</param>
59825942
/// <param name="shapeId">the id of a sensor shape
59835943
/// (Original C type: b2ShapeId)</param>
5984-
/// <param name="sensorData">a user allocated array that is filled with the overlapping shapes (visitors)
5985-
/// (Original C type: b2SensorData*)</param>
5944+
/// <param name="visitorIds">a user allocated array that is filled with the overlapping shapes (visitors)
5945+
/// (Original C type: b2ShapeId*)</param>
59865946
/// <param name="capacity">the capacity of overlappedShapes
59875947
/// (Original C type: int)</param>
59885948
[DllImport(Box2DLibrary, CallingConvention = CallingConvention.Cdecl)]
5989-
public static extern int b2Shape_GetSensorData(b2ShapeId shapeId, b2SensorData[] sensorData, int capacity);
5949+
public static extern int b2Shape_GetSensorData(b2ShapeId shapeId, b2ShapeId[] visitorIds, int capacity);
59905950

59915951
/// <summary>
59925952
/// Get the current world AABB
@@ -6278,16 +6238,6 @@ public static void b2World_SetRestitutionCallback(b2WorldId worldId, b2Restituti
62786238
[DllImport(Box2DLibrary, CallingConvention = CallingConvention.Cdecl)]
62796239
public static extern float b2Joint_GetAngularSeparation(b2JointId jointId);
62806240

6281-
/// <summary>
6282-
/// Get the joint constraint tuning. Advanced feature.
6283-
/// </summary>
6284-
/// <returns>Original C type: void</returns>
6285-
/// <param name="jointId">(Original C type: b2JointId)</param>
6286-
/// <param name="hertz">(Original C type: float*)</param>
6287-
/// <param name="dampingRatio">(Original C type: float*)</param>
6288-
[DllImport(Box2DLibrary, CallingConvention = CallingConvention.Cdecl)]
6289-
public static extern void b2Joint_GetConstraintTuning(b2JointId jointId, ref float hertz, ref float dampingRatio);
6290-
62916241
/// <summary>
62926242
/// Set the joint constraint tuning. Advanced feature.
62936243
/// </summary>
@@ -6307,6 +6257,50 @@ public static void b2World_SetRestitutionCallback(b2WorldId worldId, b2Restituti
63076257
[DllImport(Box2DLibrary, CallingConvention = CallingConvention.Cdecl)]
63086258
public static extern void b2Joint_SetConstraintTuning(b2JointId jointId, float hertz, float dampingRatio);
63096259

6260+
/// <summary>
6261+
/// Get the joint constraint tuning. Advanced feature.
6262+
/// </summary>
6263+
/// <returns>Original C type: void</returns>
6264+
/// <param name="jointId">(Original C type: b2JointId)</param>
6265+
/// <param name="hertz">(Original C type: float*)</param>
6266+
/// <param name="dampingRatio">(Original C type: float*)</param>
6267+
[DllImport(Box2DLibrary, CallingConvention = CallingConvention.Cdecl)]
6268+
public static extern void b2Joint_GetConstraintTuning(b2JointId jointId, ref float hertz, ref float dampingRatio);
6269+
6270+
/// <summary>
6271+
/// Set the force threshold for joint events (Newtons)
6272+
/// </summary>
6273+
/// <returns>Original C type: void</returns>
6274+
/// <param name="jointId">(Original C type: b2JointId)</param>
6275+
/// <param name="threshold">(Original C type: float)</param>
6276+
[DllImport(Box2DLibrary, CallingConvention = CallingConvention.Cdecl)]
6277+
public static extern void b2Joint_SetForceThreshold(b2JointId jointId, float threshold);
6278+
6279+
/// <summary>
6280+
/// Get the force threshold for joint events (Newtons)
6281+
/// </summary>
6282+
/// <returns>Original C type: float</returns>
6283+
/// <param name="jointId">(Original C type: b2JointId)</param>
6284+
[DllImport(Box2DLibrary, CallingConvention = CallingConvention.Cdecl)]
6285+
public static extern float b2Joint_GetForceThreshold(b2JointId jointId);
6286+
6287+
/// <summary>
6288+
/// Set the torque threshold for joint events (N-m)
6289+
/// </summary>
6290+
/// <returns>Original C type: void</returns>
6291+
/// <param name="jointId">(Original C type: b2JointId)</param>
6292+
/// <param name="threshold">(Original C type: float)</param>
6293+
[DllImport(Box2DLibrary, CallingConvention = CallingConvention.Cdecl)]
6294+
public static extern void b2Joint_SetTorqueThreshold(b2JointId jointId, float threshold);
6295+
6296+
/// <summary>
6297+
/// Get the torque threshold for joint events (N-m)
6298+
/// </summary>
6299+
/// <returns>Original C type: float</returns>
6300+
/// <param name="jointId">(Original C type: b2JointId)</param>
6301+
[DllImport(Box2DLibrary, CallingConvention = CallingConvention.Cdecl)]
6302+
public static extern float b2Joint_GetTorqueThreshold(b2JointId jointId);
6303+
63106304
/// <summary>
63116305
/// Create a distance joint
63126306
/// @see b2DistanceJointDef for details

Box2dNet/box2d.dll

1 KB
Binary file not shown.

Box2dNet/box2dd.dll

2.5 KB
Binary file not shown.

README.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -196,6 +196,10 @@ Build the now updated Box2dNet solution and use the dll in your game, or directl
196196

197197
# History
198198

199+
## 2025/06/29: v3.1.8.2 for Box2D v3.1.1
200+
201+
* Regenerated for latest commits on Box2D
202+
199203
## 2025/06/22: v3.1.8 for Box2D v3.1.1
200204

201205
* Started with the Box2D samples app rewritten in .NET + MonoGame: contains 1 sample now

0 commit comments

Comments
 (0)