@@ -67,9 +67,6 @@ public static unsafe partial class B2
67
67
[ System . Runtime . InteropServices . DllImport ( BindgenInternal . DllImportPath , EntryPoint = "b2Body_EnableSleep" , CallingConvention = System . Runtime . InteropServices . CallingConvention . Cdecl ) ]
68
68
public static extern void BodyEnableSleep ( BodyId bodyId , byte enableSleep ) ;
69
69
70
- [ System . Runtime . InteropServices . DllImport ( BindgenInternal . DllImportPath , EntryPoint = "b2Body_GetAngle" , CallingConvention = System . Runtime . InteropServices . CallingConvention . Cdecl ) ]
71
- public static extern float BodyGetAngle ( BodyId bodyId ) ;
72
-
73
70
[ System . Runtime . InteropServices . DllImport ( BindgenInternal . DllImportPath , EntryPoint = "b2Body_GetAngularDamping" , CallingConvention = System . Runtime . InteropServices . CallingConvention . Cdecl ) ]
74
71
public static extern float BodyGetAngularDamping ( BodyId bodyId ) ;
75
72
@@ -203,7 +200,7 @@ public static unsafe partial class B2
203
200
public static extern void BodySetSleepThreshold ( BodyId bodyId , float sleepVelocity ) ;
204
201
205
202
[ System . Runtime . InteropServices . DllImport ( BindgenInternal . DllImportPath , EntryPoint = "b2Body_SetTransform" , CallingConvention = System . Runtime . InteropServices . CallingConvention . Cdecl ) ]
206
- public static extern void BodySetTransform ( BodyId bodyId , Vec2 position , float angle ) ;
203
+ public static extern void BodySetTransform ( BodyId bodyId , Vec2 position , Rot rotation ) ;
207
204
208
205
[ System . Runtime . InteropServices . DllImport ( BindgenInternal . DllImportPath , EntryPoint = "b2Body_SetType" , CallingConvention = System . Runtime . InteropServices . CallingConvention . Cdecl ) ]
209
206
public static extern void BodySetType ( BodyId bodyId , BodyType type ) ;
@@ -233,28 +230,28 @@ public static unsafe partial class B2
233
230
public static extern Manifold CollideCapsuleAndCircle ( Capsule * capsuleA , Transform xfA , Circle * circleB , Transform xfB ) ;
234
231
235
232
[ System . Runtime . InteropServices . DllImport ( BindgenInternal . DllImportPath , EntryPoint = "b2CollideCapsules" , CallingConvention = System . Runtime . InteropServices . CallingConvention . Cdecl ) ]
236
- public static extern Manifold CollideCapsules ( Capsule * capsuleA , Transform xfA , Capsule * capsuleB , Transform xfB , DistanceCache * cache ) ;
233
+ public static extern Manifold CollideCapsules ( Capsule * capsuleA , Transform xfA , Capsule * capsuleB , Transform xfB ) ;
237
234
238
235
[ System . Runtime . InteropServices . DllImport ( BindgenInternal . DllImportPath , EntryPoint = "b2CollideCircles" , CallingConvention = System . Runtime . InteropServices . CallingConvention . Cdecl ) ]
239
236
public static extern Manifold CollideCircles ( Circle * circleA , Transform xfA , Circle * circleB , Transform xfB ) ;
240
237
241
238
[ System . Runtime . InteropServices . DllImport ( BindgenInternal . DllImportPath , EntryPoint = "b2CollidePolygonAndCapsule" , CallingConvention = System . Runtime . InteropServices . CallingConvention . Cdecl ) ]
242
- public static extern Manifold CollidePolygonAndCapsule ( Polygon * polygonA , Transform xfA , Capsule * capsuleB , Transform xfB , DistanceCache * cache ) ;
239
+ public static extern Manifold CollidePolygonAndCapsule ( Polygon * polygonA , Transform xfA , Capsule * capsuleB , Transform xfB ) ;
243
240
244
241
[ System . Runtime . InteropServices . DllImport ( BindgenInternal . DllImportPath , EntryPoint = "b2CollidePolygonAndCircle" , CallingConvention = System . Runtime . InteropServices . CallingConvention . Cdecl ) ]
245
242
public static extern Manifold CollidePolygonAndCircle ( Polygon * polygonA , Transform xfA , Circle * circleB , Transform xfB ) ;
246
243
247
244
[ System . Runtime . InteropServices . DllImport ( BindgenInternal . DllImportPath , EntryPoint = "b2CollidePolygons" , CallingConvention = System . Runtime . InteropServices . CallingConvention . Cdecl ) ]
248
- public static extern Manifold CollidePolygons ( Polygon * polyA , Transform xfA , Polygon * polyB , Transform xfB , DistanceCache * cache ) ;
245
+ public static extern Manifold CollidePolygons ( Polygon * polygonA , Transform xfA , Polygon * polygonB , Transform xfB ) ;
249
246
250
247
[ System . Runtime . InteropServices . DllImport ( BindgenInternal . DllImportPath , EntryPoint = "b2CollideSegmentAndCapsule" , CallingConvention = System . Runtime . InteropServices . CallingConvention . Cdecl ) ]
251
- public static extern Manifold CollideSegmentAndCapsule ( Segment * segmentA , Transform xfA , Capsule * capsuleB , Transform xfB , DistanceCache * cache ) ;
248
+ public static extern Manifold CollideSegmentAndCapsule ( Segment * segmentA , Transform xfA , Capsule * capsuleB , Transform xfB ) ;
252
249
253
250
[ System . Runtime . InteropServices . DllImport ( BindgenInternal . DllImportPath , EntryPoint = "b2CollideSegmentAndCircle" , CallingConvention = System . Runtime . InteropServices . CallingConvention . Cdecl ) ]
254
251
public static extern Manifold CollideSegmentAndCircle ( Segment * segmentA , Transform xfA , Circle * circleB , Transform xfB ) ;
255
252
256
253
[ System . Runtime . InteropServices . DllImport ( BindgenInternal . DllImportPath , EntryPoint = "b2CollideSegmentAndPolygon" , CallingConvention = System . Runtime . InteropServices . CallingConvention . Cdecl ) ]
257
- public static extern Manifold CollideSegmentAndPolygon ( Segment * segmentA , Transform xfA , Polygon * polygonB , Transform xfB , DistanceCache * cache ) ;
254
+ public static extern Manifold CollideSegmentAndPolygon ( Segment * segmentA , Transform xfA , Polygon * polygonB , Transform xfB ) ;
258
255
259
256
[ System . Runtime . InteropServices . DllImport ( BindgenInternal . DllImportPath , EntryPoint = "b2CollideSmoothSegmentAndCapsule" , CallingConvention = System . Runtime . InteropServices . CallingConvention . Cdecl ) ]
260
257
public static extern Manifold CollideSmoothSegmentAndCapsule ( SmoothSegment * smoothSegmentA , Transform xfA , Capsule * capsuleB , Transform xfB , DistanceCache * cache ) ;
@@ -1058,7 +1055,7 @@ public static unsafe partial class B2
1058
1055
public static extern CastOutput ShapeCastSegment ( ShapeCastInput * input , Segment * shape ) ;
1059
1056
1060
1057
[ System . Runtime . InteropServices . DllImport ( BindgenInternal . DllImportPath , EntryPoint = "b2ShapeDistance" , CallingConvention = System . Runtime . InteropServices . CallingConvention . Cdecl ) ]
1061
- public static extern DistanceOutput ShapeDistance ( DistanceCache * cache , DistanceInput * input ) ;
1058
+ public static extern DistanceOutput ShapeDistance ( DistanceCache * cache , DistanceInput * input , Simplex * simplexes , int simplexCapacity ) ;
1062
1059
1063
1060
[ System . Runtime . InteropServices . DllImport ( BindgenInternal . DllImportPath , EntryPoint = "b2SleepMilliseconds" , CallingConvention = System . Runtime . InteropServices . CallingConvention . Cdecl ) ]
1064
1061
public static extern void SleepMilliseconds ( int milliseconds ) ;
@@ -1268,7 +1265,7 @@ public partial struct BodyDef
1268
1265
1269
1266
public Vec2 position ;
1270
1267
1271
- public float angle ;
1268
+ public Rot rotation ;
1272
1269
1273
1270
public Vec2 linearVelocity ;
1274
1271
@@ -1296,6 +1293,8 @@ public partial struct BodyDef
1296
1293
1297
1294
public byte automaticMass ;
1298
1295
1296
+ public byte allowFastRotation ;
1297
+
1299
1298
public int internalValue ;
1300
1299
}
1301
1300
@@ -1512,8 +1511,6 @@ public partial struct DebugDraw
1512
1511
1513
1512
public partial struct DistanceCache
1514
1513
{
1515
- public float metric ;
1516
-
1517
1514
public ushort count ;
1518
1515
1519
1516
public fixed byte indexA [ 3 ] ;
@@ -1580,6 +1577,8 @@ public partial struct DistanceOutput
1580
1577
public float distance ;
1581
1578
1582
1579
public int iterations ;
1580
+
1581
+ public int simplexCount ;
1583
1582
}
1584
1583
1585
1584
public partial struct DistanceProxy
@@ -1739,7 +1738,7 @@ public partial struct MassData
1739
1738
1740
1739
public Vec2 center ;
1741
1740
1742
- public float I ;
1741
+ public float rotationalInertia ;
1743
1742
}
1744
1743
1745
1744
public partial struct Mat22
@@ -2124,6 +2123,8 @@ public partial struct ShapeDef
2124
2123
2125
2124
public Filter filter ;
2126
2125
2126
+ public uint customColor ;
2127
+
2127
2128
public byte isSensor ;
2128
2129
2129
2130
public byte enableSensorEvents ;
@@ -2148,6 +2149,32 @@ public partial struct ShapeId
2148
2149
public ushort revision ;
2149
2150
}
2150
2151
2152
+ public partial struct Simplex
2153
+ {
2154
+ public SimplexVertex v1 ;
2155
+
2156
+ public SimplexVertex v2 ;
2157
+
2158
+ public SimplexVertex v3 ;
2159
+
2160
+ public int count ;
2161
+ }
2162
+
2163
+ public partial struct SimplexVertex
2164
+ {
2165
+ public Vec2 wA ;
2166
+
2167
+ public Vec2 wB ;
2168
+
2169
+ public Vec2 w ;
2170
+
2171
+ public float a ;
2172
+
2173
+ public int indexA ;
2174
+
2175
+ public int indexB ;
2176
+ }
2177
+
2151
2178
public partial struct SmoothSegment
2152
2179
{
2153
2180
public Vec2 ghost1 ;
@@ -2212,7 +2239,7 @@ public partial struct TreeNode
2212
2239
2213
2240
public uint categoryBits ;
2214
2241
2215
- public AnonymousRecord_collision_L586_C2 AnonymousRecord_collision_L586_C2_Field ;
2242
+ public AnonymousRecord_collision_L608_C2 AnonymousRecord_collision_L608_C2_Field ;
2216
2243
2217
2244
public int child1 ;
2218
2245
@@ -2226,12 +2253,12 @@ public partial struct TreeNode
2226
2253
2227
2254
public fixed byte pad [ 9 ] ;
2228
2255
2229
- public ref int parent => ref AnonymousRecord_collision_L586_C2_Field . parent ;
2256
+ public ref int parent => ref AnonymousRecord_collision_L608_C2_Field . parent ;
2230
2257
2231
- public ref int next => ref AnonymousRecord_collision_L586_C2_Field . next ;
2258
+ public ref int next => ref AnonymousRecord_collision_L608_C2_Field . next ;
2232
2259
2233
2260
[ System . Runtime . InteropServices . StructLayout ( System . Runtime . InteropServices . LayoutKind . Explicit ) ]
2234
- public partial struct AnonymousRecord_collision_L586_C2
2261
+ public partial struct AnonymousRecord_collision_L608_C2
2235
2262
{
2236
2263
[ System . Runtime . InteropServices . FieldOffset ( 0 ) ]
2237
2264
public int parent ;
@@ -2339,6 +2366,8 @@ public partial struct WorldDef
2339
2366
2340
2367
public float jointDampingRatio ;
2341
2368
2369
+ public float maximumLinearVelocity ;
2370
+
2342
2371
public byte enableSleep ;
2343
2372
2344
2373
public byte enableContinous ;
@@ -2524,7 +2553,11 @@ public enum HexColor : uint
2524
2553
colorWhite = 16777215 ,
2525
2554
colorWhiteSmoke = 16119285 ,
2526
2555
colorYellow = 16776960 ,
2527
- colorYellowGreen = 10145074
2556
+ colorYellowGreen = 10145074 ,
2557
+ colorBox2DRed = 14430514 ,
2558
+ colorBox2DBlue = 3190463 ,
2559
+ colorBox2DGreen = 9226532 ,
2560
+ colorBox2DYellow = 16772748
2528
2561
}
2529
2562
2530
2563
public enum JointType : uint
@@ -2873,6 +2906,14 @@ public enum TOIState : uint
2873
2906
2874
2907
public const HexColor colorYellowGreen = HexColor . colorYellowGreen ;
2875
2908
2909
+ public const HexColor colorBox2DRed = HexColor . colorBox2DRed ;
2910
+
2911
+ public const HexColor colorBox2DBlue = HexColor . colorBox2DBlue ;
2912
+
2913
+ public const HexColor colorBox2DGreen = HexColor . colorBox2DGreen ;
2914
+
2915
+ public const HexColor colorBox2DYellow = HexColor . colorBox2DYellow ;
2916
+
2876
2917
public const JointType distanceJoint = JointType . distanceJoint ;
2877
2918
2878
2919
public const JointType motorJoint = JointType . motorJoint ;
@@ -2919,19 +2960,20 @@ public enum TOIState : uint
2919
2960
2920
2961
public partial class BindgenInternal
2921
2962
{
2922
- public const string DllImportPath = "box2c " ;
2963
+ public const string DllImportPath = "box2d " ;
2923
2964
2924
2965
static BindgenInternal ( )
2925
2966
{
2926
2967
DllFilePaths = new System . Collections . Generic . List < string >
2927
2968
{
2928
- "box2c" ,
2929
- "runtimes/linux-x64/native/box2c" ,
2930
- "runtimes/linux-arm64/native/box2c" ,
2931
- "runtimes/osx-x64/native/box2c" ,
2932
- "runtimes/osx-arm64/native/box2c" ,
2933
- "runtimes/win-x64/native/box2c" ,
2934
- "runtimes/win-arm64/native/box2c"
2969
+ "box2d" ,
2970
+ "libbox2d" ,
2971
+ "runtimes/linux-x64/native/libbox2d" ,
2972
+ "runtimes/linux-arm64/native/libbox2d" ,
2973
+ "runtimes/osx-x64/native/libbox2d" ,
2974
+ "runtimes/osx-arm64/native/libbox2d" ,
2975
+ "runtimes/win-x64/native/box2d" ,
2976
+ "runtimes/win-arm64/native/box2d"
2935
2977
} ;
2936
2978
}
2937
2979
}
@@ -2983,8 +3025,8 @@ public partial class BindgenInternal
2983
3025
2984
3026
public static bool TryLoad ( string path , out System . IntPtr handle )
2985
3027
{
2986
- #if NET5_0_OR_GREATER
2987
- return System . Runtime . InteropServices . NativeLibrary . TryLoad ( path , out handle ) ;
3028
+ #if NETCOREAPP3_0_OR_GREATER
3029
+ return System . Runtime . InteropServices . NativeLibrary . TryLoad ( path , System . Reflection . Assembly . GetExecutingAssembly ( ) , null , out handle ) ;
2988
3030
#else
2989
3031
handle = System . IntPtr . Zero ;
2990
3032
if ( IsLinux )
@@ -2999,7 +3041,7 @@ public static bool TryLoad(string path, out System.IntPtr handle)
2999
3041
3000
3042
public static System . IntPtr GetExport ( string symbol )
3001
3043
{
3002
- #if NET5_0_OR_GREATER
3044
+ #if NETCOREAPP3_0_OR_GREATER
3003
3045
return System . Runtime . InteropServices . NativeLibrary . GetExport ( LibraryHandle , symbol ) ;
3004
3046
#else
3005
3047
if ( IsLinux )
@@ -3044,6 +3086,14 @@ public static System.IntPtr GetExport(string symbol)
3044
3086
3045
3087
public static void ResolveLibrary ( )
3046
3088
{
3089
+ System . IntPtr handle = default ;
3090
+ #if NETCOREAPP3_0_OR_GREATER
3091
+ foreach ( string dllFilePath in DllFilePaths )
3092
+ {
3093
+ if ( TryLoad ( dllFilePath , out handle ) )
3094
+ goto Return ;
3095
+ }
3096
+ #else
3047
3097
string fileExtension ;
3048
3098
if ( IsLinux )
3049
3099
fileExtension = ".so" ;
@@ -3053,12 +3103,12 @@ public static void ResolveLibrary()
3053
3103
fileExtension = ".dll" ;
3054
3104
else
3055
3105
throw new System . InvalidOperationException ( "Can't determine native library file extension for the current system." ) ;
3056
- System . IntPtr handle = default ;
3057
3106
foreach ( string dllFilePath in DllFilePaths )
3058
3107
{
3059
3108
string fileName = System . IO . Path . GetFileName ( dllFilePath ) ;
3060
3109
string parentDir = $ "{ dllFilePath } /..";
3061
- string searchDir = System . IO . Path . IsPathRooted ( dllFilePath ) ? System . IO . Path . GetFullPath ( parentDir ) + "/" : System . IO . Path . GetFullPath ( System . AppDomain . CurrentDomain . BaseDirectory + parentDir ) + "/" ;
3110
+ string exeDir = System . IO . Path . GetFullPath ( System . IO . Path . GetDirectoryName ( System . Reflection . Assembly . GetExecutingAssembly ( ) . Location ) ! ) ;
3111
+ string searchDir = System . IO . Path . IsPathRooted ( dllFilePath ) ? System . IO . Path . GetFullPath ( parentDir ) + "/" : System . IO . Path . GetFullPath ( $ "{ exeDir } /{ parentDir } ") + "/" ;
3062
3112
if ( TryLoad ( $ "{ searchDir } { fileName } ", out handle ) )
3063
3113
goto Return ;
3064
3114
if ( TryLoad ( $ "{ searchDir } { fileName } { fileExtension } ", out handle ) )
@@ -3076,6 +3126,7 @@ public static void ResolveLibrary()
3076
3126
goto Return ;
3077
3127
}
3078
3128
3129
+ #endif
3079
3130
#if NET7_0_OR_GREATER
3080
3131
handle = System . Runtime . InteropServices . NativeLibrary . GetMainProgramHandle ( ) ;
3081
3132
#else
0 commit comments