1- // Generated by Box2dNetGen for Box2D v3 on 11/01 /2026 07:32:50
1+ // Generated by Box2dNetGen for Box2D v3 on 25/03 /2026 10:57:19
22
33using System . Runtime . InteropServices ;
44using System . Numerics ;
@@ -383,6 +383,20 @@ public enum b2HexColor
383383 b2_colorBox2DGreen = 0x8CC924 ,
384384}
385385
386+ public enum b2ContactDrawType
387+ {
388+
389+ b2_drawContacts_None = 0 ,
390+
391+ b2_drawContacts_Clip = 1 ,
392+
393+ b2_drawContacts_AnchorA = 2 ,
394+
395+ b2_drawContacts_AnchorB = 3 ,
396+
397+ b2_drawContacts_Average = 4 ,
398+ }
399+
386400 /// <summary>
387401 /// Prototype for user allocation function
388402 /// </summary>
@@ -1658,21 +1672,26 @@ public partial struct b2ManifoldPoint
16581672{
16591673
16601674 /// <summary>
1661- /// Location of the contact point in world space. Subject to precision loss at large coordinates.
1662- /// @note Should only be used for debugging.
1675+ /// Location of the contact point in world space when first clipped. Subject to precision
1676+ /// loss at large coordinates. This point lags behind when contact recycling is used.
1677+ /// @note Should only be used for debugging. Use anchorA and/or anchorB for game logic.
16631678 /// </summary>
16641679 /// <returns>Original C type: b2Vec2</returns>
1665- public Vector2 point ;
1680+ public Vector2 clipPoint ;
16661681
16671682 /// <summary>
1668- /// Location of the contact point relative to shapeA's origin in world space
1683+ /// Location of the contact point relative to shapeA's origin in world space.
1684+ /// This can be converted to a world point using:
1685+ /// b2Vec2 worldPointA = b2Add(b2Body_GetCenter(myBodyIdA), anchorA);
16691686 /// @note When used internally to the Box2D solver, this is relative to the body center of mass.
16701687 /// </summary>
16711688 /// <returns>Original C type: b2Vec2</returns>
16721689 public Vector2 anchorA ;
16731690
16741691 /// <summary>
16751692 /// Location of the contact point relative to shapeB's origin in world space
1693+ /// This can be converted to a world point using:
1694+ /// b2Vec2 worldPointB = b2Add(b2Body_GetCenter(myBodyIdB), anchorB);
16761695 /// @note When used internally to the Box2D solver, this is relative to the body center of mass.
16771696 /// </summary>
16781697 /// <returns>Original C type: b2Vec2</returns>
@@ -1684,6 +1703,12 @@ public partial struct b2ManifoldPoint
16841703 /// <returns>Original C type: float</returns>
16851704 public float separation ;
16861705
1706+ /// <summary>
1707+ /// Cached separation used for contact recycling
1708+ /// </summary>
1709+ /// <returns>Original C type: float</returns>
1710+ public float baseSeparation ;
1711+
16871712 /// <summary>
16881713 /// The impulse along the manifold normal vector.
16891714 /// </summary>
@@ -1725,12 +1750,13 @@ public partial struct b2ManifoldPoint
17251750 [ MarshalAs ( UnmanagedType . U1 ) ]
17261751 public bool persisted ;
17271752
1728- public b2ManifoldPoint ( in Vector2 point , in Vector2 anchorA , in Vector2 anchorB , in float separation , in float normalImpulse , in float tangentImpulse , in float totalNormalImpulse , in float normalVelocity , in ushort id , in bool persisted )
1753+ public b2ManifoldPoint ( in Vector2 clipPoint , in Vector2 anchorA , in Vector2 anchorB , in float separation , in float baseSeparation , in float normalImpulse , in float tangentImpulse , in float totalNormalImpulse , in float normalVelocity , in ushort id , in bool persisted )
17291754 {
1730- this . point = point ;
1755+ this . clipPoint = clipPoint ;
17311756 this . anchorA = anchorA ;
17321757 this . anchorB = anchorB ;
17331758 this . separation = separation ;
1759+ this . baseSeparation = baseSeparation ;
17341760 this . normalImpulse = normalImpulse ;
17351761 this . tangentImpulse = tangentImpulse ;
17361762 this . totalNormalImpulse = totalNormalImpulse ;
@@ -2727,21 +2753,24 @@ public partial struct b2ShapeDef
27272753 public bool isSensor ;
27282754
27292755 /// <summary>
2730- /// Enable sensor events for this shape. This applies to sensors and non-sensors. False by default, even for sensors.
2756+ /// Enable sensor events for this shape. This applies to sensors and non-sensors. Both shapes involved must have this flag set to true.
2757+ /// False by default, even for sensors.
27312758 /// </summary>
27322759 /// <returns>Original C type: bool</returns>
27332760 [ MarshalAs ( UnmanagedType . U1 ) ]
27342761 public bool enableSensorEvents ;
27352762
27362763 /// <summary>
2737- /// Enable contact events for this shape. Only applies to kinematic and dynamic bodies. Ignored for sensors. False by default.
2764+ /// Enable contact events for this shape. Only applies to kinematic and dynamic bodies. Only one shape involved needs this flag set to true.
2765+ /// Ignored for sensors. False by default.
27382766 /// </summary>
27392767 /// <returns>Original C type: bool</returns>
27402768 [ MarshalAs ( UnmanagedType . U1 ) ]
27412769 public bool enableContactEvents ;
27422770
27432771 /// <summary>
2744- /// Enable hit events for this shape. Only applies to kinematic and dynamic bodies. Ignored for sensors. False by default.
2772+ /// Enable hit events for this shape. Only applies to kinematic and dynamic bodies. Only one shape involved needs this flag set to true.
2773+ /// Ignored for sensors. False by default.
27452774 /// </summary>
27462775 /// <returns>Original C type: bool</returns>
27472776 [ MarshalAs ( UnmanagedType . U1 ) ]
@@ -4166,6 +4195,21 @@ public static partial class B2Api
41664195 /// <returns>Original C type: int</returns>
41674196public const int B2_MAX_POLYGON_VERTICES = 8 ;
41684197
4198+ /// <returns>Original C type: int</returns>
4199+ public const int B2_MAX_WORKERS = 64 ;
4200+
4201+ /// <returns>Original C type: int</returns>
4202+ public const int B2_GRAPH_COLOR_COUNT = 24 ;
4203+
4204+ /// <returns>Original C type: int</returns>
4205+ public const int B2_MAX_WORLDS = 128 ;
4206+
4207+ /// <returns>Original C type: float</returns>
4208+ public const float B2_AABB_MARGIN_FRACTION = 0.125f ;
4209+
4210+ /// <returns>Original C type: float</returns>
4211+ public const float B2_TIME_TO_SLEEP = 0.5f ;
4212+
41694213 /// <summary>
41704214 /// https://en.wikipedia.org/wiki/Pi
41714215 /// </summary>
@@ -4764,6 +4808,24 @@ public static void b2World_SetPreSolveCallback(b2WorldId worldId, b2PreSolveFcn
47644808[ DllImport ( Box2DLibrary , CallingConvention = CallingConvention . Cdecl ) ]
47654809public static extern void b2World_SetContactTuning ( b2WorldId worldId , float hertz , float dampingRatio , float pushSpeed ) ;
47664810
4811+ /// <summary>
4812+ /// Set the contact point recycling distance. Setting this to zero disables contact point recycling.
4813+ /// Usually in meters.
4814+ /// </summary>
4815+ /// <returns>Original C type: void</returns>
4816+ /// <param name="worldId">(Original C type: b2WorldId)</param>
4817+ /// <param name="recycleDistance">(Original C type: float)</param>
4818+ [ DllImport ( Box2DLibrary , CallingConvention = CallingConvention . Cdecl ) ]
4819+ public static extern void b2World_SetContactRecycleDistance ( b2WorldId worldId , float recycleDistance ) ;
4820+
4821+ /// <summary>
4822+ /// Get the contact point recycling distance. Usually in meters.
4823+ /// </summary>
4824+ /// <returns>Original C type: float</returns>
4825+ /// <param name="worldId">(Original C type: b2WorldId)</param>
4826+ [ DllImport ( Box2DLibrary , CallingConvention = CallingConvention . Cdecl ) ]
4827+ public static extern float b2World_GetContactRecycleDistance ( b2WorldId worldId ) ;
4828+
47674829 /// <summary>
47684830 /// Set the maximum linear speed. Usually in m/s.
47694831 /// </summary>
@@ -6050,7 +6112,7 @@ public static void b2World_SetRestitutionCallback(b2WorldId worldId, b2Restituti
60506112 /// <summary>
60516113 /// Get the maximum capacity required for retrieving all the overlapped shapes on a sensor shape.
60526114 /// This returns 0 if the provided shape is not a sensor.
6053- /// @returns the required capacity to get all the overlaps in b2Shape_GetSensorOverlaps
6115+ /// @returns the required capacity to get all the overlaps in b2Shape_GetSensorData
60546116 /// </summary>
60556117 /// <returns>Original C type: int</returns>
60566118 /// <param name="shapeId">the id of a sensor shape
@@ -6061,7 +6123,7 @@ public static void b2World_SetRestitutionCallback(b2WorldId worldId, b2Restituti
60616123public static extern int b2Shape_GetSensorCapacity ( b2ShapeId shapeId ) ;
60626124
60636125 /// <summary>
6064- /// Get the overlap data for a sensor shape.
6126+ /// Get the overlap data for a sensor shape computed the previous world step .
60656127 /// @returns the number of elements filled in the provided array
60666128 /// @warning do not ignore the return value, it specifies the valid number of elements
60676129 /// @warning overlaps may contain destroyed shapes so use b2Shape_IsValid to confirm each overlap
0 commit comments