1pub const B2_HASH_INIT: u32 = 5381;
7pub const B2_PI: f64 = 3.14159265359;
8pub const B2_MAX_POLYGON_VERTICES: u32 = 8;
9pub const B2_DEFAULT_CATEGORY_BITS: u32 = 1;
10#[doc = " Prototype for user allocation function\n @param size the allocation size in bytes\n @param alignment the required alignment, guaranteed to be a power of 2"]
11pub type b2AllocFcn = ::std::option::Option<
12 unsafe extern "C" fn(
13 size: ::std::os::raw::c_uint,
14 alignment: ::std::os::raw::c_int,
15 ) -> *mut ::std::os::raw::c_void,
16>;
17#[doc = " Prototype for user free function\n @param mem the memory previously allocated through `b2AllocFcn`"]
18pub type b2FreeFcn = ::std::option::Option<unsafe extern "C" fn(mem: *mut ::std::os::raw::c_void)>;
19#[doc = " Prototype for the user assert callback. Return 0 to skip the debugger break."]
20pub type b2AssertFcn = ::std::option::Option<
21 unsafe extern "C" fn(
22 condition: *const ::std::os::raw::c_char,
23 fileName: *const ::std::os::raw::c_char,
24 lineNumber: ::std::os::raw::c_int,
25 ) -> ::std::os::raw::c_int,
26>;
27unsafe extern "C" {
28 #[doc = " This allows the user to override the allocation functions. These should be\n set during application startup."]
29 pub fn b2SetAllocator(allocFcn: b2AllocFcn, freeFcn: b2FreeFcn);
30}
31unsafe extern "C" {
32 #[doc = " @return the total bytes allocated by Box2D"]
33 pub fn b2GetByteCount() -> ::std::os::raw::c_int;
34}
35unsafe extern "C" {
36 #[doc = " Override the default assert callback\n @param assertFcn a non-null assert callback"]
37 pub fn b2SetAssertFcn(assertFcn: b2AssertFcn);
38}
39#[doc = " Version numbering scheme.\n See https://semver.org/"]
40#[repr(C)]
41#[derive(Debug, Copy, Clone)]
42pub struct b2Version {
43 #[doc = " Significant changes"]
44 pub major: ::std::os::raw::c_int,
45 #[doc = " Incremental changes"]
46 pub minor: ::std::os::raw::c_int,
47 #[doc = " Bug fixes"]
48 pub revision: ::std::os::raw::c_int,
49}
50unsafe extern "C" {
51 #[doc = " Get the current version of Box2D"]
52 pub fn b2GetVersion() -> b2Version;
53}
54unsafe extern "C" {
55 pub fn b2InternalAssertFcn(
56 condition: *const ::std::os::raw::c_char,
57 fileName: *const ::std::os::raw::c_char,
58 lineNumber: ::std::os::raw::c_int,
59 ) -> ::std::os::raw::c_int;
60}
61unsafe extern "C" {
62 #[doc = " Get the absolute number of system ticks. The value is platform specific."]
63 pub fn b2GetTicks() -> u64;
64}
65unsafe extern "C" {
66 #[doc = " Get the milliseconds passed from an initial tick value."]
67 pub fn b2GetMilliseconds(ticks: u64) -> f32;
68}
69unsafe extern "C" {
70 #[doc = " Get the milliseconds passed from an initial tick value. Resets the passed in\n value to the current tick value."]
71 pub fn b2GetMillisecondsAndReset(ticks: *mut u64) -> f32;
72}
73unsafe extern "C" {
74 #[doc = " Yield to be used in a busy loop."]
75 pub fn b2Yield();
76}
77unsafe extern "C" {
78 pub fn b2Hash(hash: u32, data: *const u8, count: ::std::os::raw::c_int) -> u32;
79}
80#[doc = " 2D vector\n This can be used to represent a point or free vector"]
81#[repr(C)]
82#[derive(Debug, Copy, Clone)]
83pub struct b2Vec2 {
84 #[doc = " coordinates"]
85 pub x: f32,
86 #[doc = " coordinates"]
87 pub y: f32,
88}
89#[doc = " Cosine and sine pair\n This uses a custom implementation designed for cross-platform determinism"]
90#[repr(C)]
91#[derive(Debug, Copy, Clone)]
92pub struct b2CosSin {
93 #[doc = " cosine and sine"]
94 pub cosine: f32,
95 pub sine: f32,
96}
97#[doc = " 2D rotation\n This is similar to using a complex number for rotation"]
98#[repr(C)]
99#[derive(Debug, Copy, Clone)]
100pub struct b2Rot {
101 #[doc = " cosine and sine"]
102 pub c: f32,
103 #[doc = " cosine and sine"]
104 pub s: f32,
105}
106#[doc = " A 2D rigid transform"]
107#[repr(C)]
108#[derive(Debug, Copy, Clone)]
109pub struct b2Transform {
110 pub p: b2Vec2,
111 pub q: b2Rot,
112}
113#[doc = " A 2-by-2 Matrix"]
114#[repr(C)]
115#[derive(Debug, Copy, Clone)]
116pub struct b2Mat22 {
117 #[doc = " columns"]
118 pub cx: b2Vec2,
119 #[doc = " columns"]
120 pub cy: b2Vec2,
121}
122#[doc = " Axis-aligned bounding box"]
123#[repr(C)]
124#[derive(Debug, Copy, Clone)]
125pub struct b2AABB {
126 pub lowerBound: b2Vec2,
127 pub upperBound: b2Vec2,
128}
129#[doc = " separation = dot(normal, point) - offset"]
130#[repr(C)]
131#[derive(Debug, Copy, Clone)]
132pub struct b2Plane {
133 pub normal: b2Vec2,
134 pub offset: f32,
135}
136unsafe extern "C" {
137 #[doc = " Is this a valid number? Not NaN or infinity."]
138 pub fn b2IsValidFloat(a: f32) -> bool;
139}
140unsafe extern "C" {
141 #[doc = " Is this a valid vector? Not NaN or infinity."]
142 pub fn b2IsValidVec2(v: b2Vec2) -> bool;
143}
144unsafe extern "C" {
145 #[doc = " Is this a valid rotation? Not NaN or infinity. Is normalized."]
146 pub fn b2IsValidRotation(q: b2Rot) -> bool;
147}
148unsafe extern "C" {
149 #[doc = " Is this a valid transform? Not NaN or infinity. Rotation is normalized."]
150 pub fn b2IsValidTransform(t: b2Transform) -> bool;
151}
152unsafe extern "C" {
153 #[doc = " Is this a valid bounding box? Not Nan or infinity. Upper bound greater than or equal to lower bound."]
154 pub fn b2IsValidAABB(aabb: b2AABB) -> bool;
155}
156unsafe extern "C" {
157 #[doc = " Is this a valid plane? Normal is a unit vector. Not Nan or infinity."]
158 pub fn b2IsValidPlane(a: b2Plane) -> bool;
159}
160unsafe extern "C" {
161 #[doc = " Compute an approximate arctangent in the range [-pi, pi]\n This is hand coded for cross-platform determinism. The atan2f\n function in the standard library is not cross-platform deterministic.\n\tAccurate to around 0.0023 degrees"]
162 pub fn b2Atan2(y: f32, x: f32) -> f32;
163}
164unsafe extern "C" {
165 #[doc = " Compute the cosine and sine of an angle in radians. Implemented\n for cross-platform determinism."]
166 pub fn b2ComputeCosSin(radians: f32) -> b2CosSin;
167}
168unsafe extern "C" {
169 #[doc = " Compute the rotation between two unit vectors"]
170 pub fn b2ComputeRotationBetweenUnitVectors(v1: b2Vec2, v2: b2Vec2) -> b2Rot;
171}
172unsafe extern "C" {
173 #[doc = " Box2D bases all length units on meters, but you may need different units for your game.\n You can set this value to use different units. This should be done at application startup\n and only modified once. Default value is 1.\n For example, if your game uses pixels for units you can use pixels for all length values\n sent to Box2D. There should be no extra cost. However, Box2D has some internal tolerances\n and thresholds that have been tuned for meters. By calling this function, Box2D is able\n to adjust those tolerances and thresholds to improve accuracy.\n A good rule of thumb is to pass the height of your player character to this function. So\n if your player character is 32 pixels high, then pass 32 to this function. Then you may\n confidently use pixels for all the length values sent to Box2D. All length values returned\n from Box2D will also be pixels because Box2D does not do any scaling internally.\n However, you are now on the hook for coming up with good values for gravity, density, and\n forces.\n @warning This must be modified before any calls to Box2D"]
174 pub fn b2SetLengthUnitsPerMeter(lengthUnits: f32);
175}
176unsafe extern "C" {
177 #[doc = " Get the current length units per meter."]
178 pub fn b2GetLengthUnitsPerMeter() -> f32;
179}
180#[doc = " Low level ray cast input data"]
181#[repr(C)]
182#[derive(Debug, Copy, Clone)]
183pub struct b2RayCastInput {
184 #[doc = " Start point of the ray cast"]
185 pub origin: b2Vec2,
186 #[doc = " Translation of the ray cast"]
187 pub translation: b2Vec2,
188 #[doc = " The maximum fraction of the translation to consider, typically 1"]
189 pub maxFraction: f32,
190}
191#[doc = " A distance proxy is used by the GJK algorithm. It encapsulates any shape.\n You can provide between 1 and B2_MAX_POLYGON_VERTICES and a radius."]
192#[repr(C)]
193#[derive(Debug, Copy, Clone)]
194pub struct b2ShapeProxy {
195 #[doc = " The point cloud"]
196 pub points: [b2Vec2; 8usize],
197 #[doc = " The number of points. Must be greater than 0."]
198 pub count: ::std::os::raw::c_int,
199 #[doc = " The external radius of the point cloud. May be zero."]
200 pub radius: f32,
201}
202#[doc = " Low level shape cast input in generic form. This allows casting an arbitrary point\n cloud wrap with a radius. For example, a circle is a single point with a non-zero radius.\n A capsule is two points with a non-zero radius. A box is four points with a zero radius."]
203#[repr(C)]
204#[derive(Debug, Copy, Clone)]
205pub struct b2ShapeCastInput {
206 #[doc = " A generic shape"]
207 pub proxy: b2ShapeProxy,
208 #[doc = " The translation of the shape cast"]
209 pub translation: b2Vec2,
210 #[doc = " The maximum fraction of the translation to consider, typically 1"]
211 pub maxFraction: f32,
212 #[doc = " Allow shape cast to encroach when initially touching. This only works if the radius is greater than zero."]
213 pub canEncroach: bool,
214}
215#[doc = " Low level ray cast or shape-cast output data. Returns a zero fraction and normal in the case of initial overlap."]
216#[repr(C)]
217#[derive(Debug, Copy, Clone)]
218pub struct b2CastOutput {
219 #[doc = " The surface normal at the hit point"]
220 pub normal: b2Vec2,
221 #[doc = " The surface hit point"]
222 pub point: b2Vec2,
223 #[doc = " The fraction of the input translation at collision"]
224 pub fraction: f32,
225 #[doc = " The number of iterations used"]
226 pub iterations: ::std::os::raw::c_int,
227 #[doc = " Did the cast hit?"]
228 pub hit: bool,
229}
230#[doc = " This holds the mass data computed for a shape."]
231#[repr(C)]
232#[derive(Debug, Copy, Clone)]
233pub struct b2MassData {
234 #[doc = " The mass of the shape, usually in kilograms."]
235 pub mass: f32,
236 #[doc = " The position of the shape's centroid relative to the shape's origin."]
237 pub center: b2Vec2,
238 #[doc = " The rotational inertia of the shape about the shape center."]
239 pub rotationalInertia: f32,
240}
241#[doc = " A solid circle"]
242#[repr(C)]
243#[derive(Debug, Copy, Clone)]
244pub struct b2Circle {
245 #[doc = " The local center"]
246 pub center: b2Vec2,
247 #[doc = " The radius"]
248 pub radius: f32,
249}
250#[doc = " A solid capsule can be viewed as two semicircles connected\n by a rectangle."]
251#[repr(C)]
252#[derive(Debug, Copy, Clone)]
253pub struct b2Capsule {
254 #[doc = " Local center of the first semicircle"]
255 pub center1: b2Vec2,
256 #[doc = " Local center of the second semicircle"]
257 pub center2: b2Vec2,
258 #[doc = " The radius of the semicircles"]
259 pub radius: f32,
260}
261#[doc = " A solid convex polygon. It is assumed that the interior of the polygon is to\n the left of each edge.\n Polygons have a maximum number of vertices equal to B2_MAX_POLYGON_VERTICES.\n In most cases you should not need many vertices for a convex polygon.\n @warning DO NOT fill this out manually, instead use a helper function like\n b2MakePolygon or b2MakeBox."]
262#[repr(C)]
263#[derive(Debug, Copy, Clone)]
264pub struct b2Polygon {
265 #[doc = " The polygon vertices"]
266 pub vertices: [b2Vec2; 8usize],
267 #[doc = " The outward normal vectors of the polygon sides"]
268 pub normals: [b2Vec2; 8usize],
269 #[doc = " The centroid of the polygon"]
270 pub centroid: b2Vec2,
271 #[doc = " The external radius for rounded polygons"]
272 pub radius: f32,
273 #[doc = " The number of polygon vertices"]
274 pub count: ::std::os::raw::c_int,
275}
276#[doc = " A line segment with two-sided collision."]
277#[repr(C)]
278#[derive(Debug, Copy, Clone)]
279pub struct b2Segment {
280 #[doc = " The first point"]
281 pub point1: b2Vec2,
282 #[doc = " The second point"]
283 pub point2: b2Vec2,
284}
285#[doc = " A line segment with one-sided collision. Only collides on the right side.\n Several of these are generated for a chain shape.\n ghost1 -> point1 -> point2 -> ghost2"]
286#[repr(C)]
287#[derive(Debug, Copy, Clone)]
288pub struct b2ChainSegment {
289 #[doc = " The tail ghost vertex"]
290 pub ghost1: b2Vec2,
291 #[doc = " The line segment"]
292 pub segment: b2Segment,
293 #[doc = " The head ghost vertex"]
294 pub ghost2: b2Vec2,
295 #[doc = " The owning chain shape index (internal usage only)"]
296 pub chainId: ::std::os::raw::c_int,
297}
298unsafe extern "C" {
299 #[doc = " Validate ray cast input data (NaN, etc)"]
300 pub fn b2IsValidRay(input: *const b2RayCastInput) -> bool;
301}
302unsafe extern "C" {
303 #[doc = " Make a convex polygon from a convex hull. This will assert if the hull is not valid.\n @warning Do not manually fill in the hull data, it must come directly from b2ComputeHull"]
304 pub fn b2MakePolygon(hull: *const b2Hull, radius: f32) -> b2Polygon;
305}
306unsafe extern "C" {
307 #[doc = " Make an offset convex polygon from a convex hull. This will assert if the hull is not valid.\n @warning Do not manually fill in the hull data, it must come directly from b2ComputeHull"]
308 pub fn b2MakeOffsetPolygon(hull: *const b2Hull, position: b2Vec2, rotation: b2Rot)
309 -> b2Polygon;
310}
311unsafe extern "C" {
312 #[doc = " Make an offset convex polygon from a convex hull. This will assert if the hull is not valid.\n @warning Do not manually fill in the hull data, it must come directly from b2ComputeHull"]
313 pub fn b2MakeOffsetRoundedPolygon(
314 hull: *const b2Hull,
315 position: b2Vec2,
316 rotation: b2Rot,
317 radius: f32,
318 ) -> b2Polygon;
319}
320unsafe extern "C" {
321 #[doc = " Make a square polygon, bypassing the need for a convex hull.\n @param halfWidth the half-width"]
322 pub fn b2MakeSquare(halfWidth: f32) -> b2Polygon;
323}
324unsafe extern "C" {
325 #[doc = " Make a box (rectangle) polygon, bypassing the need for a convex hull.\n @param halfWidth the half-width (x-axis)\n @param halfHeight the half-height (y-axis)"]
326 pub fn b2MakeBox(halfWidth: f32, halfHeight: f32) -> b2Polygon;
327}
328unsafe extern "C" {
329 #[doc = " Make a rounded box, bypassing the need for a convex hull.\n @param halfWidth the half-width (x-axis)\n @param halfHeight the half-height (y-axis)\n @param radius the radius of the rounded extension"]
330 pub fn b2MakeRoundedBox(halfWidth: f32, halfHeight: f32, radius: f32) -> b2Polygon;
331}
332unsafe extern "C" {
333 #[doc = " Make an offset box, bypassing the need for a convex hull.\n @param halfWidth the half-width (x-axis)\n @param halfHeight the half-height (y-axis)\n @param center the local center of the box\n @param rotation the local rotation of the box"]
334 pub fn b2MakeOffsetBox(
335 halfWidth: f32,
336 halfHeight: f32,
337 center: b2Vec2,
338 rotation: b2Rot,
339 ) -> b2Polygon;
340}
341unsafe extern "C" {
342 #[doc = " Make an offset rounded box, bypassing the need for a convex hull.\n @param halfWidth the half-width (x-axis)\n @param halfHeight the half-height (y-axis)\n @param center the local center of the box\n @param rotation the local rotation of the box\n @param radius the radius of the rounded extension"]
343 pub fn b2MakeOffsetRoundedBox(
344 halfWidth: f32,
345 halfHeight: f32,
346 center: b2Vec2,
347 rotation: b2Rot,
348 radius: f32,
349 ) -> b2Polygon;
350}
351unsafe extern "C" {
352 #[doc = " Transform a polygon. This is useful for transferring a shape from one body to another."]
353 pub fn b2TransformPolygon(transform: b2Transform, polygon: *const b2Polygon) -> b2Polygon;
354}
355unsafe extern "C" {
356 #[doc = " Compute mass properties of a circle"]
357 pub fn b2ComputeCircleMass(shape: *const b2Circle, density: f32) -> b2MassData;
358}
359unsafe extern "C" {
360 #[doc = " Compute mass properties of a capsule"]
361 pub fn b2ComputeCapsuleMass(shape: *const b2Capsule, density: f32) -> b2MassData;
362}
363unsafe extern "C" {
364 #[doc = " Compute mass properties of a polygon"]
365 pub fn b2ComputePolygonMass(shape: *const b2Polygon, density: f32) -> b2MassData;
366}
367unsafe extern "C" {
368 #[doc = " Compute the bounding box of a transformed circle"]
369 pub fn b2ComputeCircleAABB(shape: *const b2Circle, transform: b2Transform) -> b2AABB;
370}
371unsafe extern "C" {
372 #[doc = " Compute the bounding box of a transformed capsule"]
373 pub fn b2ComputeCapsuleAABB(shape: *const b2Capsule, transform: b2Transform) -> b2AABB;
374}
375unsafe extern "C" {
376 #[doc = " Compute the bounding box of a transformed polygon"]
377 pub fn b2ComputePolygonAABB(shape: *const b2Polygon, transform: b2Transform) -> b2AABB;
378}
379unsafe extern "C" {
380 #[doc = " Compute the bounding box of a transformed line segment"]
381 pub fn b2ComputeSegmentAABB(shape: *const b2Segment, transform: b2Transform) -> b2AABB;
382}
383unsafe extern "C" {
384 #[doc = " Test a point for overlap with a circle in local space"]
385 pub fn b2PointInCircle(shape: *const b2Circle, point: b2Vec2) -> bool;
386}
387unsafe extern "C" {
388 #[doc = " Test a point for overlap with a capsule in local space"]
389 pub fn b2PointInCapsule(shape: *const b2Capsule, point: b2Vec2) -> bool;
390}
391unsafe extern "C" {
392 #[doc = " Test a point for overlap with a convex polygon in local space"]
393 pub fn b2PointInPolygon(shape: *const b2Polygon, point: b2Vec2) -> bool;
394}
395unsafe extern "C" {
396 #[doc = " Ray cast versus circle shape in local space."]
397 pub fn b2RayCastCircle(shape: *const b2Circle, input: *const b2RayCastInput) -> b2CastOutput;
398}
399unsafe extern "C" {
400 #[doc = " Ray cast versus capsule shape in local space."]
401 pub fn b2RayCastCapsule(shape: *const b2Capsule, input: *const b2RayCastInput) -> b2CastOutput;
402}
403unsafe extern "C" {
404 #[doc = " Ray cast versus segment shape in local space. Optionally treat the segment as one-sided with hits from\n the left side being treated as a miss."]
405 pub fn b2RayCastSegment(
406 shape: *const b2Segment,
407 input: *const b2RayCastInput,
408 oneSided: bool,
409 ) -> b2CastOutput;
410}
411unsafe extern "C" {
412 #[doc = " Ray cast versus polygon shape in local space."]
413 pub fn b2RayCastPolygon(shape: *const b2Polygon, input: *const b2RayCastInput) -> b2CastOutput;
414}
415unsafe extern "C" {
416 #[doc = " Shape cast versus a circle."]
417 pub fn b2ShapeCastCircle(
418 shape: *const b2Circle,
419 input: *const b2ShapeCastInput,
420 ) -> b2CastOutput;
421}
422unsafe extern "C" {
423 #[doc = " Shape cast versus a capsule."]
424 pub fn b2ShapeCastCapsule(
425 shape: *const b2Capsule,
426 input: *const b2ShapeCastInput,
427 ) -> b2CastOutput;
428}
429unsafe extern "C" {
430 #[doc = " Shape cast versus a line segment."]
431 pub fn b2ShapeCastSegment(
432 shape: *const b2Segment,
433 input: *const b2ShapeCastInput,
434 ) -> b2CastOutput;
435}
436unsafe extern "C" {
437 #[doc = " Shape cast versus a convex polygon."]
438 pub fn b2ShapeCastPolygon(
439 shape: *const b2Polygon,
440 input: *const b2ShapeCastInput,
441 ) -> b2CastOutput;
442}
443#[doc = " A convex hull. Used to create convex polygons.\n @warning Do not modify these values directly, instead use b2ComputeHull()"]
444#[repr(C)]
445#[derive(Debug, Copy, Clone)]
446pub struct b2Hull {
447 #[doc = " The final points of the hull"]
448 pub points: [b2Vec2; 8usize],
449 #[doc = " The number of points"]
450 pub count: ::std::os::raw::c_int,
451}
452unsafe extern "C" {
453 #[doc = " Compute the convex hull of a set of points. Returns an empty hull if it fails.\n Some failure cases:\n - all points very close together\n - all points on a line\n - less than 3 points\n - more than B2_MAX_POLYGON_VERTICES points\n This welds close points and removes collinear points.\n @warning Do not modify a hull once it has been computed"]
454 pub fn b2ComputeHull(points: *const b2Vec2, count: ::std::os::raw::c_int) -> b2Hull;
455}
456unsafe extern "C" {
457 #[doc = " This determines if a hull is valid. Checks for:\n - convexity\n - collinear points\n This is expensive and should not be called at runtime."]
458 pub fn b2ValidateHull(hull: *const b2Hull) -> bool;
459}
460#[doc = " Result of computing the distance between two line segments"]
461#[repr(C)]
462#[derive(Debug, Copy, Clone)]
463pub struct b2SegmentDistanceResult {
464 #[doc = " The closest point on the first segment"]
465 pub closest1: b2Vec2,
466 #[doc = " The closest point on the second segment"]
467 pub closest2: b2Vec2,
468 #[doc = " The barycentric coordinate on the first segment"]
469 pub fraction1: f32,
470 #[doc = " The barycentric coordinate on the second segment"]
471 pub fraction2: f32,
472 #[doc = " The squared distance between the closest points"]
473 pub distanceSquared: f32,
474}
475unsafe extern "C" {
476 #[doc = " Compute the distance between two line segments, clamping at the end points if needed."]
477 pub fn b2SegmentDistance(
478 p1: b2Vec2,
479 q1: b2Vec2,
480 p2: b2Vec2,
481 q2: b2Vec2,
482 ) -> b2SegmentDistanceResult;
483}
484#[doc = " Used to warm start the GJK simplex. If you call this function multiple times with nearby\n transforms this might improve performance. Otherwise you can zero initialize this.\n The distance cache must be initialized to zero on the first call.\n Users should generally just zero initialize this structure for each call."]
485#[repr(C)]
486#[derive(Debug, Copy, Clone)]
487pub struct b2SimplexCache {
488 #[doc = " The number of stored simplex points"]
489 pub count: u16,
490 #[doc = " The cached simplex indices on shape A"]
491 pub indexA: [u8; 3usize],
492 #[doc = " The cached simplex indices on shape B"]
493 pub indexB: [u8; 3usize],
494}
495#[doc = " Input for b2ShapeDistance"]
496#[repr(C)]
497#[derive(Debug, Copy, Clone)]
498pub struct b2DistanceInput {
499 #[doc = " The proxy for shape A"]
500 pub proxyA: b2ShapeProxy,
501 #[doc = " The proxy for shape B"]
502 pub proxyB: b2ShapeProxy,
503 #[doc = " The world transform for shape A"]
504 pub transformA: b2Transform,
505 #[doc = " The world transform for shape B"]
506 pub transformB: b2Transform,
507 #[doc = " Should the proxy radius be considered?"]
508 pub useRadii: bool,
509}
510#[doc = " Output for b2ShapeDistance"]
511#[repr(C)]
512#[derive(Debug, Copy, Clone)]
513pub struct b2DistanceOutput {
514 #[doc = "< Closest point on shapeA"]
515 pub pointA: b2Vec2,
516 #[doc = "< Closest point on shapeB"]
517 pub pointB: b2Vec2,
518 #[doc = "< Normal vector that points from A to B. Invalid if distance is zero."]
519 pub normal: b2Vec2,
520 #[doc = "< The final distance, zero if overlapped"]
521 pub distance: f32,
522 #[doc = "< Number of GJK iterations used"]
523 pub iterations: ::std::os::raw::c_int,
524 #[doc = "< The number of simplexes stored in the simplex array"]
525 pub simplexCount: ::std::os::raw::c_int,
526}
527#[doc = " Simplex vertex for debugging the GJK algorithm"]
528#[repr(C)]
529#[derive(Debug, Copy, Clone)]
530pub struct b2SimplexVertex {
531 #[doc = "< support point in proxyA"]
532 pub wA: b2Vec2,
533 #[doc = "< support point in proxyB"]
534 pub wB: b2Vec2,
535 #[doc = "< wB - wA"]
536 pub w: b2Vec2,
537 #[doc = "< barycentric coordinate for closest point"]
538 pub a: f32,
539 #[doc = "< wA index"]
540 pub indexA: ::std::os::raw::c_int,
541 #[doc = "< wB index"]
542 pub indexB: ::std::os::raw::c_int,
543}
544#[doc = " Simplex from the GJK algorithm"]
545#[repr(C)]
546#[derive(Debug, Copy, Clone)]
547pub struct b2Simplex {
548 #[doc = "< vertices"]
549 pub v1: b2SimplexVertex,
550 #[doc = "< vertices"]
551 pub v2: b2SimplexVertex,
552 #[doc = "< vertices"]
553 pub v3: b2SimplexVertex,
554 #[doc = "< number of valid vertices"]
555 pub count: ::std::os::raw::c_int,
556}
557unsafe extern "C" {
558 #[doc = " Compute the closest points between two shapes represented as point clouds.\n b2SimplexCache cache is input/output. On the first call set b2SimplexCache.count to zero.\n The underlying GJK algorithm may be debugged by passing in debug simplexes and capacity. You may pass in NULL and 0 for these."]
559 pub fn b2ShapeDistance(
560 input: *const b2DistanceInput,
561 cache: *mut b2SimplexCache,
562 simplexes: *mut b2Simplex,
563 simplexCapacity: ::std::os::raw::c_int,
564 ) -> b2DistanceOutput;
565}
566#[doc = " Input parameters for b2ShapeCast"]
567#[repr(C)]
568#[derive(Debug, Copy, Clone)]
569pub struct b2ShapeCastPairInput {
570 #[doc = "< The proxy for shape A"]
571 pub proxyA: b2ShapeProxy,
572 #[doc = "< The proxy for shape B"]
573 pub proxyB: b2ShapeProxy,
574 #[doc = "< The world transform for shape A"]
575 pub transformA: b2Transform,
576 #[doc = "< The world transform for shape B"]
577 pub transformB: b2Transform,
578 #[doc = "< The translation of shape B"]
579 pub translationB: b2Vec2,
580 #[doc = "< The fraction of the translation to consider, typically 1"]
581 pub maxFraction: f32,
582 #[doc = "< Allows shapes with a radius to move slightly closer if already touching"]
583 pub canEncroach: bool,
584}
585unsafe extern "C" {
586 #[doc = " Perform a linear shape cast of shape B moving and shape A fixed. Determines the hit point, normal, and translation fraction.\n Initially touching shapes are treated as a miss."]
587 pub fn b2ShapeCast(input: *const b2ShapeCastPairInput) -> b2CastOutput;
588}
589unsafe extern "C" {
590 #[doc = " Make a proxy for use in overlap, shape cast, and related functions. This is a deep copy of the points."]
591 pub fn b2MakeProxy(
592 points: *const b2Vec2,
593 count: ::std::os::raw::c_int,
594 radius: f32,
595 ) -> b2ShapeProxy;
596}
597unsafe extern "C" {
598 #[doc = " Make a proxy with a transform. This is a deep copy of the points."]
599 pub fn b2MakeOffsetProxy(
600 points: *const b2Vec2,
601 count: ::std::os::raw::c_int,
602 radius: f32,
603 position: b2Vec2,
604 rotation: b2Rot,
605 ) -> b2ShapeProxy;
606}
607#[doc = " This describes the motion of a body/shape for TOI computation. Shapes are defined with respect to the body origin,\n which may not coincide with the center of mass. However, to support dynamics we must interpolate the center of mass\n position."]
608#[repr(C)]
609#[derive(Debug, Copy, Clone)]
610pub struct b2Sweep {
611 #[doc = "< Local center of mass position"]
612 pub localCenter: b2Vec2,
613 #[doc = "< Starting center of mass world position"]
614 pub c1: b2Vec2,
615 #[doc = "< Ending center of mass world position"]
616 pub c2: b2Vec2,
617 #[doc = "< Starting world rotation"]
618 pub q1: b2Rot,
619 #[doc = "< Ending world rotation"]
620 pub q2: b2Rot,
621}
622unsafe extern "C" {
623 #[doc = " Evaluate the transform sweep at a specific time."]
624 pub fn b2GetSweepTransform(sweep: *const b2Sweep, time: f32) -> b2Transform;
625}
626#[doc = " Time of impact input"]
627#[repr(C)]
628#[derive(Debug, Copy, Clone)]
629pub struct b2TOIInput {
630 #[doc = "< The proxy for shape A"]
631 pub proxyA: b2ShapeProxy,
632 #[doc = "< The proxy for shape B"]
633 pub proxyB: b2ShapeProxy,
634 #[doc = "< The movement of shape A"]
635 pub sweepA: b2Sweep,
636 #[doc = "< The movement of shape B"]
637 pub sweepB: b2Sweep,
638 #[doc = "< Defines the sweep interval [0, maxFraction]"]
639 pub maxFraction: f32,
640}
641pub const b2TOIState_b2_toiStateUnknown: b2TOIState = 0;
642pub const b2TOIState_b2_toiStateFailed: b2TOIState = 1;
643pub const b2TOIState_b2_toiStateOverlapped: b2TOIState = 2;
644pub const b2TOIState_b2_toiStateHit: b2TOIState = 3;
645pub const b2TOIState_b2_toiStateSeparated: b2TOIState = 4;
646#[doc = " Describes the TOI output"]
647pub type b2TOIState = ::std::os::raw::c_int;
648#[doc = " Time of impact output"]
649#[repr(C)]
650#[derive(Debug, Copy, Clone)]
651pub struct b2TOIOutput {
652 #[doc = " The type of result"]
653 pub state: b2TOIState,
654 #[doc = " The hit point"]
655 pub point: b2Vec2,
656 #[doc = " The hit normal"]
657 pub normal: b2Vec2,
658 #[doc = " The sweep time of the collision"]
659 pub fraction: f32,
660}
661unsafe extern "C" {
662 #[doc = " Compute the upper bound on time before two shapes penetrate. Time is represented as\n a fraction between [0,tMax]. This uses a swept separating axis and may miss some intermediate,\n non-tunneling collisions. If you change the time interval, you should call this function\n again."]
663 pub fn b2TimeOfImpact(input: *const b2TOIInput) -> b2TOIOutput;
664}
665#[doc = " A manifold point is a contact point belonging to a contact manifold.\n It holds details related to the geometry and dynamics of the contact points.\n Box2D uses speculative collision so some contact points may be separated.\n You may use the totalNormalImpulse to determine if there was an interaction during\n the time step."]
666#[repr(C)]
667#[derive(Debug, Copy, Clone)]
668pub struct b2ManifoldPoint {
669 #[doc = " Location of the contact point in world space. Subject to precision loss at large coordinates.\n @note Should only be used for debugging."]
670 pub point: b2Vec2,
671 #[doc = " Location of the contact point relative to shapeA's origin in world space\n @note When used internally to the Box2D solver, this is relative to the body center of mass."]
672 pub anchorA: b2Vec2,
673 #[doc = " Location of the contact point relative to shapeB's origin in world space\n @note When used internally to the Box2D solver, this is relative to the body center of mass."]
674 pub anchorB: b2Vec2,
675 #[doc = " The separation of the contact point, negative if penetrating"]
676 pub separation: f32,
677 #[doc = " The impulse along the manifold normal vector."]
678 pub normalImpulse: f32,
679 #[doc = " The friction impulse"]
680 pub tangentImpulse: f32,
681 #[doc = " The total normal impulse applied across sub-stepping and restitution. This is important\n to identify speculative contact points that had an interaction in the time step."]
682 pub totalNormalImpulse: f32,
683 #[doc = " Relative normal velocity pre-solve. Used for hit events. If the normal impulse is\n zero then there was no hit. Negative means shapes are approaching."]
684 pub normalVelocity: f32,
685 #[doc = " Uniquely identifies a contact point between two shapes"]
686 pub id: u16,
687 #[doc = " Did this contact point exist the previous step?"]
688 pub persisted: bool,
689}
690#[doc = " A contact manifold describes the contact points between colliding shapes.\n @note Box2D uses speculative collision so some contact points may be separated."]
691#[repr(C)]
692#[derive(Debug, Copy, Clone)]
693pub struct b2Manifold {
694 #[doc = " The unit normal vector in world space, points from shape A to bodyB"]
695 pub normal: b2Vec2,
696 #[doc = " Angular impulse applied for rolling resistance. N * m * s = kg * m^2 / s"]
697 pub rollingImpulse: f32,
698 #[doc = " The manifold points, up to two are possible in 2D"]
699 pub points: [b2ManifoldPoint; 2usize],
700 #[doc = " The number of contacts points, will be 0, 1, or 2"]
701 pub pointCount: ::std::os::raw::c_int,
702}
703unsafe extern "C" {
704 #[doc = " Compute the contact manifold between two circles"]
705 pub fn b2CollideCircles(
706 circleA: *const b2Circle,
707 xfA: b2Transform,
708 circleB: *const b2Circle,
709 xfB: b2Transform,
710 ) -> b2Manifold;
711}
712unsafe extern "C" {
713 #[doc = " Compute the contact manifold between a capsule and circle"]
714 pub fn b2CollideCapsuleAndCircle(
715 capsuleA: *const b2Capsule,
716 xfA: b2Transform,
717 circleB: *const b2Circle,
718 xfB: b2Transform,
719 ) -> b2Manifold;
720}
721unsafe extern "C" {
722 #[doc = " Compute the contact manifold between an segment and a circle"]
723 pub fn b2CollideSegmentAndCircle(
724 segmentA: *const b2Segment,
725 xfA: b2Transform,
726 circleB: *const b2Circle,
727 xfB: b2Transform,
728 ) -> b2Manifold;
729}
730unsafe extern "C" {
731 #[doc = " Compute the contact manifold between a polygon and a circle"]
732 pub fn b2CollidePolygonAndCircle(
733 polygonA: *const b2Polygon,
734 xfA: b2Transform,
735 circleB: *const b2Circle,
736 xfB: b2Transform,
737 ) -> b2Manifold;
738}
739unsafe extern "C" {
740 #[doc = " Compute the contact manifold between a capsule and circle"]
741 pub fn b2CollideCapsules(
742 capsuleA: *const b2Capsule,
743 xfA: b2Transform,
744 capsuleB: *const b2Capsule,
745 xfB: b2Transform,
746 ) -> b2Manifold;
747}
748unsafe extern "C" {
749 #[doc = " Compute the contact manifold between an segment and a capsule"]
750 pub fn b2CollideSegmentAndCapsule(
751 segmentA: *const b2Segment,
752 xfA: b2Transform,
753 capsuleB: *const b2Capsule,
754 xfB: b2Transform,
755 ) -> b2Manifold;
756}
757unsafe extern "C" {
758 #[doc = " Compute the contact manifold between a polygon and capsule"]
759 pub fn b2CollidePolygonAndCapsule(
760 polygonA: *const b2Polygon,
761 xfA: b2Transform,
762 capsuleB: *const b2Capsule,
763 xfB: b2Transform,
764 ) -> b2Manifold;
765}
766unsafe extern "C" {
767 #[doc = " Compute the contact manifold between two polygons"]
768 pub fn b2CollidePolygons(
769 polygonA: *const b2Polygon,
770 xfA: b2Transform,
771 polygonB: *const b2Polygon,
772 xfB: b2Transform,
773 ) -> b2Manifold;
774}
775unsafe extern "C" {
776 #[doc = " Compute the contact manifold between an segment and a polygon"]
777 pub fn b2CollideSegmentAndPolygon(
778 segmentA: *const b2Segment,
779 xfA: b2Transform,
780 polygonB: *const b2Polygon,
781 xfB: b2Transform,
782 ) -> b2Manifold;
783}
784unsafe extern "C" {
785 #[doc = " Compute the contact manifold between a chain segment and a circle"]
786 pub fn b2CollideChainSegmentAndCircle(
787 segmentA: *const b2ChainSegment,
788 xfA: b2Transform,
789 circleB: *const b2Circle,
790 xfB: b2Transform,
791 ) -> b2Manifold;
792}
793unsafe extern "C" {
794 #[doc = " Compute the contact manifold between a chain segment and a capsule"]
795 pub fn b2CollideChainSegmentAndCapsule(
796 segmentA: *const b2ChainSegment,
797 xfA: b2Transform,
798 capsuleB: *const b2Capsule,
799 xfB: b2Transform,
800 cache: *mut b2SimplexCache,
801 ) -> b2Manifold;
802}
803unsafe extern "C" {
804 #[doc = " Compute the contact manifold between a chain segment and a rounded polygon"]
805 pub fn b2CollideChainSegmentAndPolygon(
806 segmentA: *const b2ChainSegment,
807 xfA: b2Transform,
808 polygonB: *const b2Polygon,
809 xfB: b2Transform,
810 cache: *mut b2SimplexCache,
811 ) -> b2Manifold;
812}
813#[doc = " The dynamic tree structure. This should be considered private data.\n It is placed here for performance reasons."]
814#[repr(C)]
815#[derive(Debug, Copy, Clone)]
816pub struct b2DynamicTree {
817 #[doc = " The tree nodes"]
818 pub nodes: *mut b2TreeNode,
819 #[doc = " The root index"]
820 pub root: ::std::os::raw::c_int,
821 #[doc = " The number of nodes"]
822 pub nodeCount: ::std::os::raw::c_int,
823 #[doc = " The allocated node space"]
824 pub nodeCapacity: ::std::os::raw::c_int,
825 #[doc = " Node free list"]
826 pub freeList: ::std::os::raw::c_int,
827 #[doc = " Number of proxies created"]
828 pub proxyCount: ::std::os::raw::c_int,
829 #[doc = " Leaf indices for rebuild"]
830 pub leafIndices: *mut ::std::os::raw::c_int,
831 #[doc = " Leaf bounding boxes for rebuild"]
832 pub leafBoxes: *mut b2AABB,
833 #[doc = " Leaf bounding box centers for rebuild"]
834 pub leafCenters: *mut b2Vec2,
835 #[doc = " Bins for sorting during rebuild"]
836 pub binIndices: *mut ::std::os::raw::c_int,
837 #[doc = " Allocated space for rebuilding"]
838 pub rebuildCapacity: ::std::os::raw::c_int,
839}
840#[doc = " These are performance results returned by dynamic tree queries."]
841#[repr(C)]
842#[derive(Debug, Copy, Clone)]
843pub struct b2TreeStats {
844 #[doc = " Number of internal nodes visited during the query"]
845 pub nodeVisits: ::std::os::raw::c_int,
846 #[doc = " Number of leaf nodes visited during the query"]
847 pub leafVisits: ::std::os::raw::c_int,
848}
849unsafe extern "C" {
850 #[doc = " Constructing the tree initializes the node pool."]
851 pub fn b2DynamicTree_Create() -> b2DynamicTree;
852}
853unsafe extern "C" {
854 #[doc = " Destroy the tree, freeing the node pool."]
855 pub fn b2DynamicTree_Destroy(tree: *mut b2DynamicTree);
856}
857unsafe extern "C" {
858 #[doc = " Create a proxy. Provide an AABB and a userData value."]
859 pub fn b2DynamicTree_CreateProxy(
860 tree: *mut b2DynamicTree,
861 aabb: b2AABB,
862 categoryBits: u64,
863 userData: u64,
864 ) -> ::std::os::raw::c_int;
865}
866unsafe extern "C" {
867 #[doc = " Destroy a proxy. This asserts if the id is invalid."]
868 pub fn b2DynamicTree_DestroyProxy(tree: *mut b2DynamicTree, proxyId: ::std::os::raw::c_int);
869}
870unsafe extern "C" {
871 #[doc = " Move a proxy to a new AABB by removing and reinserting into the tree."]
872 pub fn b2DynamicTree_MoveProxy(
873 tree: *mut b2DynamicTree,
874 proxyId: ::std::os::raw::c_int,
875 aabb: b2AABB,
876 );
877}
878unsafe extern "C" {
879 #[doc = " Enlarge a proxy and enlarge ancestors as necessary."]
880 pub fn b2DynamicTree_EnlargeProxy(
881 tree: *mut b2DynamicTree,
882 proxyId: ::std::os::raw::c_int,
883 aabb: b2AABB,
884 );
885}
886unsafe extern "C" {
887 #[doc = " Modify the category bits on a proxy. This is an expensive operation."]
888 pub fn b2DynamicTree_SetCategoryBits(
889 tree: *mut b2DynamicTree,
890 proxyId: ::std::os::raw::c_int,
891 categoryBits: u64,
892 );
893}
894unsafe extern "C" {
895 #[doc = " Get the category bits on a proxy."]
896 pub fn b2DynamicTree_GetCategoryBits(
897 tree: *mut b2DynamicTree,
898 proxyId: ::std::os::raw::c_int,
899 ) -> u64;
900}
901#[doc = " This function receives proxies found in the AABB query.\n @return true if the query should continue"]
902pub type b2TreeQueryCallbackFcn = ::std::option::Option<
903 unsafe extern "C" fn(
904 proxyId: ::std::os::raw::c_int,
905 userData: u64,
906 context: *mut ::std::os::raw::c_void,
907 ) -> bool,
908>;
909unsafe extern "C" {
910 #[doc = " Query an AABB for overlapping proxies. The callback class is called for each proxy that overlaps the supplied AABB.\n\t@return performance data"]
911 pub fn b2DynamicTree_Query(
912 tree: *const b2DynamicTree,
913 aabb: b2AABB,
914 maskBits: u64,
915 callback: b2TreeQueryCallbackFcn,
916 context: *mut ::std::os::raw::c_void,
917 ) -> b2TreeStats;
918}
919unsafe extern "C" {
920 #[doc = " Query an AABB for overlapping proxies. The callback class is called for each proxy that overlaps the supplied AABB.\n No filtering is performed.\n\t@return performance data"]
921 pub fn b2DynamicTree_QueryAll(
922 tree: *const b2DynamicTree,
923 aabb: b2AABB,
924 callback: b2TreeQueryCallbackFcn,
925 context: *mut ::std::os::raw::c_void,
926 ) -> b2TreeStats;
927}
928#[doc = " This function receives clipped ray cast input for a proxy. The function\n returns the new ray fraction.\n - return a value of 0 to terminate the ray cast\n - return a value less than input->maxFraction to clip the ray\n - return a value of input->maxFraction to continue the ray cast without clipping"]
929pub type b2TreeRayCastCallbackFcn = ::std::option::Option<
930 unsafe extern "C" fn(
931 input: *const b2RayCastInput,
932 proxyId: ::std::os::raw::c_int,
933 userData: u64,
934 context: *mut ::std::os::raw::c_void,
935 ) -> f32,
936>;
937unsafe extern "C" {
938 #[doc = " Ray cast against the proxies in the tree. This relies on the callback\n to perform a exact ray cast in the case were the proxy contains a shape.\n The callback also performs the any collision filtering. This has performance\n roughly equal to k * log(n), where k is the number of collisions and n is the\n number of proxies in the tree.\n Bit-wise filtering using mask bits can greatly improve performance in some scenarios.\n\tHowever, this filtering may be approximate, so the user should still apply filtering to results.\n @param tree the dynamic tree to ray cast\n @param input the ray cast input data. The ray extends from p1 to p1 + maxFraction * (p2 - p1)\n @param maskBits mask bit hint: `bool accept = (maskBits & node->categoryBits) != 0;`\n @param callback a callback class that is called for each proxy that is hit by the ray\n @param context user context that is passed to the callback\n\t@return performance data"]
939 pub fn b2DynamicTree_RayCast(
940 tree: *const b2DynamicTree,
941 input: *const b2RayCastInput,
942 maskBits: u64,
943 callback: b2TreeRayCastCallbackFcn,
944 context: *mut ::std::os::raw::c_void,
945 ) -> b2TreeStats;
946}
947#[doc = " This function receives clipped ray cast input for a proxy. The function\n returns the new ray fraction.\n - return a value of 0 to terminate the ray cast\n - return a value less than input->maxFraction to clip the ray\n - return a value of input->maxFraction to continue the ray cast without clipping"]
948pub type b2TreeShapeCastCallbackFcn = ::std::option::Option<
949 unsafe extern "C" fn(
950 input: *const b2ShapeCastInput,
951 proxyId: ::std::os::raw::c_int,
952 userData: u64,
953 context: *mut ::std::os::raw::c_void,
954 ) -> f32,
955>;
956unsafe extern "C" {
957 #[doc = " Ray cast against the proxies in the tree. This relies on the callback\n to perform a exact ray cast in the case were the proxy contains a shape.\n The callback also performs the any collision filtering. This has performance\n roughly equal to k * log(n), where k is the number of collisions and n is the\n number of proxies in the tree.\n @param tree the dynamic tree to ray cast\n @param input the ray cast input data. The ray extends from p1 to p1 + maxFraction * (p2 - p1).\n @param maskBits filter bits: `bool accept = (maskBits & node->categoryBits) != 0;`\n @param callback a callback class that is called for each proxy that is hit by the shape\n @param context user context that is passed to the callback\n\t@return performance data"]
958 pub fn b2DynamicTree_ShapeCast(
959 tree: *const b2DynamicTree,
960 input: *const b2ShapeCastInput,
961 maskBits: u64,
962 callback: b2TreeShapeCastCallbackFcn,
963 context: *mut ::std::os::raw::c_void,
964 ) -> b2TreeStats;
965}
966unsafe extern "C" {
967 #[doc = " Get the height of the binary tree."]
968 pub fn b2DynamicTree_GetHeight(tree: *const b2DynamicTree) -> ::std::os::raw::c_int;
969}
970unsafe extern "C" {
971 #[doc = " Get the ratio of the sum of the node areas to the root area."]
972 pub fn b2DynamicTree_GetAreaRatio(tree: *const b2DynamicTree) -> f32;
973}
974unsafe extern "C" {
975 #[doc = " Get the bounding box that contains the entire tree"]
976 pub fn b2DynamicTree_GetRootBounds(tree: *const b2DynamicTree) -> b2AABB;
977}
978unsafe extern "C" {
979 #[doc = " Get the number of proxies created"]
980 pub fn b2DynamicTree_GetProxyCount(tree: *const b2DynamicTree) -> ::std::os::raw::c_int;
981}
982unsafe extern "C" {
983 #[doc = " Rebuild the tree while retaining subtrees that haven't changed. Returns the number of boxes sorted."]
984 pub fn b2DynamicTree_Rebuild(
985 tree: *mut b2DynamicTree,
986 fullBuild: bool,
987 ) -> ::std::os::raw::c_int;
988}
989unsafe extern "C" {
990 #[doc = " Get the number of bytes used by this tree"]
991 pub fn b2DynamicTree_GetByteCount(tree: *const b2DynamicTree) -> ::std::os::raw::c_int;
992}
993unsafe extern "C" {
994 #[doc = " Get proxy user data"]
995 pub fn b2DynamicTree_GetUserData(
996 tree: *const b2DynamicTree,
997 proxyId: ::std::os::raw::c_int,
998 ) -> u64;
999}
1000unsafe extern "C" {
1001 #[doc = " Get the AABB of a proxy"]
1002 pub fn b2DynamicTree_GetAABB(
1003 tree: *const b2DynamicTree,
1004 proxyId: ::std::os::raw::c_int,
1005 ) -> b2AABB;
1006}
1007unsafe extern "C" {
1008 #[doc = " Validate this tree. For testing."]
1009 pub fn b2DynamicTree_Validate(tree: *const b2DynamicTree);
1010}
1011unsafe extern "C" {
1012 #[doc = " Validate this tree has no enlarged AABBs. For testing."]
1013 pub fn b2DynamicTree_ValidateNoEnlarged(tree: *const b2DynamicTree);
1014}
1015#[doc = " These are the collision planes returned from b2World_CollideMover"]
1016#[repr(C)]
1017#[derive(Debug, Copy, Clone)]
1018pub struct b2PlaneResult {
1019 #[doc = " The collision plane between the mover and a convex shape"]
1020 pub plane: b2Plane,
1021 pub point: b2Vec2,
1022 #[doc = " Did the collision register a hit? If not this plane should be ignored."]
1023 pub hit: bool,
1024}
1025#[doc = " These are collision planes that can be fed to b2SolvePlanes. Normally\n this is assembled by the user from plane results in b2PlaneResult"]
1026#[repr(C)]
1027#[derive(Debug, Copy, Clone)]
1028pub struct b2CollisionPlane {
1029 #[doc = " The collision plane between the mover and some shape"]
1030 pub plane: b2Plane,
1031 #[doc = " Setting this to FLT_MAX makes the plane as rigid as possible. Lower values can\n make the plane collision soft. Usually in meters."]
1032 pub pushLimit: f32,
1033 #[doc = " The push on the mover determined by b2SolvePlanes. Usually in meters."]
1034 pub push: f32,
1035 #[doc = " Indicates if b2ClipVector should clip against this plane. Should be false for soft collision."]
1036 pub clipVelocity: bool,
1037}
1038#[doc = " Result returned by b2SolvePlanes"]
1039#[repr(C)]
1040#[derive(Debug, Copy, Clone)]
1041pub struct b2PlaneSolverResult {
1042 #[doc = " The translation of the mover"]
1043 pub translation: b2Vec2,
1044 #[doc = " The number of iterations used by the plane solver. For diagnostics."]
1045 pub iterationCount: ::std::os::raw::c_int,
1046}
1047unsafe extern "C" {
1048 #[doc = " Solves the position of a mover that satisfies the given collision planes.\n @param targetDelta the desired movement from the position used to generate the collision planes\n @param planes the collision planes\n @param count the number of collision planes"]
1049 pub fn b2SolvePlanes(
1050 targetDelta: b2Vec2,
1051 planes: *mut b2CollisionPlane,
1052 count: ::std::os::raw::c_int,
1053 ) -> b2PlaneSolverResult;
1054}
1055unsafe extern "C" {
1056 #[doc = " Clips the velocity against the given collision planes. Planes with zero push or clipVelocity\n set to false are skipped."]
1057 pub fn b2ClipVector(
1058 vector: b2Vec2,
1059 planes: *const b2CollisionPlane,
1060 count: ::std::os::raw::c_int,
1061 ) -> b2Vec2;
1062}
1063#[doc = " World id references a world instance. This should be treated as an opaque handle."]
1064#[repr(C)]
1065#[derive(Debug, Copy, Clone)]
1066pub struct b2WorldId {
1067 pub index1: u16,
1068 pub generation: u16,
1069}
1070#[doc = " Body id references a body instance. This should be treated as an opaque handle."]
1071#[repr(C)]
1072#[derive(Debug, Copy, Clone)]
1073pub struct b2BodyId {
1074 pub index1: i32,
1075 pub world0: u16,
1076 pub generation: u16,
1077}
1078#[doc = " Shape id references a shape instance. This should be treated as an opaque handle."]
1079#[repr(C)]
1080#[derive(Debug, Copy, Clone)]
1081pub struct b2ShapeId {
1082 pub index1: i32,
1083 pub world0: u16,
1084 pub generation: u16,
1085}
1086#[doc = " Chain id references a chain instances. This should be treated as an opaque handle."]
1087#[repr(C)]
1088#[derive(Debug, Copy, Clone)]
1089pub struct b2ChainId {
1090 pub index1: i32,
1091 pub world0: u16,
1092 pub generation: u16,
1093}
1094#[doc = " Joint id references a joint instance. This should be treated as an opaque handle."]
1095#[repr(C)]
1096#[derive(Debug, Copy, Clone)]
1097pub struct b2JointId {
1098 pub index1: i32,
1099 pub world0: u16,
1100 pub generation: u16,
1101}
1102#[doc = " Contact id references a contact instance. This should be treated as an opaque handled."]
1103#[repr(C)]
1104#[derive(Debug, Copy, Clone)]
1105pub struct b2ContactId {
1106 pub index1: i32,
1107 pub world0: u16,
1108 pub padding: i16,
1109 pub generation: u32,
1110}
1111#[doc = " Task interface\n This is prototype for a Box2D task. Your task system is expected to invoke the Box2D task with these arguments.\n The task spans a range of the parallel-for: [startIndex, endIndex)\n The worker index must correctly identify each worker in the user thread pool, expected in [0, workerCount).\n A worker must only exist on only one thread at a time and is analogous to the thread index.\n The task context is the context pointer sent from Box2D when it is enqueued.\n The startIndex and endIndex are expected in the range [0, itemCount) where itemCount is the argument to b2EnqueueTaskCallback\n below. Box2D expects startIndex < endIndex and will execute a loop like this:\n\n @code{.c}\n for (int i = startIndex; i < endIndex; ++i)\n {\n \tDoWork();\n }\n @endcode\n @ingroup world"]
1112pub type b2TaskCallback = ::std::option::Option<
1113 unsafe extern "C" fn(
1114 startIndex: ::std::os::raw::c_int,
1115 endIndex: ::std::os::raw::c_int,
1116 workerIndex: u32,
1117 taskContext: *mut ::std::os::raw::c_void,
1118 ),
1119>;
1120#[doc = " These functions can be provided to Box2D to invoke a task system. These are designed to work well with enkiTS.\n Returns a pointer to the user's task object. May be nullptr. A nullptr indicates to Box2D that the work was executed\n serially within the callback and there is no need to call b2FinishTaskCallback.\n The itemCount is the number of Box2D work items that are to be partitioned among workers by the user's task system.\n This is essentially a parallel-for. The minRange parameter is a suggestion of the minimum number of items to assign\n per worker to reduce overhead. For example, suppose the task is small and that itemCount is 16. A minRange of 8 suggests\n that your task system should split the work items among just two workers, even if you have more available.\n In general the range [startIndex, endIndex) send to b2TaskCallback should obey:\n endIndex - startIndex >= minRange\n The exception of course is when itemCount < minRange.\n @ingroup world"]
1121pub type b2EnqueueTaskCallback = ::std::option::Option<
1122 unsafe extern "C" fn(
1123 task: b2TaskCallback,
1124 itemCount: ::std::os::raw::c_int,
1125 minRange: ::std::os::raw::c_int,
1126 taskContext: *mut ::std::os::raw::c_void,
1127 userContext: *mut ::std::os::raw::c_void,
1128 ) -> *mut ::std::os::raw::c_void,
1129>;
1130#[doc = " Finishes a user task object that wraps a Box2D task.\n @ingroup world"]
1131pub type b2FinishTaskCallback = ::std::option::Option<
1132 unsafe extern "C" fn(
1133 userTask: *mut ::std::os::raw::c_void,
1134 userContext: *mut ::std::os::raw::c_void,
1135 ),
1136>;
1137#[doc = " Optional friction mixing callback. This intentionally provides no context objects because this is called\n from a worker thread.\n @warning This function should not attempt to modify Box2D state or user application state.\n @ingroup world"]
1138pub type b2FrictionCallback = ::std::option::Option<
1139 unsafe extern "C" fn(
1140 frictionA: f32,
1141 userMaterialIdA: u64,
1142 frictionB: f32,
1143 userMaterialIdB: u64,
1144 ) -> f32,
1145>;
1146#[doc = " Optional restitution mixing callback. This intentionally provides no context objects because this is called\n from a worker thread.\n @warning This function should not attempt to modify Box2D state or user application state.\n @ingroup world"]
1147pub type b2RestitutionCallback = ::std::option::Option<
1148 unsafe extern "C" fn(
1149 restitutionA: f32,
1150 userMaterialIdA: u64,
1151 restitutionB: f32,
1152 userMaterialIdB: u64,
1153 ) -> f32,
1154>;
1155#[doc = " Result from b2World_RayCastClosest\n If there is initial overlap the fraction and normal will be zero while the point is an arbitrary point in the overlap region.\n @ingroup world"]
1156#[repr(C)]
1157#[derive(Debug, Copy, Clone)]
1158pub struct b2RayResult {
1159 pub shapeId: b2ShapeId,
1160 pub point: b2Vec2,
1161 pub normal: b2Vec2,
1162 pub fraction: f32,
1163 pub nodeVisits: ::std::os::raw::c_int,
1164 pub leafVisits: ::std::os::raw::c_int,
1165 pub hit: bool,
1166}
1167#[doc = " World definition used to create a simulation world.\n Must be initialized using b2DefaultWorldDef().\n @ingroup world"]
1168#[repr(C)]
1169#[derive(Debug, Copy, Clone)]
1170pub struct b2WorldDef {
1171 #[doc = " Gravity vector. Box2D has no up-vector defined."]
1172 pub gravity: b2Vec2,
1173 #[doc = " Restitution speed threshold, usually in m/s. Collisions above this\n speed have restitution applied (will bounce)."]
1174 pub restitutionThreshold: f32,
1175 #[doc = " Threshold speed for hit events. Usually meters per second."]
1176 pub hitEventThreshold: f32,
1177 #[doc = " Contact stiffness. Cycles per second. Increasing this increases the speed of overlap recovery, but can introduce jitter."]
1178 pub contactHertz: f32,
1179 #[doc = " Contact bounciness. Non-dimensional. You can speed up overlap recovery by decreasing this with\n the trade-off that overlap resolution becomes more energetic."]
1180 pub contactDampingRatio: f32,
1181 #[doc = " This parameter controls how fast overlap is resolved and usually has units of meters per second. This only\n puts a cap on the resolution speed. The resolution speed is increased by increasing the hertz and/or\n decreasing the damping ratio."]
1182 pub contactSpeed: f32,
1183 #[doc = " Maximum linear speed. Usually meters per second."]
1184 pub maximumLinearSpeed: f32,
1185 #[doc = " Optional mixing callback for friction. The default uses sqrt(frictionA * frictionB)."]
1186 pub frictionCallback: b2FrictionCallback,
1187 #[doc = " Optional mixing callback for restitution. The default uses max(restitutionA, restitutionB)."]
1188 pub restitutionCallback: b2RestitutionCallback,
1189 #[doc = " Can bodies go to sleep to improve performance"]
1190 pub enableSleep: bool,
1191 #[doc = " Enable continuous collision"]
1192 pub enableContinuous: bool,
1193 #[doc = " Contact softening when mass ratios are large. Experimental."]
1194 pub enableContactSoftening: bool,
1195 #[doc = " Number of workers to use with the provided task system. Box2D performs best when using only\n performance cores and accessing a single L2 cache. Efficiency cores and hyper-threading provide\n little benefit and may even harm performance.\n @note Box2D does not create threads. This is the number of threads your applications has created\n that you are allocating to b2World_Step.\n @warning Do not modify the default value unless you are also providing a task system and providing\n task callbacks (enqueueTask and finishTask)."]
1196 pub workerCount: ::std::os::raw::c_int,
1197 #[doc = " Function to spawn tasks"]
1198 pub enqueueTask: b2EnqueueTaskCallback,
1199 #[doc = " Function to finish a task"]
1200 pub finishTask: b2FinishTaskCallback,
1201 #[doc = " User context that is provided to enqueueTask and finishTask"]
1202 pub userTaskContext: *mut ::std::os::raw::c_void,
1203 #[doc = " User data"]
1204 pub userData: *mut ::std::os::raw::c_void,
1205 #[doc = " Used internally to detect a valid definition. DO NOT SET."]
1206 pub internalValue: ::std::os::raw::c_int,
1207}
1208unsafe extern "C" {
1209 #[doc = " Use this to initialize your world definition\n @ingroup world"]
1210 pub fn b2DefaultWorldDef() -> b2WorldDef;
1211}
1212#[doc = " zero mass, zero velocity, may be manually moved"]
1213pub const b2BodyType_b2_staticBody: b2BodyType = 0;
1214#[doc = " zero mass, velocity set by user, moved by solver"]
1215pub const b2BodyType_b2_kinematicBody: b2BodyType = 1;
1216#[doc = " positive mass, velocity determined by forces, moved by solver"]
1217pub const b2BodyType_b2_dynamicBody: b2BodyType = 2;
1218#[doc = " number of body types"]
1219pub const b2BodyType_b2_bodyTypeCount: b2BodyType = 3;
1220#[doc = " The body simulation type.\n Each body is one of these three types. The type determines how the body behaves in the simulation.\n @ingroup body"]
1221pub type b2BodyType = ::std::os::raw::c_int;
1222#[doc = " Motion locks to restrict the body movement"]
1223#[repr(C)]
1224#[derive(Debug, Copy, Clone)]
1225pub struct b2MotionLocks {
1226 #[doc = " Prevent translation along the x-axis"]
1227 pub linearX: bool,
1228 #[doc = " Prevent translation along the y-axis"]
1229 pub linearY: bool,
1230 #[doc = " Prevent rotation around the z-axis"]
1231 pub angularZ: bool,
1232}
1233#[doc = " A body definition holds all the data needed to construct a rigid body.\n You can safely re-use body definitions. Shapes are added to a body after construction.\n Body definitions are temporary objects used to bundle creation parameters.\n Must be initialized using b2DefaultBodyDef().\n @ingroup body"]
1234#[repr(C)]
1235#[derive(Debug, Copy, Clone)]
1236pub struct b2BodyDef {
1237 #[doc = " The body type: static, kinematic, or dynamic."]
1238 pub type_: b2BodyType,
1239 #[doc = " The initial world position of the body. Bodies should be created with the desired position.\n @note Creating bodies at the origin and then moving them nearly doubles the cost of body creation, especially\n if the body is moved after shapes have been added."]
1240 pub position: b2Vec2,
1241 #[doc = " The initial world rotation of the body. Use b2MakeRot() if you have an angle."]
1242 pub rotation: b2Rot,
1243 #[doc = " The initial linear velocity of the body's origin. Usually in meters per second."]
1244 pub linearVelocity: b2Vec2,
1245 #[doc = " The initial angular velocity of the body. Radians per second."]
1246 pub angularVelocity: f32,
1247 #[doc = " Linear damping is used to reduce the linear velocity. The damping parameter\n can be larger than 1 but the damping effect becomes sensitive to the\n time step when the damping parameter is large.\n Generally linear damping is undesirable because it makes objects move slowly\n as if they are floating."]
1248 pub linearDamping: f32,
1249 #[doc = " Angular damping is used to reduce the angular velocity. The damping parameter\n can be larger than 1.0f but the damping effect becomes sensitive to the\n time step when the damping parameter is large.\n Angular damping can be use slow down rotating bodies."]
1250 pub angularDamping: f32,
1251 #[doc = " Scale the gravity applied to this body. Non-dimensional."]
1252 pub gravityScale: f32,
1253 #[doc = " Sleep speed threshold, default is 0.05 meters per second"]
1254 pub sleepThreshold: f32,
1255 #[doc = " Optional body name for debugging. Up to 31 characters (excluding null termination)"]
1256 pub name: *const ::std::os::raw::c_char,
1257 #[doc = " Use this to store application specific body data."]
1258 pub userData: *mut ::std::os::raw::c_void,
1259 #[doc = " Motions locks to restrict linear and angular movement.\n Caution: may lead to softer constraints along the locked direction"]
1260 pub motionLocks: b2MotionLocks,
1261 #[doc = " Set this flag to false if this body should never fall asleep."]
1262 pub enableSleep: bool,
1263 #[doc = " Is this body initially awake or sleeping?"]
1264 pub isAwake: bool,
1265 #[doc = " Treat this body as high speed object that performs continuous collision detection\n against dynamic and kinematic bodies, but not other bullet bodies.\n @warning Bullets should be used sparingly. They are not a solution for general dynamic-versus-dynamic\n continuous collision."]
1266 pub isBullet: bool,
1267 #[doc = " Used to disable a body. A disabled body does not move or collide."]
1268 pub isEnabled: bool,
1269 #[doc = " This allows this body to bypass rotational speed limits. Should only be used\n for circular objects, like wheels."]
1270 pub allowFastRotation: bool,
1271 #[doc = " Used internally to detect a valid definition. DO NOT SET."]
1272 pub internalValue: ::std::os::raw::c_int,
1273}
1274unsafe extern "C" {
1275 #[doc = " Use this to initialize your body definition\n @ingroup body"]
1276 pub fn b2DefaultBodyDef() -> b2BodyDef;
1277}
1278#[doc = " This is used to filter collision on shapes. It affects shape-vs-shape collision\n and shape-versus-query collision (such as b2World_CastRay).\n @ingroup shape"]
1279#[repr(C)]
1280#[derive(Debug, Copy, Clone)]
1281pub struct b2Filter {
1282 #[doc = " The collision category bits. Normally you would just set one bit. The category bits should\n represent your application object types. For example:\n @code{.cpp}\n enum MyCategories\n {\n Static = 0x00000001,\n Dynamic = 0x00000002,\n Debris = 0x00000004,\n Player = 0x00000008,\n // etc\n };\n @endcode"]
1283 pub categoryBits: u64,
1284 #[doc = " The collision mask bits. This states the categories that this\n shape would accept for collision.\n For example, you may want your player to only collide with static objects\n and other players.\n @code{.c}\n maskBits = Static | Player;\n @endcode"]
1285 pub maskBits: u64,
1286 #[doc = " Collision groups allow a certain group of objects to never collide (negative)\n or always collide (positive). A group index of zero has no effect. Non-zero group filtering\n always wins against the mask bits.\n For example, you may want ragdolls to collide with other ragdolls but you don't want\n ragdoll self-collision. In this case you would give each ragdoll a unique negative group index\n and apply that group index to all shapes on the ragdoll."]
1287 pub groupIndex: ::std::os::raw::c_int,
1288}
1289unsafe extern "C" {
1290 #[doc = " Use this to initialize your filter\n @ingroup shape"]
1291 pub fn b2DefaultFilter() -> b2Filter;
1292}
1293#[doc = " The query filter is used to filter collisions between queries and shapes. For example,\n you may want a ray-cast representing a projectile to hit players and the static environment\n but not debris.\n @ingroup shape"]
1294#[repr(C)]
1295#[derive(Debug, Copy, Clone)]
1296pub struct b2QueryFilter {
1297 #[doc = " The collision category bits of this query. Normally you would just set one bit."]
1298 pub categoryBits: u64,
1299 #[doc = " The collision mask bits. This states the shape categories that this\n query would accept for collision."]
1300 pub maskBits: u64,
1301}
1302unsafe extern "C" {
1303 #[doc = " Use this to initialize your query filter\n @ingroup shape"]
1304 pub fn b2DefaultQueryFilter() -> b2QueryFilter;
1305}
1306#[doc = " A circle with an offset"]
1307pub const b2ShapeType_b2_circleShape: b2ShapeType = 0;
1308#[doc = " A capsule is an extruded circle"]
1309pub const b2ShapeType_b2_capsuleShape: b2ShapeType = 1;
1310#[doc = " A line segment"]
1311pub const b2ShapeType_b2_segmentShape: b2ShapeType = 2;
1312#[doc = " A convex polygon"]
1313pub const b2ShapeType_b2_polygonShape: b2ShapeType = 3;
1314#[doc = " A line segment owned by a chain shape"]
1315pub const b2ShapeType_b2_chainSegmentShape: b2ShapeType = 4;
1316#[doc = " The number of shape types"]
1317pub const b2ShapeType_b2_shapeTypeCount: b2ShapeType = 5;
1318#[doc = " Shape type\n @ingroup shape"]
1319pub type b2ShapeType = ::std::os::raw::c_int;
1320#[doc = " Surface materials allow chain shapes to have per segment surface properties.\n @ingroup shape"]
1321#[repr(C)]
1322#[derive(Debug, Copy, Clone)]
1323pub struct b2SurfaceMaterial {
1324 #[doc = " The Coulomb (dry) friction coefficient, usually in the range [0,1]."]
1325 pub friction: f32,
1326 #[doc = " The coefficient of restitution (bounce) usually in the range [0,1].\n https://en.wikipedia.org/wiki/Coefficient_of_restitution"]
1327 pub restitution: f32,
1328 #[doc = " The rolling resistance usually in the range [0,1]."]
1329 pub rollingResistance: f32,
1330 #[doc = " The tangent speed for conveyor belts"]
1331 pub tangentSpeed: f32,
1332 #[doc = " User material identifier. This is passed with query results and to friction and restitution\n combining functions. It is not used internally."]
1333 pub userMaterialId: u64,
1334 #[doc = " Custom debug draw color."]
1335 pub customColor: u32,
1336}
1337unsafe extern "C" {
1338 #[doc = " Use this to initialize your surface material\n @ingroup shape"]
1339 pub fn b2DefaultSurfaceMaterial() -> b2SurfaceMaterial;
1340}
1341#[doc = " Used to create a shape.\n This is a temporary object used to bundle shape creation parameters. You may use\n the same shape definition to create multiple shapes.\n Must be initialized using b2DefaultShapeDef().\n @ingroup shape"]
1342#[repr(C)]
1343#[derive(Debug, Copy, Clone)]
1344pub struct b2ShapeDef {
1345 #[doc = " Use this to store application specific shape data."]
1346 pub userData: *mut ::std::os::raw::c_void,
1347 #[doc = " The surface material for this shape."]
1348 pub material: b2SurfaceMaterial,
1349 #[doc = " The density, usually in kg/m^2.\n This is not part of the surface material because this is for the interior, which may have\n other considerations, such as being hollow. For example a wood barrel may be hollow or full of water."]
1350 pub density: f32,
1351 #[doc = " Collision filtering data."]
1352 pub filter: b2Filter,
1353 #[doc = " Enable custom filtering. Only one of the two shapes needs to enable custom filtering. See b2WorldDef."]
1354 pub enableCustomFiltering: bool,
1355 #[doc = " A sensor shape generates overlap events but never generates a collision response.\n Sensors do not have continuous collision. Instead, use a ray or shape cast for those scenarios.\n Sensors still contribute to the body mass if they have non-zero density.\n @note Sensor events are disabled by default.\n @see enableSensorEvents"]
1356 pub isSensor: bool,
1357 #[doc = " Enable sensor events for this shape. This applies to sensors and non-sensors. False by default, even for sensors."]
1358 pub enableSensorEvents: bool,
1359 #[doc = " Enable contact events for this shape. Only applies to kinematic and dynamic bodies. Ignored for sensors. False by default."]
1360 pub enableContactEvents: bool,
1361 #[doc = " Enable hit events for this shape. Only applies to kinematic and dynamic bodies. Ignored for sensors. False by default."]
1362 pub enableHitEvents: bool,
1363 #[doc = " Enable pre-solve contact events for this shape. Only applies to dynamic bodies. These are expensive\n and must be carefully handled due to multithreading. Ignored for sensors."]
1364 pub enablePreSolveEvents: bool,
1365 #[doc = " When shapes are created they will scan the environment for collision the next time step. This can significantly slow down\n static body creation when there are many static shapes.\n This is flag is ignored for dynamic and kinematic shapes which always invoke contact creation."]
1366 pub invokeContactCreation: bool,
1367 #[doc = " Should the body update the mass properties when this shape is created. Default is true."]
1368 pub updateBodyMass: bool,
1369 #[doc = " Used internally to detect a valid definition. DO NOT SET."]
1370 pub internalValue: ::std::os::raw::c_int,
1371}
1372unsafe extern "C" {
1373 #[doc = " Use this to initialize your shape definition\n @ingroup shape"]
1374 pub fn b2DefaultShapeDef() -> b2ShapeDef;
1375}
1376#[doc = " Used to create a chain of line segments. This is designed to eliminate ghost collisions with some limitations.\n - chains are one-sided\n - chains have no mass and should be used on static bodies\n - chains have a counter-clockwise winding order (normal points right of segment direction)\n - chains are either a loop or open\n - a chain must have at least 4 points\n - the distance between any two points must be greater than B2_LINEAR_SLOP\n - a chain shape should not self intersect (this is not validated)\n - an open chain shape has NO COLLISION on the first and final edge\n - you may overlap two open chains on their first three and/or last three points to get smooth collision\n - a chain shape creates multiple line segment shapes on the body\n https://en.wikipedia.org/wiki/Polygonal_chain\n Must be initialized using b2DefaultChainDef().\n @warning Do not use chain shapes unless you understand the limitations. This is an advanced feature.\n @ingroup shape"]
1377#[repr(C)]
1378#[derive(Debug, Copy, Clone)]
1379pub struct b2ChainDef {
1380 #[doc = " Use this to store application specific shape data."]
1381 pub userData: *mut ::std::os::raw::c_void,
1382 #[doc = " An array of at least 4 points. These are cloned and may be temporary."]
1383 pub points: *const b2Vec2,
1384 #[doc = " The point count, must be 4 or more."]
1385 pub count: ::std::os::raw::c_int,
1386 #[doc = " Surface materials for each segment. These are cloned."]
1387 pub materials: *const b2SurfaceMaterial,
1388 #[doc = " The material count. Must be 1 or count. This allows you to provide one\n material for all segments or a unique material per segment."]
1389 pub materialCount: ::std::os::raw::c_int,
1390 #[doc = " Contact filtering data."]
1391 pub filter: b2Filter,
1392 #[doc = " Indicates a closed chain formed by connecting the first and last points"]
1393 pub isLoop: bool,
1394 #[doc = " Enable sensors to detect this chain. False by default."]
1395 pub enableSensorEvents: bool,
1396 #[doc = " Used internally to detect a valid definition. DO NOT SET."]
1397 pub internalValue: ::std::os::raw::c_int,
1398}
1399unsafe extern "C" {
1400 #[doc = " Use this to initialize your chain definition\n @ingroup shape"]
1401 pub fn b2DefaultChainDef() -> b2ChainDef;
1402}
1403#[doc = "! @cond\n Profiling data. Times are in milliseconds."]
1404#[repr(C)]
1405#[derive(Debug, Copy, Clone)]
1406pub struct b2Profile {
1407 pub step: f32,
1408 pub pairs: f32,
1409 pub collide: f32,
1410 pub solve: f32,
1411 pub prepareStages: f32,
1412 pub solveConstraints: f32,
1413 pub prepareConstraints: f32,
1414 pub integrateVelocities: f32,
1415 pub warmStart: f32,
1416 pub solveImpulses: f32,
1417 pub integratePositions: f32,
1418 pub relaxImpulses: f32,
1419 pub applyRestitution: f32,
1420 pub storeImpulses: f32,
1421 pub splitIslands: f32,
1422 pub transforms: f32,
1423 pub sensorHits: f32,
1424 pub jointEvents: f32,
1425 pub hitEvents: f32,
1426 pub refit: f32,
1427 pub bullets: f32,
1428 pub sleepIslands: f32,
1429 pub sensors: f32,
1430}
1431#[doc = " Counters that give details of the simulation size."]
1432#[repr(C)]
1433#[derive(Debug, Copy, Clone)]
1434pub struct b2Counters {
1435 pub bodyCount: ::std::os::raw::c_int,
1436 pub shapeCount: ::std::os::raw::c_int,
1437 pub contactCount: ::std::os::raw::c_int,
1438 pub jointCount: ::std::os::raw::c_int,
1439 pub islandCount: ::std::os::raw::c_int,
1440 pub stackUsed: ::std::os::raw::c_int,
1441 pub staticTreeHeight: ::std::os::raw::c_int,
1442 pub treeHeight: ::std::os::raw::c_int,
1443 pub byteCount: ::std::os::raw::c_int,
1444 pub taskCount: ::std::os::raw::c_int,
1445 pub colorCounts: [::std::os::raw::c_int; 24usize],
1446}
1447pub const b2JointType_b2_distanceJoint: b2JointType = 0;
1448pub const b2JointType_b2_filterJoint: b2JointType = 1;
1449pub const b2JointType_b2_motorJoint: b2JointType = 2;
1450pub const b2JointType_b2_prismaticJoint: b2JointType = 3;
1451pub const b2JointType_b2_revoluteJoint: b2JointType = 4;
1452pub const b2JointType_b2_weldJoint: b2JointType = 5;
1453pub const b2JointType_b2_wheelJoint: b2JointType = 6;
1454#[doc = " Joint type enumeration\n\n This is useful because all joint types use b2JointId and sometimes you\n want to get the type of a joint.\n @ingroup joint"]
1455pub type b2JointType = ::std::os::raw::c_int;
1456#[doc = " Base joint definition used by all joint types.\n The local frames are measured from the body's origin rather than the center of mass because:\n 1. you might not know where the center of mass will be\n 2. if you add/remove shapes from a body and recompute the mass, the joints will be broken"]
1457#[repr(C)]
1458#[derive(Debug, Copy, Clone)]
1459pub struct b2JointDef {
1460 #[doc = " User data pointer"]
1461 pub userData: *mut ::std::os::raw::c_void,
1462 #[doc = " The first attached body"]
1463 pub bodyIdA: b2BodyId,
1464 #[doc = " The second attached body"]
1465 pub bodyIdB: b2BodyId,
1466 #[doc = " The first local joint frame"]
1467 pub localFrameA: b2Transform,
1468 #[doc = " The second local joint frame"]
1469 pub localFrameB: b2Transform,
1470 #[doc = " Force threshold for joint events"]
1471 pub forceThreshold: f32,
1472 #[doc = " Torque threshold for joint events"]
1473 pub torqueThreshold: f32,
1474 #[doc = " Constraint hertz (advanced feature)"]
1475 pub constraintHertz: f32,
1476 #[doc = " Constraint damping ratio (advanced feature)"]
1477 pub constraintDampingRatio: f32,
1478 #[doc = " Debug draw scale"]
1479 pub drawScale: f32,
1480 #[doc = " Set this flag to true if the attached bodies should collide"]
1481 pub collideConnected: bool,
1482}
1483#[doc = " Distance joint definition\n Connects a point on body A with a point on body B by a segment.\n Useful for ropes and springs.\n @ingroup distance_joint"]
1484#[repr(C)]
1485#[derive(Debug, Copy, Clone)]
1486pub struct b2DistanceJointDef {
1487 #[doc = " Base joint definition"]
1488 pub base: b2JointDef,
1489 #[doc = " The rest length of this joint. Clamped to a stable minimum value."]
1490 pub length: f32,
1491 #[doc = " Enable the distance constraint to behave like a spring. If false\n then the distance joint will be rigid, overriding the limit and motor."]
1492 pub enableSpring: bool,
1493 #[doc = " The lower spring force controls how much tension it can sustain"]
1494 pub lowerSpringForce: f32,
1495 #[doc = " The upper spring force controls how much compression it an sustain"]
1496 pub upperSpringForce: f32,
1497 #[doc = " The spring linear stiffness Hertz, cycles per second"]
1498 pub hertz: f32,
1499 #[doc = " The spring linear damping ratio, non-dimensional"]
1500 pub dampingRatio: f32,
1501 #[doc = " Enable/disable the joint limit"]
1502 pub enableLimit: bool,
1503 #[doc = " Minimum length. Clamped to a stable minimum value."]
1504 pub minLength: f32,
1505 #[doc = " Maximum length. Must be greater than or equal to the minimum length."]
1506 pub maxLength: f32,
1507 #[doc = " Enable/disable the joint motor"]
1508 pub enableMotor: bool,
1509 #[doc = " The maximum motor force, usually in newtons"]
1510 pub maxMotorForce: f32,
1511 #[doc = " The desired motor speed, usually in meters per second"]
1512 pub motorSpeed: f32,
1513 #[doc = " Used internally to detect a valid definition. DO NOT SET."]
1514 pub internalValue: ::std::os::raw::c_int,
1515}
1516unsafe extern "C" {
1517 #[doc = " Use this to initialize your joint definition\n @ingroup distance_joint"]
1518 pub fn b2DefaultDistanceJointDef() -> b2DistanceJointDef;
1519}
1520#[doc = " A motor joint is used to control the relative velocity and or transform between two bodies.\n With a velocity of zero this acts like top-down friction.\n @ingroup motor_joint"]
1521#[repr(C)]
1522#[derive(Debug, Copy, Clone)]
1523pub struct b2MotorJointDef {
1524 #[doc = " Base joint definition"]
1525 pub base: b2JointDef,
1526 #[doc = " The desired linear velocity"]
1527 pub linearVelocity: b2Vec2,
1528 #[doc = " The maximum motor force in newtons"]
1529 pub maxVelocityForce: f32,
1530 #[doc = " The desired angular velocity"]
1531 pub angularVelocity: f32,
1532 #[doc = " The maximum motor torque in newton-meters"]
1533 pub maxVelocityTorque: f32,
1534 #[doc = " Linear spring hertz for position control"]
1535 pub linearHertz: f32,
1536 #[doc = " Linear spring damping ratio"]
1537 pub linearDampingRatio: f32,
1538 #[doc = " Maximum spring force in newtons"]
1539 pub maxSpringForce: f32,
1540 #[doc = " Angular spring hertz for position control"]
1541 pub angularHertz: f32,
1542 #[doc = " Angular spring damping ratio"]
1543 pub angularDampingRatio: f32,
1544 #[doc = " Maximum spring torque in newton-meters"]
1545 pub maxSpringTorque: f32,
1546 #[doc = " Used internally to detect a valid definition. DO NOT SET."]
1547 pub internalValue: ::std::os::raw::c_int,
1548}
1549unsafe extern "C" {
1550 #[doc = " Use this to initialize your joint definition\n @ingroup motor_joint"]
1551 pub fn b2DefaultMotorJointDef() -> b2MotorJointDef;
1552}
1553#[doc = " A filter joint is used to disable collision between two specific bodies.\n\n @ingroup filter_joint"]
1554#[repr(C)]
1555#[derive(Debug, Copy, Clone)]
1556pub struct b2FilterJointDef {
1557 #[doc = " Base joint definition"]
1558 pub base: b2JointDef,
1559 #[doc = " Used internally to detect a valid definition. DO NOT SET."]
1560 pub internalValue: ::std::os::raw::c_int,
1561}
1562unsafe extern "C" {
1563 #[doc = " Use this to initialize your joint definition\n @ingroup filter_joint"]
1564 pub fn b2DefaultFilterJointDef() -> b2FilterJointDef;
1565}
1566#[doc = " Prismatic joint definition\n Body B may slide along the x-axis in local frame A. Body B cannot rotate relative to body A.\n The joint translation is zero when the local frame origins coincide in world space.\n @ingroup prismatic_joint"]
1567#[repr(C)]
1568#[derive(Debug, Copy, Clone)]
1569pub struct b2PrismaticJointDef {
1570 #[doc = " Base joint definition"]
1571 pub base: b2JointDef,
1572 #[doc = " Enable a linear spring along the prismatic joint axis"]
1573 pub enableSpring: bool,
1574 #[doc = " The spring stiffness Hertz, cycles per second"]
1575 pub hertz: f32,
1576 #[doc = " The spring damping ratio, non-dimensional"]
1577 pub dampingRatio: f32,
1578 #[doc = " The target translation for the joint in meters. The spring-damper will drive\n to this translation."]
1579 pub targetTranslation: f32,
1580 #[doc = " Enable/disable the joint limit"]
1581 pub enableLimit: bool,
1582 #[doc = " The lower translation limit"]
1583 pub lowerTranslation: f32,
1584 #[doc = " The upper translation limit"]
1585 pub upperTranslation: f32,
1586 #[doc = " Enable/disable the joint motor"]
1587 pub enableMotor: bool,
1588 #[doc = " The maximum motor force, typically in newtons"]
1589 pub maxMotorForce: f32,
1590 #[doc = " The desired motor speed, typically in meters per second"]
1591 pub motorSpeed: f32,
1592 #[doc = " Used internally to detect a valid definition. DO NOT SET."]
1593 pub internalValue: ::std::os::raw::c_int,
1594}
1595unsafe extern "C" {
1596 #[doc = " Use this to initialize your joint definition\n @ingroupd prismatic_joint"]
1597 pub fn b2DefaultPrismaticJointDef() -> b2PrismaticJointDef;
1598}
1599#[doc = " Revolute joint definition\n A point on body B is fixed to a point on body A. Allows relative rotation.\n @ingroup revolute_joint"]
1600#[repr(C)]
1601#[derive(Debug, Copy, Clone)]
1602pub struct b2RevoluteJointDef {
1603 #[doc = " Base joint definition"]
1604 pub base: b2JointDef,
1605 #[doc = " The target angle for the joint in radians. The spring-damper will drive\n to this angle."]
1606 pub targetAngle: f32,
1607 #[doc = " Enable a rotational spring on the revolute hinge axis"]
1608 pub enableSpring: bool,
1609 #[doc = " The spring stiffness Hertz, cycles per second"]
1610 pub hertz: f32,
1611 #[doc = " The spring damping ratio, non-dimensional"]
1612 pub dampingRatio: f32,
1613 #[doc = " A flag to enable joint limits"]
1614 pub enableLimit: bool,
1615 #[doc = " The lower angle for the joint limit in radians. Minimum of -0.99*pi radians."]
1616 pub lowerAngle: f32,
1617 #[doc = " The upper angle for the joint limit in radians. Maximum of 0.99*pi radians."]
1618 pub upperAngle: f32,
1619 #[doc = " A flag to enable the joint motor"]
1620 pub enableMotor: bool,
1621 #[doc = " The maximum motor torque, typically in newton-meters"]
1622 pub maxMotorTorque: f32,
1623 #[doc = " The desired motor speed in radians per second"]
1624 pub motorSpeed: f32,
1625 #[doc = " Used internally to detect a valid definition. DO NOT SET."]
1626 pub internalValue: ::std::os::raw::c_int,
1627}
1628unsafe extern "C" {
1629 #[doc = " Use this to initialize your joint definition.\n @ingroup revolute_joint"]
1630 pub fn b2DefaultRevoluteJointDef() -> b2RevoluteJointDef;
1631}
1632#[doc = " Weld joint definition\n Connects two bodies together rigidly. This constraint provides springs to mimic\n soft-body simulation.\n @note The approximate solver in Box2D cannot hold many bodies together rigidly\n @ingroup weld_joint"]
1633#[repr(C)]
1634#[derive(Debug, Copy, Clone)]
1635pub struct b2WeldJointDef {
1636 #[doc = " Base joint definition"]
1637 pub base: b2JointDef,
1638 #[doc = " Linear stiffness expressed as Hertz (cycles per second). Use zero for maximum stiffness."]
1639 pub linearHertz: f32,
1640 #[doc = " Angular stiffness as Hertz (cycles per second). Use zero for maximum stiffness."]
1641 pub angularHertz: f32,
1642 #[doc = " Linear damping ratio, non-dimensional. Use 1 for critical damping."]
1643 pub linearDampingRatio: f32,
1644 #[doc = " Linear damping ratio, non-dimensional. Use 1 for critical damping."]
1645 pub angularDampingRatio: f32,
1646 #[doc = " Used internally to detect a valid definition. DO NOT SET."]
1647 pub internalValue: ::std::os::raw::c_int,
1648}
1649unsafe extern "C" {
1650 #[doc = " Use this to initialize your joint definition\n @ingroup weld_joint"]
1651 pub fn b2DefaultWeldJointDef() -> b2WeldJointDef;
1652}
1653#[doc = " Wheel joint definition\n Body B is a wheel that may rotate freely and slide along the local x-axis in frame A.\n The joint translation is zero when the local frame origins coincide in world space.\n @ingroup wheel_joint"]
1654#[repr(C)]
1655#[derive(Debug, Copy, Clone)]
1656pub struct b2WheelJointDef {
1657 #[doc = " Base joint definition"]
1658 pub base: b2JointDef,
1659 #[doc = " Enable a linear spring along the local axis"]
1660 pub enableSpring: bool,
1661 #[doc = " Spring stiffness in Hertz"]
1662 pub hertz: f32,
1663 #[doc = " Spring damping ratio, non-dimensional"]
1664 pub dampingRatio: f32,
1665 #[doc = " Enable/disable the joint linear limit"]
1666 pub enableLimit: bool,
1667 #[doc = " The lower translation limit"]
1668 pub lowerTranslation: f32,
1669 #[doc = " The upper translation limit"]
1670 pub upperTranslation: f32,
1671 #[doc = " Enable/disable the joint rotational motor"]
1672 pub enableMotor: bool,
1673 #[doc = " The maximum motor torque, typically in newton-meters"]
1674 pub maxMotorTorque: f32,
1675 #[doc = " The desired motor speed in radians per second"]
1676 pub motorSpeed: f32,
1677 #[doc = " Used internally to detect a valid definition. DO NOT SET."]
1678 pub internalValue: ::std::os::raw::c_int,
1679}
1680unsafe extern "C" {
1681 #[doc = " Use this to initialize your joint definition\n @ingroup wheel_joint"]
1682 pub fn b2DefaultWheelJointDef() -> b2WheelJointDef;
1683}
1684#[doc = " The explosion definition is used to configure options for explosions. Explosions\n consider shape geometry when computing the impulse.\n @ingroup world"]
1685#[repr(C)]
1686#[derive(Debug, Copy, Clone)]
1687pub struct b2ExplosionDef {
1688 #[doc = " Mask bits to filter shapes"]
1689 pub maskBits: u64,
1690 #[doc = " The center of the explosion in world space"]
1691 pub position: b2Vec2,
1692 #[doc = " The radius of the explosion"]
1693 pub radius: f32,
1694 #[doc = " The falloff distance beyond the radius. Impulse is reduced to zero at this distance."]
1695 pub falloff: f32,
1696 #[doc = " Impulse per unit length. This applies an impulse according to the shape perimeter that\n is facing the explosion. Explosions only apply to circles, capsules, and polygons. This\n may be negative for implosions."]
1697 pub impulsePerLength: f32,
1698}
1699unsafe extern "C" {
1700 #[doc = " Use this to initialize your explosion definition\n @ingroup world"]
1701 pub fn b2DefaultExplosionDef() -> b2ExplosionDef;
1702}
1703#[doc = " A begin touch event is generated when a shape starts to overlap a sensor shape."]
1704#[repr(C)]
1705#[derive(Debug, Copy, Clone)]
1706pub struct b2SensorBeginTouchEvent {
1707 #[doc = " The id of the sensor shape"]
1708 pub sensorShapeId: b2ShapeId,
1709 #[doc = " The id of the shape that began touching the sensor shape"]
1710 pub visitorShapeId: b2ShapeId,
1711}
1712#[doc = " An end touch event is generated when a shape stops overlapping a sensor shape.\n\tThese include things like setting the transform, destroying a body or shape, or changing\n\ta filter. You will also get an end event if the sensor or visitor are destroyed.\n\tTherefore you should always confirm the shape id is valid using b2Shape_IsValid."]
1713#[repr(C)]
1714#[derive(Debug, Copy, Clone)]
1715pub struct b2SensorEndTouchEvent {
1716 #[doc = " The id of the sensor shape\n\t@warning this shape may have been destroyed\n\t@see b2Shape_IsValid"]
1717 pub sensorShapeId: b2ShapeId,
1718 #[doc = " The id of the shape that stopped touching the sensor shape\n\t@warning this shape may have been destroyed\n\t@see b2Shape_IsValid"]
1719 pub visitorShapeId: b2ShapeId,
1720}
1721#[doc = " Sensor events are buffered in the world and are available\n as begin/end overlap event arrays after the time step is complete.\n Note: these may become invalid if bodies and/or shapes are destroyed"]
1722#[repr(C)]
1723#[derive(Debug, Copy, Clone)]
1724pub struct b2SensorEvents {
1725 #[doc = " Array of sensor begin touch events"]
1726 pub beginEvents: *mut b2SensorBeginTouchEvent,
1727 #[doc = " Array of sensor end touch events"]
1728 pub endEvents: *mut b2SensorEndTouchEvent,
1729 #[doc = " The number of begin touch events"]
1730 pub beginCount: ::std::os::raw::c_int,
1731 #[doc = " The number of end touch events"]
1732 pub endCount: ::std::os::raw::c_int,
1733}
1734#[doc = " A begin touch event is generated when two shapes begin touching."]
1735#[repr(C)]
1736#[derive(Debug, Copy, Clone)]
1737pub struct b2ContactBeginTouchEvent {
1738 #[doc = " Id of the first shape"]
1739 pub shapeIdA: b2ShapeId,
1740 #[doc = " Id of the second shape"]
1741 pub shapeIdB: b2ShapeId,
1742 #[doc = " The transient contact id. This contact maybe destroyed automatically when the world is modified or simulated.\n Used b2Contact_IsValid before using this id."]
1743 pub contactId: b2ContactId,
1744}
1745#[doc = " An end touch event is generated when two shapes stop touching.\n\tYou will get an end event if you do anything that destroys contacts previous to the last\n\tworld step. These include things like setting the transform, destroying a body\n\tor shape, or changing a filter or body type."]
1746#[repr(C)]
1747#[derive(Debug, Copy, Clone)]
1748pub struct b2ContactEndTouchEvent {
1749 #[doc = " Id of the first shape\n\t@warning this shape may have been destroyed\n\t@see b2Shape_IsValid"]
1750 pub shapeIdA: b2ShapeId,
1751 #[doc = " Id of the second shape\n\t@warning this shape may have been destroyed\n\t@see b2Shape_IsValid"]
1752 pub shapeIdB: b2ShapeId,
1753 #[doc = " Id of the contact.\n\t@warning this contact may have been destroyed\n\t@see b2Contact_IsValid"]
1754 pub contactId: b2ContactId,
1755}
1756#[doc = " A hit touch event is generated when two shapes collide with a speed faster than the hit speed threshold.\n This may be reported for speculative contacts that have a confirmed impulse."]
1757#[repr(C)]
1758#[derive(Debug, Copy, Clone)]
1759pub struct b2ContactHitEvent {
1760 #[doc = " Id of the first shape"]
1761 pub shapeIdA: b2ShapeId,
1762 #[doc = " Id of the second shape"]
1763 pub shapeIdB: b2ShapeId,
1764 #[doc = " Point where the shapes hit at the beginning of the time step.\n This is a mid-point between the two surfaces. It could be at speculative\n point where the two shapes were not touching at the beginning of the time step."]
1765 pub point: b2Vec2,
1766 #[doc = " Normal vector pointing from shape A to shape B"]
1767 pub normal: b2Vec2,
1768 #[doc = " The speed the shapes are approaching. Always positive. Typically in meters per second."]
1769 pub approachSpeed: f32,
1770}
1771#[doc = " Contact events are buffered in the Box2D world and are available\n as event arrays after the time step is complete.\n Note: these may become invalid if bodies and/or shapes are destroyed"]
1772#[repr(C)]
1773#[derive(Debug, Copy, Clone)]
1774pub struct b2ContactEvents {
1775 #[doc = " Array of begin touch events"]
1776 pub beginEvents: *mut b2ContactBeginTouchEvent,
1777 #[doc = " Array of end touch events"]
1778 pub endEvents: *mut b2ContactEndTouchEvent,
1779 #[doc = " Array of hit events"]
1780 pub hitEvents: *mut b2ContactHitEvent,
1781 #[doc = " Number of begin touch events"]
1782 pub beginCount: ::std::os::raw::c_int,
1783 #[doc = " Number of end touch events"]
1784 pub endCount: ::std::os::raw::c_int,
1785 #[doc = " Number of hit events"]
1786 pub hitCount: ::std::os::raw::c_int,
1787}
1788#[doc = " Body move events triggered when a body moves.\n Triggered when a body moves due to simulation. Not reported for bodies moved by the user.\n This also has a flag to indicate that the body went to sleep so the application can also\n sleep that actor/entity/object associated with the body.\n On the other hand if the flag does not indicate the body went to sleep then the application\n can treat the actor/entity/object associated with the body as awake.\n This is an efficient way for an application to update game object transforms rather than\n calling functions such as b2Body_GetTransform() because this data is delivered as a contiguous array\n and it is only populated with bodies that have moved.\n @note If sleeping is disabled all dynamic and kinematic bodies will trigger move events."]
1789#[repr(C)]
1790#[derive(Debug, Copy, Clone)]
1791pub struct b2BodyMoveEvent {
1792 pub userData: *mut ::std::os::raw::c_void,
1793 pub transform: b2Transform,
1794 pub bodyId: b2BodyId,
1795 pub fellAsleep: bool,
1796}
1797#[doc = " Body events are buffered in the Box2D world and are available\n as event arrays after the time step is complete.\n Note: this data becomes invalid if bodies are destroyed"]
1798#[repr(C)]
1799#[derive(Debug, Copy, Clone)]
1800pub struct b2BodyEvents {
1801 #[doc = " Array of move events"]
1802 pub moveEvents: *mut b2BodyMoveEvent,
1803 #[doc = " Number of move events"]
1804 pub moveCount: ::std::os::raw::c_int,
1805}
1806#[doc = " Joint events report joints that are awake and have a force and/or torque exceeding the threshold\n The observed forces and torques are not returned for efficiency reasons."]
1807#[repr(C)]
1808#[derive(Debug, Copy, Clone)]
1809pub struct b2JointEvent {
1810 #[doc = " The joint id"]
1811 pub jointId: b2JointId,
1812 #[doc = " The user data from the joint for convenience"]
1813 pub userData: *mut ::std::os::raw::c_void,
1814}
1815#[doc = " Joint events are buffered in the world and are available\n as event arrays after the time step is complete.\n Note: this data becomes invalid if joints are destroyed"]
1816#[repr(C)]
1817#[derive(Debug, Copy, Clone)]
1818pub struct b2JointEvents {
1819 #[doc = " Array of events"]
1820 pub jointEvents: *mut b2JointEvent,
1821 #[doc = " Number of events"]
1822 pub count: ::std::os::raw::c_int,
1823}
1824#[doc = " The contact data for two shapes. By convention the manifold normal points\n from shape A to shape B.\n @see b2Shape_GetContactData() and b2Body_GetContactData()"]
1825#[repr(C)]
1826#[derive(Debug, Copy, Clone)]
1827pub struct b2ContactData {
1828 pub contactId: b2ContactId,
1829 pub shapeIdA: b2ShapeId,
1830 pub shapeIdB: b2ShapeId,
1831 pub manifold: b2Manifold,
1832}
1833#[doc = " Prototype for a contact filter callback.\n This is called when a contact pair is considered for collision. This allows you to\n perform custom logic to prevent collision between shapes. This is only called if\n one of the two shapes has custom filtering enabled.\n Notes:\n - this function must be thread-safe\n - this is only called if one of the two shapes has enabled custom filtering\n - this may be called for awake dynamic bodies and sensors\n Return false if you want to disable the collision\n @see b2ShapeDef\n @warning Do not attempt to modify the world inside this callback\n @ingroup world"]
1834pub type b2CustomFilterFcn = ::std::option::Option<
1835 unsafe extern "C" fn(
1836 shapeIdA: b2ShapeId,
1837 shapeIdB: b2ShapeId,
1838 context: *mut ::std::os::raw::c_void,
1839 ) -> bool,
1840>;
1841#[doc = " Prototype for a pre-solve callback.\n This is called after a contact is updated. This allows you to inspect a\n contact before it goes to the solver. If you are careful, you can modify the\n contact manifold (e.g. modify the normal).\n Notes:\n - this function must be thread-safe\n - this is only called if the shape has enabled pre-solve events\n - this is called only for awake dynamic bodies\n - this is not called for sensors\n - the supplied manifold has impulse values from the previous step\n Return false if you want to disable the contact this step\n @warning Do not attempt to modify the world inside this callback\n @ingroup world"]
1842pub type b2PreSolveFcn = ::std::option::Option<
1843 unsafe extern "C" fn(
1844 shapeIdA: b2ShapeId,
1845 shapeIdB: b2ShapeId,
1846 point: b2Vec2,
1847 normal: b2Vec2,
1848 context: *mut ::std::os::raw::c_void,
1849 ) -> bool,
1850>;
1851#[doc = " Prototype callback for overlap queries.\n Called for each shape found in the query.\n @see b2World_OverlapABB\n @return false to terminate the query.\n @ingroup world"]
1852pub type b2OverlapResultFcn = ::std::option::Option<
1853 unsafe extern "C" fn(shapeId: b2ShapeId, context: *mut ::std::os::raw::c_void) -> bool,
1854>;
1855#[doc = " Prototype callback for ray and shape casts.\n Called for each shape found in the query. You control how the ray cast\n proceeds by returning a float:\n return -1: ignore this shape and continue\n return 0: terminate the ray cast\n return fraction: clip the ray to this point\n return 1: don't clip the ray and continue\n A cast with initial overlap will return a zero fraction and a zero normal.\n @param shapeId the shape hit by the ray\n @param point the point of initial intersection\n @param normal the normal vector at the point of intersection, zero for a shape cast with initial overlap\n @param fraction the fraction along the ray at the point of intersection, zero for a shape cast with initial overlap\n @param context the user context\n @return -1 to filter, 0 to terminate, fraction to clip the ray for closest hit, 1 to continue\n @see b2World_CastRay\n @ingroup world"]
1856pub type b2CastResultFcn = ::std::option::Option<
1857 unsafe extern "C" fn(
1858 shapeId: b2ShapeId,
1859 point: b2Vec2,
1860 normal: b2Vec2,
1861 fraction: f32,
1862 context: *mut ::std::os::raw::c_void,
1863 ) -> f32,
1864>;
1865pub type b2PlaneResultFcn = ::std::option::Option<
1866 unsafe extern "C" fn(
1867 shapeId: b2ShapeId,
1868 plane: *const b2PlaneResult,
1869 context: *mut ::std::os::raw::c_void,
1870 ) -> bool,
1871>;
1872pub const b2HexColor_b2_colorAliceBlue: b2HexColor = 15792383;
1873pub const b2HexColor_b2_colorAntiqueWhite: b2HexColor = 16444375;
1874pub const b2HexColor_b2_colorAqua: b2HexColor = 65535;
1875pub const b2HexColor_b2_colorAquamarine: b2HexColor = 8388564;
1876pub const b2HexColor_b2_colorAzure: b2HexColor = 15794175;
1877pub const b2HexColor_b2_colorBeige: b2HexColor = 16119260;
1878pub const b2HexColor_b2_colorBisque: b2HexColor = 16770244;
1879pub const b2HexColor_b2_colorBlack: b2HexColor = 0;
1880pub const b2HexColor_b2_colorBlanchedAlmond: b2HexColor = 16772045;
1881pub const b2HexColor_b2_colorBlue: b2HexColor = 255;
1882pub const b2HexColor_b2_colorBlueViolet: b2HexColor = 9055202;
1883pub const b2HexColor_b2_colorBrown: b2HexColor = 10824234;
1884pub const b2HexColor_b2_colorBurlywood: b2HexColor = 14596231;
1885pub const b2HexColor_b2_colorCadetBlue: b2HexColor = 6266528;
1886pub const b2HexColor_b2_colorChartreuse: b2HexColor = 8388352;
1887pub const b2HexColor_b2_colorChocolate: b2HexColor = 13789470;
1888pub const b2HexColor_b2_colorCoral: b2HexColor = 16744272;
1889pub const b2HexColor_b2_colorCornflowerBlue: b2HexColor = 6591981;
1890pub const b2HexColor_b2_colorCornsilk: b2HexColor = 16775388;
1891pub const b2HexColor_b2_colorCrimson: b2HexColor = 14423100;
1892pub const b2HexColor_b2_colorCyan: b2HexColor = 65535;
1893pub const b2HexColor_b2_colorDarkBlue: b2HexColor = 139;
1894pub const b2HexColor_b2_colorDarkCyan: b2HexColor = 35723;
1895pub const b2HexColor_b2_colorDarkGoldenRod: b2HexColor = 12092939;
1896pub const b2HexColor_b2_colorDarkGray: b2HexColor = 11119017;
1897pub const b2HexColor_b2_colorDarkGreen: b2HexColor = 25600;
1898pub const b2HexColor_b2_colorDarkKhaki: b2HexColor = 12433259;
1899pub const b2HexColor_b2_colorDarkMagenta: b2HexColor = 9109643;
1900pub const b2HexColor_b2_colorDarkOliveGreen: b2HexColor = 5597999;
1901pub const b2HexColor_b2_colorDarkOrange: b2HexColor = 16747520;
1902pub const b2HexColor_b2_colorDarkOrchid: b2HexColor = 10040012;
1903pub const b2HexColor_b2_colorDarkRed: b2HexColor = 9109504;
1904pub const b2HexColor_b2_colorDarkSalmon: b2HexColor = 15308410;
1905pub const b2HexColor_b2_colorDarkSeaGreen: b2HexColor = 9419919;
1906pub const b2HexColor_b2_colorDarkSlateBlue: b2HexColor = 4734347;
1907pub const b2HexColor_b2_colorDarkSlateGray: b2HexColor = 3100495;
1908pub const b2HexColor_b2_colorDarkTurquoise: b2HexColor = 52945;
1909pub const b2HexColor_b2_colorDarkViolet: b2HexColor = 9699539;
1910pub const b2HexColor_b2_colorDeepPink: b2HexColor = 16716947;
1911pub const b2HexColor_b2_colorDeepSkyBlue: b2HexColor = 49151;
1912pub const b2HexColor_b2_colorDimGray: b2HexColor = 6908265;
1913pub const b2HexColor_b2_colorDodgerBlue: b2HexColor = 2003199;
1914pub const b2HexColor_b2_colorFireBrick: b2HexColor = 11674146;
1915pub const b2HexColor_b2_colorFloralWhite: b2HexColor = 16775920;
1916pub const b2HexColor_b2_colorForestGreen: b2HexColor = 2263842;
1917pub const b2HexColor_b2_colorFuchsia: b2HexColor = 16711935;
1918pub const b2HexColor_b2_colorGainsboro: b2HexColor = 14474460;
1919pub const b2HexColor_b2_colorGhostWhite: b2HexColor = 16316671;
1920pub const b2HexColor_b2_colorGold: b2HexColor = 16766720;
1921pub const b2HexColor_b2_colorGoldenRod: b2HexColor = 14329120;
1922pub const b2HexColor_b2_colorGray: b2HexColor = 8421504;
1923pub const b2HexColor_b2_colorGreen: b2HexColor = 32768;
1924pub const b2HexColor_b2_colorGreenYellow: b2HexColor = 11403055;
1925pub const b2HexColor_b2_colorHoneyDew: b2HexColor = 15794160;
1926pub const b2HexColor_b2_colorHotPink: b2HexColor = 16738740;
1927pub const b2HexColor_b2_colorIndianRed: b2HexColor = 13458524;
1928pub const b2HexColor_b2_colorIndigo: b2HexColor = 4915330;
1929pub const b2HexColor_b2_colorIvory: b2HexColor = 16777200;
1930pub const b2HexColor_b2_colorKhaki: b2HexColor = 15787660;
1931pub const b2HexColor_b2_colorLavender: b2HexColor = 15132410;
1932pub const b2HexColor_b2_colorLavenderBlush: b2HexColor = 16773365;
1933pub const b2HexColor_b2_colorLawnGreen: b2HexColor = 8190976;
1934pub const b2HexColor_b2_colorLemonChiffon: b2HexColor = 16775885;
1935pub const b2HexColor_b2_colorLightBlue: b2HexColor = 11393254;
1936pub const b2HexColor_b2_colorLightCoral: b2HexColor = 15761536;
1937pub const b2HexColor_b2_colorLightCyan: b2HexColor = 14745599;
1938pub const b2HexColor_b2_colorLightGoldenRodYellow: b2HexColor = 16448210;
1939pub const b2HexColor_b2_colorLightGray: b2HexColor = 13882323;
1940pub const b2HexColor_b2_colorLightGreen: b2HexColor = 9498256;
1941pub const b2HexColor_b2_colorLightPink: b2HexColor = 16758465;
1942pub const b2HexColor_b2_colorLightSalmon: b2HexColor = 16752762;
1943pub const b2HexColor_b2_colorLightSeaGreen: b2HexColor = 2142890;
1944pub const b2HexColor_b2_colorLightSkyBlue: b2HexColor = 8900346;
1945pub const b2HexColor_b2_colorLightSlateGray: b2HexColor = 7833753;
1946pub const b2HexColor_b2_colorLightSteelBlue: b2HexColor = 11584734;
1947pub const b2HexColor_b2_colorLightYellow: b2HexColor = 16777184;
1948pub const b2HexColor_b2_colorLime: b2HexColor = 65280;
1949pub const b2HexColor_b2_colorLimeGreen: b2HexColor = 3329330;
1950pub const b2HexColor_b2_colorLinen: b2HexColor = 16445670;
1951pub const b2HexColor_b2_colorMagenta: b2HexColor = 16711935;
1952pub const b2HexColor_b2_colorMaroon: b2HexColor = 8388608;
1953pub const b2HexColor_b2_colorMediumAquaMarine: b2HexColor = 6737322;
1954pub const b2HexColor_b2_colorMediumBlue: b2HexColor = 205;
1955pub const b2HexColor_b2_colorMediumOrchid: b2HexColor = 12211667;
1956pub const b2HexColor_b2_colorMediumPurple: b2HexColor = 9662683;
1957pub const b2HexColor_b2_colorMediumSeaGreen: b2HexColor = 3978097;
1958pub const b2HexColor_b2_colorMediumSlateBlue: b2HexColor = 8087790;
1959pub const b2HexColor_b2_colorMediumSpringGreen: b2HexColor = 64154;
1960pub const b2HexColor_b2_colorMediumTurquoise: b2HexColor = 4772300;
1961pub const b2HexColor_b2_colorMediumVioletRed: b2HexColor = 13047173;
1962pub const b2HexColor_b2_colorMidnightBlue: b2HexColor = 1644912;
1963pub const b2HexColor_b2_colorMintCream: b2HexColor = 16121850;
1964pub const b2HexColor_b2_colorMistyRose: b2HexColor = 16770273;
1965pub const b2HexColor_b2_colorMoccasin: b2HexColor = 16770229;
1966pub const b2HexColor_b2_colorNavajoWhite: b2HexColor = 16768685;
1967pub const b2HexColor_b2_colorNavy: b2HexColor = 128;
1968pub const b2HexColor_b2_colorOldLace: b2HexColor = 16643558;
1969pub const b2HexColor_b2_colorOlive: b2HexColor = 8421376;
1970pub const b2HexColor_b2_colorOliveDrab: b2HexColor = 7048739;
1971pub const b2HexColor_b2_colorOrange: b2HexColor = 16753920;
1972pub const b2HexColor_b2_colorOrangeRed: b2HexColor = 16729344;
1973pub const b2HexColor_b2_colorOrchid: b2HexColor = 14315734;
1974pub const b2HexColor_b2_colorPaleGoldenRod: b2HexColor = 15657130;
1975pub const b2HexColor_b2_colorPaleGreen: b2HexColor = 10025880;
1976pub const b2HexColor_b2_colorPaleTurquoise: b2HexColor = 11529966;
1977pub const b2HexColor_b2_colorPaleVioletRed: b2HexColor = 14381203;
1978pub const b2HexColor_b2_colorPapayaWhip: b2HexColor = 16773077;
1979pub const b2HexColor_b2_colorPeachPuff: b2HexColor = 16767673;
1980pub const b2HexColor_b2_colorPeru: b2HexColor = 13468991;
1981pub const b2HexColor_b2_colorPink: b2HexColor = 16761035;
1982pub const b2HexColor_b2_colorPlum: b2HexColor = 14524637;
1983pub const b2HexColor_b2_colorPowderBlue: b2HexColor = 11591910;
1984pub const b2HexColor_b2_colorPurple: b2HexColor = 8388736;
1985pub const b2HexColor_b2_colorRebeccaPurple: b2HexColor = 6697881;
1986pub const b2HexColor_b2_colorRed: b2HexColor = 16711680;
1987pub const b2HexColor_b2_colorRosyBrown: b2HexColor = 12357519;
1988pub const b2HexColor_b2_colorRoyalBlue: b2HexColor = 4286945;
1989pub const b2HexColor_b2_colorSaddleBrown: b2HexColor = 9127187;
1990pub const b2HexColor_b2_colorSalmon: b2HexColor = 16416882;
1991pub const b2HexColor_b2_colorSandyBrown: b2HexColor = 16032864;
1992pub const b2HexColor_b2_colorSeaGreen: b2HexColor = 3050327;
1993pub const b2HexColor_b2_colorSeaShell: b2HexColor = 16774638;
1994pub const b2HexColor_b2_colorSienna: b2HexColor = 10506797;
1995pub const b2HexColor_b2_colorSilver: b2HexColor = 12632256;
1996pub const b2HexColor_b2_colorSkyBlue: b2HexColor = 8900331;
1997pub const b2HexColor_b2_colorSlateBlue: b2HexColor = 6970061;
1998pub const b2HexColor_b2_colorSlateGray: b2HexColor = 7372944;
1999pub const b2HexColor_b2_colorSnow: b2HexColor = 16775930;
2000pub const b2HexColor_b2_colorSpringGreen: b2HexColor = 65407;
2001pub const b2HexColor_b2_colorSteelBlue: b2HexColor = 4620980;
2002pub const b2HexColor_b2_colorTan: b2HexColor = 13808780;
2003pub const b2HexColor_b2_colorTeal: b2HexColor = 32896;
2004pub const b2HexColor_b2_colorThistle: b2HexColor = 14204888;
2005pub const b2HexColor_b2_colorTomato: b2HexColor = 16737095;
2006pub const b2HexColor_b2_colorTurquoise: b2HexColor = 4251856;
2007pub const b2HexColor_b2_colorViolet: b2HexColor = 15631086;
2008pub const b2HexColor_b2_colorWheat: b2HexColor = 16113331;
2009pub const b2HexColor_b2_colorWhite: b2HexColor = 16777215;
2010pub const b2HexColor_b2_colorWhiteSmoke: b2HexColor = 16119285;
2011pub const b2HexColor_b2_colorYellow: b2HexColor = 16776960;
2012pub const b2HexColor_b2_colorYellowGreen: b2HexColor = 10145074;
2013pub const b2HexColor_b2_colorBox2DRed: b2HexColor = 14430514;
2014pub const b2HexColor_b2_colorBox2DBlue: b2HexColor = 3190463;
2015pub const b2HexColor_b2_colorBox2DGreen: b2HexColor = 9226532;
2016pub const b2HexColor_b2_colorBox2DYellow: b2HexColor = 16772748;
2017#[doc = " These colors are used for debug draw and mostly match the named SVG colors.\n See https://www.rapidtables.com/web/color/index.html\n https://johndecember.com/html/spec/colorsvg.html\n https://upload.wikimedia.org/wikipedia/commons/2/2b/SVG_Recognized_color_keyword_names.svg"]
2018pub type b2HexColor = ::std::os::raw::c_int;
2019#[doc = " This struct holds callbacks you can implement to draw a Box2D world.\n This structure should be zero initialized.\n @ingroup world"]
2020#[repr(C)]
2021#[derive(Debug, Copy, Clone)]
2022pub struct b2DebugDraw {
2023 #[doc = " Draw a closed polygon provided in CCW order."]
2024 pub DrawPolygonFcn: ::std::option::Option<
2025 unsafe extern "C" fn(
2026 vertices: *const b2Vec2,
2027 vertexCount: ::std::os::raw::c_int,
2028 color: b2HexColor,
2029 context: *mut ::std::os::raw::c_void,
2030 ),
2031 >,
2032 #[doc = " Draw a solid closed polygon provided in CCW order."]
2033 pub DrawSolidPolygonFcn: ::std::option::Option<
2034 unsafe extern "C" fn(
2035 transform: b2Transform,
2036 vertices: *const b2Vec2,
2037 vertexCount: ::std::os::raw::c_int,
2038 radius: f32,
2039 color: b2HexColor,
2040 context: *mut ::std::os::raw::c_void,
2041 ),
2042 >,
2043 #[doc = " Draw a circle."]
2044 pub DrawCircleFcn: ::std::option::Option<
2045 unsafe extern "C" fn(
2046 center: b2Vec2,
2047 radius: f32,
2048 color: b2HexColor,
2049 context: *mut ::std::os::raw::c_void,
2050 ),
2051 >,
2052 #[doc = " Draw a solid circle."]
2053 pub DrawSolidCircleFcn: ::std::option::Option<
2054 unsafe extern "C" fn(
2055 transform: b2Transform,
2056 radius: f32,
2057 color: b2HexColor,
2058 context: *mut ::std::os::raw::c_void,
2059 ),
2060 >,
2061 #[doc = " Draw a solid capsule."]
2062 pub DrawSolidCapsuleFcn: ::std::option::Option<
2063 unsafe extern "C" fn(
2064 p1: b2Vec2,
2065 p2: b2Vec2,
2066 radius: f32,
2067 color: b2HexColor,
2068 context: *mut ::std::os::raw::c_void,
2069 ),
2070 >,
2071 #[doc = " Draw a line segment."]
2072 pub DrawSegmentFcn: ::std::option::Option<
2073 unsafe extern "C" fn(
2074 p1: b2Vec2,
2075 p2: b2Vec2,
2076 color: b2HexColor,
2077 context: *mut ::std::os::raw::c_void,
2078 ),
2079 >,
2080 #[doc = " Draw a transform. Choose your own length scale."]
2081 pub DrawTransformFcn: ::std::option::Option<
2082 unsafe extern "C" fn(transform: b2Transform, context: *mut ::std::os::raw::c_void),
2083 >,
2084 #[doc = " Draw a point."]
2085 pub DrawPointFcn: ::std::option::Option<
2086 unsafe extern "C" fn(
2087 p: b2Vec2,
2088 size: f32,
2089 color: b2HexColor,
2090 context: *mut ::std::os::raw::c_void,
2091 ),
2092 >,
2093 #[doc = " Draw a string in world space"]
2094 pub DrawStringFcn: ::std::option::Option<
2095 unsafe extern "C" fn(
2096 p: b2Vec2,
2097 s: *const ::std::os::raw::c_char,
2098 color: b2HexColor,
2099 context: *mut ::std::os::raw::c_void,
2100 ),
2101 >,
2102 #[doc = " World bounds to use for debug draw"]
2103 pub drawingBounds: b2AABB,
2104 #[doc = " Scale to use when drawing forces"]
2105 pub forceScale: f32,
2106 #[doc = " Global scaling for joint drawing"]
2107 pub jointScale: f32,
2108 #[doc = " Option to draw shapes"]
2109 pub drawShapes: bool,
2110 #[doc = " Option to draw joints"]
2111 pub drawJoints: bool,
2112 #[doc = " Option to draw additional information for joints"]
2113 pub drawJointExtras: bool,
2114 #[doc = " Option to draw the bounding boxes for shapes"]
2115 pub drawBounds: bool,
2116 #[doc = " Option to draw the mass and center of mass of dynamic bodies"]
2117 pub drawMass: bool,
2118 #[doc = " Option to draw body names"]
2119 pub drawBodyNames: bool,
2120 #[doc = " Option to draw contact points"]
2121 pub drawContacts: bool,
2122 #[doc = " Option to visualize the graph coloring used for contacts and joints"]
2123 pub drawGraphColors: bool,
2124 #[doc = " Option to draw contact feature ids"]
2125 pub drawContactFeatures: bool,
2126 #[doc = " Option to draw contact normals"]
2127 pub drawContactNormals: bool,
2128 #[doc = " Option to draw contact normal forces"]
2129 pub drawContactForces: bool,
2130 #[doc = " Option to draw contact friction forces"]
2131 pub drawFrictionForces: bool,
2132 #[doc = " Option to draw islands as bounding boxes"]
2133 pub drawIslands: bool,
2134 #[doc = " User context that is passed as an argument to drawing callback functions"]
2135 pub context: *mut ::std::os::raw::c_void,
2136}
2137unsafe extern "C" {
2138 #[doc = " Use this to initialize your drawing interface. This allows you to implement a sub-set\n of the drawing functions."]
2139 pub fn b2DefaultDebugDraw() -> b2DebugDraw;
2140}
2141unsafe extern "C" {
2142 #[doc = " Create a world for rigid body simulation. A world contains bodies, shapes, and constraints. You make create\n up to 128 worlds. Each world is completely independent and may be simulated in parallel.\n @return the world id."]
2143 pub fn b2CreateWorld(def: *const b2WorldDef) -> b2WorldId;
2144}
2145unsafe extern "C" {
2146 #[doc = " Destroy a world"]
2147 pub fn b2DestroyWorld(worldId: b2WorldId);
2148}
2149unsafe extern "C" {
2150 #[doc = " World id validation. Provides validation for up to 64K allocations."]
2151 pub fn b2World_IsValid(id: b2WorldId) -> bool;
2152}
2153unsafe extern "C" {
2154 #[doc = " Simulate a world for one time step. This performs collision detection, integration, and constraint solution.\n @param worldId The world to simulate\n @param timeStep The amount of time to simulate, this should be a fixed number. Usually 1/60.\n @param subStepCount The number of sub-steps, increasing the sub-step count can increase accuracy. Usually 4."]
2155 pub fn b2World_Step(worldId: b2WorldId, timeStep: f32, subStepCount: ::std::os::raw::c_int);
2156}
2157unsafe extern "C" {
2158 #[doc = " Call this to draw shapes and other debug draw data"]
2159 pub fn b2World_Draw(worldId: b2WorldId, draw: *mut b2DebugDraw);
2160}
2161unsafe extern "C" {
2162 #[doc = " Get the body events for the current time step. The event data is transient. Do not store a reference to this data."]
2163 pub fn b2World_GetBodyEvents(worldId: b2WorldId) -> b2BodyEvents;
2164}
2165unsafe extern "C" {
2166 #[doc = " Get sensor events for the current time step. The event data is transient. Do not store a reference to this data."]
2167 pub fn b2World_GetSensorEvents(worldId: b2WorldId) -> b2SensorEvents;
2168}
2169unsafe extern "C" {
2170 #[doc = " Get contact events for this current time step. The event data is transient. Do not store a reference to this data."]
2171 pub fn b2World_GetContactEvents(worldId: b2WorldId) -> b2ContactEvents;
2172}
2173unsafe extern "C" {
2174 #[doc = " Get the joint events for the current time step. The event data is transient. Do not store a reference to this data."]
2175 pub fn b2World_GetJointEvents(worldId: b2WorldId) -> b2JointEvents;
2176}
2177unsafe extern "C" {
2178 #[doc = " Overlap test for all shapes that *potentially* overlap the provided AABB"]
2179 pub fn b2World_OverlapAABB(
2180 worldId: b2WorldId,
2181 aabb: b2AABB,
2182 filter: b2QueryFilter,
2183 fcn: b2OverlapResultFcn,
2184 context: *mut ::std::os::raw::c_void,
2185 ) -> b2TreeStats;
2186}
2187unsafe extern "C" {
2188 #[doc = " Overlap test for all shapes that overlap the provided shape proxy."]
2189 pub fn b2World_OverlapShape(
2190 worldId: b2WorldId,
2191 proxy: *const b2ShapeProxy,
2192 filter: b2QueryFilter,
2193 fcn: b2OverlapResultFcn,
2194 context: *mut ::std::os::raw::c_void,
2195 ) -> b2TreeStats;
2196}
2197unsafe extern "C" {
2198 #[doc = " Cast a ray into the world to collect shapes in the path of the ray.\n Your callback function controls whether you get the closest point, any point, or n-points.\n @note The callback function may receive shapes in any order\n @param worldId The world to cast the ray against\n @param origin The start point of the ray\n @param translation The translation of the ray from the start point to the end point\n @param filter Contains bit flags to filter unwanted shapes from the results\n @param fcn A user implemented callback function\n @param context A user context that is passed along to the callback function\n\t@return traversal performance counters"]
2199 pub fn b2World_CastRay(
2200 worldId: b2WorldId,
2201 origin: b2Vec2,
2202 translation: b2Vec2,
2203 filter: b2QueryFilter,
2204 fcn: b2CastResultFcn,
2205 context: *mut ::std::os::raw::c_void,
2206 ) -> b2TreeStats;
2207}
2208unsafe extern "C" {
2209 #[doc = " Cast a ray into the world to collect the closest hit. This is a convenience function. Ignores initial overlap.\n This is less general than b2World_CastRay() and does not allow for custom filtering."]
2210 pub fn b2World_CastRayClosest(
2211 worldId: b2WorldId,
2212 origin: b2Vec2,
2213 translation: b2Vec2,
2214 filter: b2QueryFilter,
2215 ) -> b2RayResult;
2216}
2217unsafe extern "C" {
2218 #[doc = " Cast a shape through the world. Similar to a cast ray except that a shape is cast instead of a point.\n\t@see b2World_CastRay"]
2219 pub fn b2World_CastShape(
2220 worldId: b2WorldId,
2221 proxy: *const b2ShapeProxy,
2222 translation: b2Vec2,
2223 filter: b2QueryFilter,
2224 fcn: b2CastResultFcn,
2225 context: *mut ::std::os::raw::c_void,
2226 ) -> b2TreeStats;
2227}
2228unsafe extern "C" {
2229 #[doc = " Cast a capsule mover through the world. This is a special shape cast that handles sliding along other shapes while reducing\n clipping."]
2230 pub fn b2World_CastMover(
2231 worldId: b2WorldId,
2232 mover: *const b2Capsule,
2233 translation: b2Vec2,
2234 filter: b2QueryFilter,
2235 ) -> f32;
2236}
2237unsafe extern "C" {
2238 #[doc = " Collide a capsule mover with the world, gathering collision planes that can be fed to b2SolvePlanes. Useful for\n kinematic character movement."]
2239 pub fn b2World_CollideMover(
2240 worldId: b2WorldId,
2241 mover: *const b2Capsule,
2242 filter: b2QueryFilter,
2243 fcn: b2PlaneResultFcn,
2244 context: *mut ::std::os::raw::c_void,
2245 );
2246}
2247unsafe extern "C" {
2248 #[doc = " Enable/disable sleep. If your application does not need sleeping, you can gain some performance\n by disabling sleep completely at the world level.\n @see b2WorldDef"]
2249 pub fn b2World_EnableSleeping(worldId: b2WorldId, flag: bool);
2250}
2251unsafe extern "C" {
2252 #[doc = " Is body sleeping enabled?"]
2253 pub fn b2World_IsSleepingEnabled(worldId: b2WorldId) -> bool;
2254}
2255unsafe extern "C" {
2256 #[doc = " Enable/disable continuous collision between dynamic and static bodies. Generally you should keep continuous\n collision enabled to prevent fast moving objects from going through static objects. The performance gain from\n disabling continuous collision is minor.\n @see b2WorldDef"]
2257 pub fn b2World_EnableContinuous(worldId: b2WorldId, flag: bool);
2258}
2259unsafe extern "C" {
2260 #[doc = " Is continuous collision enabled?"]
2261 pub fn b2World_IsContinuousEnabled(worldId: b2WorldId) -> bool;
2262}
2263unsafe extern "C" {
2264 #[doc = " Adjust the restitution threshold. It is recommended not to make this value very small\n because it will prevent bodies from sleeping. Usually in meters per second.\n @see b2WorldDef"]
2265 pub fn b2World_SetRestitutionThreshold(worldId: b2WorldId, value: f32);
2266}
2267unsafe extern "C" {
2268 #[doc = " Get the the restitution speed threshold. Usually in meters per second."]
2269 pub fn b2World_GetRestitutionThreshold(worldId: b2WorldId) -> f32;
2270}
2271unsafe extern "C" {
2272 #[doc = " Adjust the hit event threshold. This controls the collision speed needed to generate a b2ContactHitEvent.\n Usually in meters per second.\n @see b2WorldDef::hitEventThreshold"]
2273 pub fn b2World_SetHitEventThreshold(worldId: b2WorldId, value: f32);
2274}
2275unsafe extern "C" {
2276 #[doc = " Get the the hit event speed threshold. Usually in meters per second."]
2277 pub fn b2World_GetHitEventThreshold(worldId: b2WorldId) -> f32;
2278}
2279unsafe extern "C" {
2280 #[doc = " Register the custom filter callback. This is optional."]
2281 pub fn b2World_SetCustomFilterCallback(
2282 worldId: b2WorldId,
2283 fcn: b2CustomFilterFcn,
2284 context: *mut ::std::os::raw::c_void,
2285 );
2286}
2287unsafe extern "C" {
2288 #[doc = " Register the pre-solve callback. This is optional."]
2289 pub fn b2World_SetPreSolveCallback(
2290 worldId: b2WorldId,
2291 fcn: b2PreSolveFcn,
2292 context: *mut ::std::os::raw::c_void,
2293 );
2294}
2295unsafe extern "C" {
2296 #[doc = " Set the gravity vector for the entire world. Box2D has no concept of an up direction and this\n is left as a decision for the application. Usually in m/s^2.\n @see b2WorldDef"]
2297 pub fn b2World_SetGravity(worldId: b2WorldId, gravity: b2Vec2);
2298}
2299unsafe extern "C" {
2300 #[doc = " Get the gravity vector"]
2301 pub fn b2World_GetGravity(worldId: b2WorldId) -> b2Vec2;
2302}
2303unsafe extern "C" {
2304 #[doc = " Apply a radial explosion\n @param worldId The world id\n @param explosionDef The explosion definition"]
2305 pub fn b2World_Explode(worldId: b2WorldId, explosionDef: *const b2ExplosionDef);
2306}
2307unsafe extern "C" {
2308 #[doc = " Adjust contact tuning parameters\n @param worldId The world id\n @param hertz The contact stiffness (cycles per second)\n @param dampingRatio The contact bounciness with 1 being critical damping (non-dimensional)\n @param pushSpeed The maximum contact constraint push out speed (meters per second)\n @note Advanced feature"]
2309 pub fn b2World_SetContactTuning(
2310 worldId: b2WorldId,
2311 hertz: f32,
2312 dampingRatio: f32,
2313 pushSpeed: f32,
2314 );
2315}
2316unsafe extern "C" {
2317 #[doc = " Set the maximum linear speed. Usually in m/s."]
2318 pub fn b2World_SetMaximumLinearSpeed(worldId: b2WorldId, maximumLinearSpeed: f32);
2319}
2320unsafe extern "C" {
2321 #[doc = " Get the maximum linear speed. Usually in m/s."]
2322 pub fn b2World_GetMaximumLinearSpeed(worldId: b2WorldId) -> f32;
2323}
2324unsafe extern "C" {
2325 #[doc = " Enable/disable constraint warm starting. Advanced feature for testing. Disabling\n warm starting greatly reduces stability and provides no performance gain."]
2326 pub fn b2World_EnableWarmStarting(worldId: b2WorldId, flag: bool);
2327}
2328unsafe extern "C" {
2329 #[doc = " Is constraint warm starting enabled?"]
2330 pub fn b2World_IsWarmStartingEnabled(worldId: b2WorldId) -> bool;
2331}
2332unsafe extern "C" {
2333 #[doc = " Get the number of awake bodies."]
2334 pub fn b2World_GetAwakeBodyCount(worldId: b2WorldId) -> ::std::os::raw::c_int;
2335}
2336unsafe extern "C" {
2337 #[doc = " Get the current world performance profile"]
2338 pub fn b2World_GetProfile(worldId: b2WorldId) -> b2Profile;
2339}
2340unsafe extern "C" {
2341 #[doc = " Get world counters and sizes"]
2342 pub fn b2World_GetCounters(worldId: b2WorldId) -> b2Counters;
2343}
2344unsafe extern "C" {
2345 #[doc = " Set the user data pointer."]
2346 pub fn b2World_SetUserData(worldId: b2WorldId, userData: *mut ::std::os::raw::c_void);
2347}
2348unsafe extern "C" {
2349 #[doc = " Get the user data pointer."]
2350 pub fn b2World_GetUserData(worldId: b2WorldId) -> *mut ::std::os::raw::c_void;
2351}
2352unsafe extern "C" {
2353 #[doc = " Set the friction callback. Passing NULL resets to default."]
2354 pub fn b2World_SetFrictionCallback(worldId: b2WorldId, callback: b2FrictionCallback);
2355}
2356unsafe extern "C" {
2357 #[doc = " Set the restitution callback. Passing NULL resets to default."]
2358 pub fn b2World_SetRestitutionCallback(worldId: b2WorldId, callback: b2RestitutionCallback);
2359}
2360unsafe extern "C" {
2361 #[doc = " Dump memory stats to box2d_memory.txt"]
2362 pub fn b2World_DumpMemoryStats(worldId: b2WorldId);
2363}
2364unsafe extern "C" {
2365 #[doc = " This is for internal testing"]
2366 pub fn b2World_RebuildStaticTree(worldId: b2WorldId);
2367}
2368unsafe extern "C" {
2369 #[doc = " This is for internal testing"]
2370 pub fn b2World_EnableSpeculative(worldId: b2WorldId, flag: bool);
2371}
2372unsafe extern "C" {
2373 #[doc = " Create a rigid body given a definition. No reference to the definition is retained. So you can create the definition\n on the stack and pass it as a pointer.\n @code{.c}\n b2BodyDef bodyDef = b2DefaultBodyDef();\n b2BodyId myBodyId = b2CreateBody(myWorldId, &bodyDef);\n @endcode\n @warning This function is locked during callbacks."]
2374 pub fn b2CreateBody(worldId: b2WorldId, def: *const b2BodyDef) -> b2BodyId;
2375}
2376unsafe extern "C" {
2377 #[doc = " Destroy a rigid body given an id. This destroys all shapes and joints attached to the body.\n Do not keep references to the associated shapes and joints."]
2378 pub fn b2DestroyBody(bodyId: b2BodyId);
2379}
2380unsafe extern "C" {
2381 #[doc = " Body identifier validation. A valid body exists in a world and is non-null.\n This can be used to detect orphaned ids. Provides validation for up to 64K allocations."]
2382 pub fn b2Body_IsValid(id: b2BodyId) -> bool;
2383}
2384unsafe extern "C" {
2385 #[doc = " Get the body type: static, kinematic, or dynamic"]
2386 pub fn b2Body_GetType(bodyId: b2BodyId) -> b2BodyType;
2387}
2388unsafe extern "C" {
2389 #[doc = " Change the body type. This is an expensive operation. This automatically updates the mass\n properties regardless of the automatic mass setting."]
2390 pub fn b2Body_SetType(bodyId: b2BodyId, type_: b2BodyType);
2391}
2392unsafe extern "C" {
2393 #[doc = " Set the body name. Up to 31 characters excluding 0 termination."]
2394 pub fn b2Body_SetName(bodyId: b2BodyId, name: *const ::std::os::raw::c_char);
2395}
2396unsafe extern "C" {
2397 #[doc = " Get the body name."]
2398 pub fn b2Body_GetName(bodyId: b2BodyId) -> *const ::std::os::raw::c_char;
2399}
2400unsafe extern "C" {
2401 #[doc = " Set the user data for a body"]
2402 pub fn b2Body_SetUserData(bodyId: b2BodyId, userData: *mut ::std::os::raw::c_void);
2403}
2404unsafe extern "C" {
2405 #[doc = " Get the user data stored in a body"]
2406 pub fn b2Body_GetUserData(bodyId: b2BodyId) -> *mut ::std::os::raw::c_void;
2407}
2408unsafe extern "C" {
2409 #[doc = " Get the world position of a body. This is the location of the body origin."]
2410 pub fn b2Body_GetPosition(bodyId: b2BodyId) -> b2Vec2;
2411}
2412unsafe extern "C" {
2413 #[doc = " Get the world rotation of a body as a cosine/sine pair (complex number)"]
2414 pub fn b2Body_GetRotation(bodyId: b2BodyId) -> b2Rot;
2415}
2416unsafe extern "C" {
2417 #[doc = " Get the world transform of a body."]
2418 pub fn b2Body_GetTransform(bodyId: b2BodyId) -> b2Transform;
2419}
2420unsafe extern "C" {
2421 #[doc = " Set the world transform of a body. This acts as a teleport and is fairly expensive.\n @note Generally you should create a body with then intended transform.\n @see b2BodyDef::position and b2BodyDef::rotation"]
2422 pub fn b2Body_SetTransform(bodyId: b2BodyId, position: b2Vec2, rotation: b2Rot);
2423}
2424unsafe extern "C" {
2425 #[doc = " Get a local point on a body given a world point"]
2426 pub fn b2Body_GetLocalPoint(bodyId: b2BodyId, worldPoint: b2Vec2) -> b2Vec2;
2427}
2428unsafe extern "C" {
2429 #[doc = " Get a world point on a body given a local point"]
2430 pub fn b2Body_GetWorldPoint(bodyId: b2BodyId, localPoint: b2Vec2) -> b2Vec2;
2431}
2432unsafe extern "C" {
2433 #[doc = " Get a local vector on a body given a world vector"]
2434 pub fn b2Body_GetLocalVector(bodyId: b2BodyId, worldVector: b2Vec2) -> b2Vec2;
2435}
2436unsafe extern "C" {
2437 #[doc = " Get a world vector on a body given a local vector"]
2438 pub fn b2Body_GetWorldVector(bodyId: b2BodyId, localVector: b2Vec2) -> b2Vec2;
2439}
2440unsafe extern "C" {
2441 #[doc = " Get the linear velocity of a body's center of mass. Usually in meters per second."]
2442 pub fn b2Body_GetLinearVelocity(bodyId: b2BodyId) -> b2Vec2;
2443}
2444unsafe extern "C" {
2445 #[doc = " Get the angular velocity of a body in radians per second"]
2446 pub fn b2Body_GetAngularVelocity(bodyId: b2BodyId) -> f32;
2447}
2448unsafe extern "C" {
2449 #[doc = " Set the linear velocity of a body. Usually in meters per second."]
2450 pub fn b2Body_SetLinearVelocity(bodyId: b2BodyId, linearVelocity: b2Vec2);
2451}
2452unsafe extern "C" {
2453 #[doc = " Set the angular velocity of a body in radians per second"]
2454 pub fn b2Body_SetAngularVelocity(bodyId: b2BodyId, angularVelocity: f32);
2455}
2456unsafe extern "C" {
2457 #[doc = " Set the velocity to reach the given transform after a given time step.\n The result will be close but maybe not exact. This is meant for kinematic bodies.\n The target is not applied if the velocity would be below the sleep threshold.\n This will automatically wake the body if asleep."]
2458 pub fn b2Body_SetTargetTransform(bodyId: b2BodyId, target: b2Transform, timeStep: f32);
2459}
2460unsafe extern "C" {
2461 #[doc = " Get the linear velocity of a local point attached to a body. Usually in meters per second."]
2462 pub fn b2Body_GetLocalPointVelocity(bodyId: b2BodyId, localPoint: b2Vec2) -> b2Vec2;
2463}
2464unsafe extern "C" {
2465 #[doc = " Get the linear velocity of a world point attached to a body. Usually in meters per second."]
2466 pub fn b2Body_GetWorldPointVelocity(bodyId: b2BodyId, worldPoint: b2Vec2) -> b2Vec2;
2467}
2468unsafe extern "C" {
2469 #[doc = " Apply a force at a world point. If the force is not applied at the center of mass,\n it will generate a torque and affect the angular velocity. This optionally wakes up the body.\n The force is ignored if the body is not awake.\n @param bodyId The body id\n @param force The world force vector, usually in newtons (N)\n @param point The world position of the point of application\n @param wake Option to wake up the body"]
2470 pub fn b2Body_ApplyForce(bodyId: b2BodyId, force: b2Vec2, point: b2Vec2, wake: bool);
2471}
2472unsafe extern "C" {
2473 #[doc = " Apply a force to the center of mass. This optionally wakes up the body.\n The force is ignored if the body is not awake.\n @param bodyId The body id\n @param force the world force vector, usually in newtons (N).\n @param wake also wake up the body"]
2474 pub fn b2Body_ApplyForceToCenter(bodyId: b2BodyId, force: b2Vec2, wake: bool);
2475}
2476unsafe extern "C" {
2477 #[doc = " Apply a torque. This affects the angular velocity without affecting the linear velocity.\n This optionally wakes the body. The torque is ignored if the body is not awake.\n @param bodyId The body id\n @param torque about the z-axis (out of the screen), usually in N*m.\n @param wake also wake up the body"]
2478 pub fn b2Body_ApplyTorque(bodyId: b2BodyId, torque: f32, wake: bool);
2479}
2480unsafe extern "C" {
2481 #[doc = " Clear the force and torque on this body. Forces and torques are automatically cleared after each world\n step. So this only needs to be called if the application wants to remove the effect of previous\n calls to apply forces and torques before the world step is called.\n @param bodyId The body id"]
2482 pub fn b2Body_ClearForces(bodyId: b2BodyId);
2483}
2484unsafe extern "C" {
2485 #[doc = " Apply an impulse at a point. This immediately modifies the velocity.\n It also modifies the angular velocity if the point of application\n is not at the center of mass. This optionally wakes the body.\n The impulse is ignored if the body is not awake.\n @param bodyId The body id\n @param impulse the world impulse vector, usually in N*s or kg*m/s.\n @param point the world position of the point of application.\n @param wake also wake up the body\n @warning This should be used for one-shot impulses. If you need a steady force,\n use a force instead, which will work better with the sub-stepping solver."]
2486 pub fn b2Body_ApplyLinearImpulse(bodyId: b2BodyId, impulse: b2Vec2, point: b2Vec2, wake: bool);
2487}
2488unsafe extern "C" {
2489 #[doc = " Apply an impulse to the center of mass. This immediately modifies the velocity.\n The impulse is ignored if the body is not awake. This optionally wakes the body.\n @param bodyId The body id\n @param impulse the world impulse vector, usually in N*s or kg*m/s.\n @param wake also wake up the body\n @warning This should be used for one-shot impulses. If you need a steady force,\n use a force instead, which will work better with the sub-stepping solver."]
2490 pub fn b2Body_ApplyLinearImpulseToCenter(bodyId: b2BodyId, impulse: b2Vec2, wake: bool);
2491}
2492unsafe extern "C" {
2493 #[doc = " Apply an angular impulse. The impulse is ignored if the body is not awake.\n This optionally wakes the body.\n @param bodyId The body id\n @param impulse the angular impulse, usually in units of kg*m*m/s\n @param wake also wake up the body\n @warning This should be used for one-shot impulses. If you need a steady torque,\n use a torque instead, which will work better with the sub-stepping solver."]
2494 pub fn b2Body_ApplyAngularImpulse(bodyId: b2BodyId, impulse: f32, wake: bool);
2495}
2496unsafe extern "C" {
2497 #[doc = " Get the mass of the body, usually in kilograms"]
2498 pub fn b2Body_GetMass(bodyId: b2BodyId) -> f32;
2499}
2500unsafe extern "C" {
2501 #[doc = " Get the rotational inertia of the body, usually in kg*m^2"]
2502 pub fn b2Body_GetRotationalInertia(bodyId: b2BodyId) -> f32;
2503}
2504unsafe extern "C" {
2505 #[doc = " Get the center of mass position of the body in local space"]
2506 pub fn b2Body_GetLocalCenterOfMass(bodyId: b2BodyId) -> b2Vec2;
2507}
2508unsafe extern "C" {
2509 #[doc = " Get the center of mass position of the body in world space"]
2510 pub fn b2Body_GetWorldCenterOfMass(bodyId: b2BodyId) -> b2Vec2;
2511}
2512unsafe extern "C" {
2513 #[doc = " Override the body's mass properties. Normally this is computed automatically using the\n shape geometry and density. This information is lost if a shape is added or removed or if the\n body type changes."]
2514 pub fn b2Body_SetMassData(bodyId: b2BodyId, massData: b2MassData);
2515}
2516unsafe extern "C" {
2517 #[doc = " Get the mass data for a body"]
2518 pub fn b2Body_GetMassData(bodyId: b2BodyId) -> b2MassData;
2519}
2520unsafe extern "C" {
2521 #[doc = " This update the mass properties to the sum of the mass properties of the shapes.\n This normally does not need to be called unless you called SetMassData to override\n the mass and you later want to reset the mass.\n You may also use this when automatic mass computation has been disabled.\n You should call this regardless of body type.\n Note that sensor shapes may have mass."]
2522 pub fn b2Body_ApplyMassFromShapes(bodyId: b2BodyId);
2523}
2524unsafe extern "C" {
2525 #[doc = " Adjust the linear damping. Normally this is set in b2BodyDef before creation."]
2526 pub fn b2Body_SetLinearDamping(bodyId: b2BodyId, linearDamping: f32);
2527}
2528unsafe extern "C" {
2529 #[doc = " Get the current linear damping."]
2530 pub fn b2Body_GetLinearDamping(bodyId: b2BodyId) -> f32;
2531}
2532unsafe extern "C" {
2533 #[doc = " Adjust the angular damping. Normally this is set in b2BodyDef before creation."]
2534 pub fn b2Body_SetAngularDamping(bodyId: b2BodyId, angularDamping: f32);
2535}
2536unsafe extern "C" {
2537 #[doc = " Get the current angular damping."]
2538 pub fn b2Body_GetAngularDamping(bodyId: b2BodyId) -> f32;
2539}
2540unsafe extern "C" {
2541 #[doc = " Adjust the gravity scale. Normally this is set in b2BodyDef before creation.\n @see b2BodyDef::gravityScale"]
2542 pub fn b2Body_SetGravityScale(bodyId: b2BodyId, gravityScale: f32);
2543}
2544unsafe extern "C" {
2545 #[doc = " Get the current gravity scale"]
2546 pub fn b2Body_GetGravityScale(bodyId: b2BodyId) -> f32;
2547}
2548unsafe extern "C" {
2549 #[doc = " @return true if this body is awake"]
2550 pub fn b2Body_IsAwake(bodyId: b2BodyId) -> bool;
2551}
2552unsafe extern "C" {
2553 #[doc = " Wake a body from sleep. This wakes the entire island the body is touching.\n @warning Putting a body to sleep will put the entire island of bodies touching this body to sleep,\n which can be expensive and possibly unintuitive."]
2554 pub fn b2Body_SetAwake(bodyId: b2BodyId, awake: bool);
2555}
2556unsafe extern "C" {
2557 #[doc = " Wake bodies touching this body. Works for static bodies."]
2558 pub fn b2Body_WakeTouching(bodyId: b2BodyId);
2559}
2560unsafe extern "C" {
2561 #[doc = " Enable or disable sleeping for this body. If sleeping is disabled the body will wake."]
2562 pub fn b2Body_EnableSleep(bodyId: b2BodyId, enableSleep: bool);
2563}
2564unsafe extern "C" {
2565 #[doc = " Returns true if sleeping is enabled for this body"]
2566 pub fn b2Body_IsSleepEnabled(bodyId: b2BodyId) -> bool;
2567}
2568unsafe extern "C" {
2569 #[doc = " Set the sleep threshold, usually in meters per second"]
2570 pub fn b2Body_SetSleepThreshold(bodyId: b2BodyId, sleepThreshold: f32);
2571}
2572unsafe extern "C" {
2573 #[doc = " Get the sleep threshold, usually in meters per second."]
2574 pub fn b2Body_GetSleepThreshold(bodyId: b2BodyId) -> f32;
2575}
2576unsafe extern "C" {
2577 #[doc = " Returns true if this body is enabled"]
2578 pub fn b2Body_IsEnabled(bodyId: b2BodyId) -> bool;
2579}
2580unsafe extern "C" {
2581 #[doc = " Disable a body by removing it completely from the simulation. This is expensive."]
2582 pub fn b2Body_Disable(bodyId: b2BodyId);
2583}
2584unsafe extern "C" {
2585 #[doc = " Enable a body by adding it to the simulation. This is expensive."]
2586 pub fn b2Body_Enable(bodyId: b2BodyId);
2587}
2588unsafe extern "C" {
2589 #[doc = " Set the motion locks on this body."]
2590 pub fn b2Body_SetMotionLocks(bodyId: b2BodyId, locks: b2MotionLocks);
2591}
2592unsafe extern "C" {
2593 #[doc = " Get the motion locks for this body."]
2594 pub fn b2Body_GetMotionLocks(bodyId: b2BodyId) -> b2MotionLocks;
2595}
2596unsafe extern "C" {
2597 #[doc = " Set this body to be a bullet. A bullet does continuous collision detection\n against dynamic bodies (but not other bullets)."]
2598 pub fn b2Body_SetBullet(bodyId: b2BodyId, flag: bool);
2599}
2600unsafe extern "C" {
2601 #[doc = " Is this body a bullet?"]
2602 pub fn b2Body_IsBullet(bodyId: b2BodyId) -> bool;
2603}
2604unsafe extern "C" {
2605 #[doc = " Enable/disable contact events on all shapes.\n @see b2ShapeDef::enableContactEvents\n @warning changing this at runtime may cause mismatched begin/end touch events"]
2606 pub fn b2Body_EnableContactEvents(bodyId: b2BodyId, flag: bool);
2607}
2608unsafe extern "C" {
2609 #[doc = " Enable/disable hit events on all shapes\n @see b2ShapeDef::enableHitEvents"]
2610 pub fn b2Body_EnableHitEvents(bodyId: b2BodyId, flag: bool);
2611}
2612unsafe extern "C" {
2613 #[doc = " Get the world that owns this body"]
2614 pub fn b2Body_GetWorld(bodyId: b2BodyId) -> b2WorldId;
2615}
2616unsafe extern "C" {
2617 #[doc = " Get the number of shapes on this body"]
2618 pub fn b2Body_GetShapeCount(bodyId: b2BodyId) -> ::std::os::raw::c_int;
2619}
2620unsafe extern "C" {
2621 #[doc = " Get the shape ids for all shapes on this body, up to the provided capacity.\n @returns the number of shape ids stored in the user array"]
2622 pub fn b2Body_GetShapes(
2623 bodyId: b2BodyId,
2624 shapeArray: *mut b2ShapeId,
2625 capacity: ::std::os::raw::c_int,
2626 ) -> ::std::os::raw::c_int;
2627}
2628unsafe extern "C" {
2629 #[doc = " Get the number of joints on this body"]
2630 pub fn b2Body_GetJointCount(bodyId: b2BodyId) -> ::std::os::raw::c_int;
2631}
2632unsafe extern "C" {
2633 #[doc = " Get the joint ids for all joints on this body, up to the provided capacity\n @returns the number of joint ids stored in the user array"]
2634 pub fn b2Body_GetJoints(
2635 bodyId: b2BodyId,
2636 jointArray: *mut b2JointId,
2637 capacity: ::std::os::raw::c_int,
2638 ) -> ::std::os::raw::c_int;
2639}
2640unsafe extern "C" {
2641 #[doc = " Get the maximum capacity required for retrieving all the touching contacts on a body"]
2642 pub fn b2Body_GetContactCapacity(bodyId: b2BodyId) -> ::std::os::raw::c_int;
2643}
2644unsafe extern "C" {
2645 #[doc = " Get the touching contact data for a body.\n @note Box2D uses speculative collision so some contact points may be separated.\n @returns the number of elements filled in the provided array\n @warning do not ignore the return value, it specifies the valid number of elements"]
2646 pub fn b2Body_GetContactData(
2647 bodyId: b2BodyId,
2648 contactData: *mut b2ContactData,
2649 capacity: ::std::os::raw::c_int,
2650 ) -> ::std::os::raw::c_int;
2651}
2652unsafe extern "C" {
2653 #[doc = " Get the current world AABB that contains all the attached shapes. Note that this may not encompass the body origin.\n If there are no shapes attached then the returned AABB is empty and centered on the body origin."]
2654 pub fn b2Body_ComputeAABB(bodyId: b2BodyId) -> b2AABB;
2655}
2656unsafe extern "C" {
2657 #[doc = " Create a circle shape and attach it to a body. The shape definition and geometry are fully cloned.\n Contacts are not created until the next time step.\n @return the shape id for accessing the shape"]
2658 pub fn b2CreateCircleShape(
2659 bodyId: b2BodyId,
2660 def: *const b2ShapeDef,
2661 circle: *const b2Circle,
2662 ) -> b2ShapeId;
2663}
2664unsafe extern "C" {
2665 #[doc = " Create a line segment shape and attach it to a body. The shape definition and geometry are fully cloned.\n Contacts are not created until the next time step.\n @return the shape id for accessing the shape"]
2666 pub fn b2CreateSegmentShape(
2667 bodyId: b2BodyId,
2668 def: *const b2ShapeDef,
2669 segment: *const b2Segment,
2670 ) -> b2ShapeId;
2671}
2672unsafe extern "C" {
2673 #[doc = " Create a capsule shape and attach it to a body. The shape definition and geometry are fully cloned.\n Contacts are not created until the next time step.\n @return the shape id for accessing the shape"]
2674 pub fn b2CreateCapsuleShape(
2675 bodyId: b2BodyId,
2676 def: *const b2ShapeDef,
2677 capsule: *const b2Capsule,
2678 ) -> b2ShapeId;
2679}
2680unsafe extern "C" {
2681 #[doc = " Create a polygon shape and attach it to a body. The shape definition and geometry are fully cloned.\n Contacts are not created until the next time step.\n @return the shape id for accessing the shape"]
2682 pub fn b2CreatePolygonShape(
2683 bodyId: b2BodyId,
2684 def: *const b2ShapeDef,
2685 polygon: *const b2Polygon,
2686 ) -> b2ShapeId;
2687}
2688unsafe extern "C" {
2689 #[doc = " Destroy a shape. You may defer the body mass update which can improve performance if several shapes on a\n\tbody are destroyed at once.\n\t@see b2Body_ApplyMassFromShapes"]
2690 pub fn b2DestroyShape(shapeId: b2ShapeId, updateBodyMass: bool);
2691}
2692unsafe extern "C" {
2693 #[doc = " Shape identifier validation. Provides validation for up to 64K allocations."]
2694 pub fn b2Shape_IsValid(id: b2ShapeId) -> bool;
2695}
2696unsafe extern "C" {
2697 #[doc = " Get the type of a shape"]
2698 pub fn b2Shape_GetType(shapeId: b2ShapeId) -> b2ShapeType;
2699}
2700unsafe extern "C" {
2701 #[doc = " Get the id of the body that a shape is attached to"]
2702 pub fn b2Shape_GetBody(shapeId: b2ShapeId) -> b2BodyId;
2703}
2704unsafe extern "C" {
2705 #[doc = " Get the world that owns this shape"]
2706 pub fn b2Shape_GetWorld(shapeId: b2ShapeId) -> b2WorldId;
2707}
2708unsafe extern "C" {
2709 #[doc = " Returns true if the shape is a sensor. It is not possible to change a shape\n from sensor to solid dynamically because this breaks the contract for\n sensor events."]
2710 pub fn b2Shape_IsSensor(shapeId: b2ShapeId) -> bool;
2711}
2712unsafe extern "C" {
2713 #[doc = " Set the user data for a shape"]
2714 pub fn b2Shape_SetUserData(shapeId: b2ShapeId, userData: *mut ::std::os::raw::c_void);
2715}
2716unsafe extern "C" {
2717 #[doc = " Get the user data for a shape. This is useful when you get a shape id\n from an event or query."]
2718 pub fn b2Shape_GetUserData(shapeId: b2ShapeId) -> *mut ::std::os::raw::c_void;
2719}
2720unsafe extern "C" {
2721 #[doc = " Set the mass density of a shape, usually in kg/m^2.\n This will optionally update the mass properties on the parent body.\n @see b2ShapeDef::density, b2Body_ApplyMassFromShapes"]
2722 pub fn b2Shape_SetDensity(shapeId: b2ShapeId, density: f32, updateBodyMass: bool);
2723}
2724unsafe extern "C" {
2725 #[doc = " Get the density of a shape, usually in kg/m^2"]
2726 pub fn b2Shape_GetDensity(shapeId: b2ShapeId) -> f32;
2727}
2728unsafe extern "C" {
2729 #[doc = " Set the friction on a shape"]
2730 pub fn b2Shape_SetFriction(shapeId: b2ShapeId, friction: f32);
2731}
2732unsafe extern "C" {
2733 #[doc = " Get the friction of a shape"]
2734 pub fn b2Shape_GetFriction(shapeId: b2ShapeId) -> f32;
2735}
2736unsafe extern "C" {
2737 #[doc = " Set the shape restitution (bounciness)"]
2738 pub fn b2Shape_SetRestitution(shapeId: b2ShapeId, restitution: f32);
2739}
2740unsafe extern "C" {
2741 #[doc = " Get the shape restitution"]
2742 pub fn b2Shape_GetRestitution(shapeId: b2ShapeId) -> f32;
2743}
2744unsafe extern "C" {
2745 #[doc = " Set the user material identifier"]
2746 pub fn b2Shape_SetUserMaterial(shapeId: b2ShapeId, material: u64);
2747}
2748unsafe extern "C" {
2749 #[doc = " Get the user material identifier"]
2750 pub fn b2Shape_GetUserMaterial(shapeId: b2ShapeId) -> u64;
2751}
2752unsafe extern "C" {
2753 #[doc = " Set the shape surface material"]
2754 pub fn b2Shape_SetSurfaceMaterial(
2755 shapeId: b2ShapeId,
2756 surfaceMaterial: *const b2SurfaceMaterial,
2757 );
2758}
2759unsafe extern "C" {
2760 #[doc = " Get the shape surface material"]
2761 pub fn b2Shape_GetSurfaceMaterial(shapeId: b2ShapeId) -> b2SurfaceMaterial;
2762}
2763unsafe extern "C" {
2764 #[doc = " Get the shape filter"]
2765 pub fn b2Shape_GetFilter(shapeId: b2ShapeId) -> b2Filter;
2766}
2767unsafe extern "C" {
2768 #[doc = " Set the current filter. This is almost as expensive as recreating the shape. This may cause\n contacts to be immediately destroyed. However contacts are not created until the next world step.\n Sensor overlap state is also not updated until the next world step.\n @see b2ShapeDef::filter"]
2769 pub fn b2Shape_SetFilter(shapeId: b2ShapeId, filter: b2Filter);
2770}
2771unsafe extern "C" {
2772 #[doc = " Enable sensor events for this shape.\n @see b2ShapeDef::enableSensorEvents"]
2773 pub fn b2Shape_EnableSensorEvents(shapeId: b2ShapeId, flag: bool);
2774}
2775unsafe extern "C" {
2776 #[doc = " Returns true if sensor events are enabled."]
2777 pub fn b2Shape_AreSensorEventsEnabled(shapeId: b2ShapeId) -> bool;
2778}
2779unsafe extern "C" {
2780 #[doc = " Enable contact events for this shape. Only applies to kinematic and dynamic bodies. Ignored for sensors.\n @see b2ShapeDef::enableContactEvents\n @warning changing this at run-time may lead to lost begin/end events"]
2781 pub fn b2Shape_EnableContactEvents(shapeId: b2ShapeId, flag: bool);
2782}
2783unsafe extern "C" {
2784 #[doc = " Returns true if contact events are enabled"]
2785 pub fn b2Shape_AreContactEventsEnabled(shapeId: b2ShapeId) -> bool;
2786}
2787unsafe extern "C" {
2788 #[doc = " Enable pre-solve contact events for this shape. Only applies to dynamic bodies. These are expensive\n and must be carefully handled due to multithreading. Ignored for sensors.\n @see b2PreSolveFcn"]
2789 pub fn b2Shape_EnablePreSolveEvents(shapeId: b2ShapeId, flag: bool);
2790}
2791unsafe extern "C" {
2792 #[doc = " Returns true if pre-solve events are enabled"]
2793 pub fn b2Shape_ArePreSolveEventsEnabled(shapeId: b2ShapeId) -> bool;
2794}
2795unsafe extern "C" {
2796 #[doc = " Enable contact hit events for this shape. Ignored for sensors.\n @see b2WorldDef.hitEventThreshold"]
2797 pub fn b2Shape_EnableHitEvents(shapeId: b2ShapeId, flag: bool);
2798}
2799unsafe extern "C" {
2800 #[doc = " Returns true if hit events are enabled"]
2801 pub fn b2Shape_AreHitEventsEnabled(shapeId: b2ShapeId) -> bool;
2802}
2803unsafe extern "C" {
2804 #[doc = " Test a point for overlap with a shape"]
2805 pub fn b2Shape_TestPoint(shapeId: b2ShapeId, point: b2Vec2) -> bool;
2806}
2807unsafe extern "C" {
2808 #[doc = " Ray cast a shape directly"]
2809 pub fn b2Shape_RayCast(shapeId: b2ShapeId, input: *const b2RayCastInput) -> b2CastOutput;
2810}
2811unsafe extern "C" {
2812 #[doc = " Get a copy of the shape's circle. Asserts the type is correct."]
2813 pub fn b2Shape_GetCircle(shapeId: b2ShapeId) -> b2Circle;
2814}
2815unsafe extern "C" {
2816 #[doc = " Get a copy of the shape's line segment. Asserts the type is correct."]
2817 pub fn b2Shape_GetSegment(shapeId: b2ShapeId) -> b2Segment;
2818}
2819unsafe extern "C" {
2820 #[doc = " Get a copy of the shape's chain segment. These come from chain shapes.\n Asserts the type is correct."]
2821 pub fn b2Shape_GetChainSegment(shapeId: b2ShapeId) -> b2ChainSegment;
2822}
2823unsafe extern "C" {
2824 #[doc = " Get a copy of the shape's capsule. Asserts the type is correct."]
2825 pub fn b2Shape_GetCapsule(shapeId: b2ShapeId) -> b2Capsule;
2826}
2827unsafe extern "C" {
2828 #[doc = " Get a copy of the shape's convex polygon. Asserts the type is correct."]
2829 pub fn b2Shape_GetPolygon(shapeId: b2ShapeId) -> b2Polygon;
2830}
2831unsafe extern "C" {
2832 #[doc = " Allows you to change a shape to be a circle or update the current circle.\n This does not modify the mass properties.\n @see b2Body_ApplyMassFromShapes"]
2833 pub fn b2Shape_SetCircle(shapeId: b2ShapeId, circle: *const b2Circle);
2834}
2835unsafe extern "C" {
2836 #[doc = " Allows you to change a shape to be a capsule or update the current capsule.\n This does not modify the mass properties.\n @see b2Body_ApplyMassFromShapes"]
2837 pub fn b2Shape_SetCapsule(shapeId: b2ShapeId, capsule: *const b2Capsule);
2838}
2839unsafe extern "C" {
2840 #[doc = " Allows you to change a shape to be a segment or update the current segment."]
2841 pub fn b2Shape_SetSegment(shapeId: b2ShapeId, segment: *const b2Segment);
2842}
2843unsafe extern "C" {
2844 #[doc = " Allows you to change a shape to be a polygon or update the current polygon.\n This does not modify the mass properties.\n @see b2Body_ApplyMassFromShapes"]
2845 pub fn b2Shape_SetPolygon(shapeId: b2ShapeId, polygon: *const b2Polygon);
2846}
2847unsafe extern "C" {
2848 #[doc = " Get the parent chain id if the shape type is a chain segment, otherwise\n returns b2_nullChainId."]
2849 pub fn b2Shape_GetParentChain(shapeId: b2ShapeId) -> b2ChainId;
2850}
2851unsafe extern "C" {
2852 #[doc = " Get the maximum capacity required for retrieving all the touching contacts on a shape"]
2853 pub fn b2Shape_GetContactCapacity(shapeId: b2ShapeId) -> ::std::os::raw::c_int;
2854}
2855unsafe extern "C" {
2856 #[doc = " Get the touching contact data for a shape. The provided shapeId will be either shapeIdA or shapeIdB on the contact data.\n @note Box2D uses speculative collision so some contact points may be separated.\n @returns the number of elements filled in the provided array\n @warning do not ignore the return value, it specifies the valid number of elements"]
2857 pub fn b2Shape_GetContactData(
2858 shapeId: b2ShapeId,
2859 contactData: *mut b2ContactData,
2860 capacity: ::std::os::raw::c_int,
2861 ) -> ::std::os::raw::c_int;
2862}
2863unsafe extern "C" {
2864 #[doc = " Get the maximum capacity required for retrieving all the overlapped shapes on a sensor shape.\n This returns 0 if the provided shape is not a sensor.\n @param shapeId the id of a sensor shape\n @returns the required capacity to get all the overlaps in b2Shape_GetSensorOverlaps"]
2865 pub fn b2Shape_GetSensorCapacity(shapeId: b2ShapeId) -> ::std::os::raw::c_int;
2866}
2867unsafe extern "C" {
2868 #[doc = " Get the overlap data for a sensor shape.\n @param shapeId the id of a sensor shape\n @param visitorIds a user allocated array that is filled with the overlapping shapes (visitors)\n @param capacity the capacity of overlappedShapes\n @returns the number of elements filled in the provided array\n @warning do not ignore the return value, it specifies the valid number of elements\n @warning overlaps may contain destroyed shapes so use b2Shape_IsValid to confirm each overlap"]
2869 pub fn b2Shape_GetSensorData(
2870 shapeId: b2ShapeId,
2871 visitorIds: *mut b2ShapeId,
2872 capacity: ::std::os::raw::c_int,
2873 ) -> ::std::os::raw::c_int;
2874}
2875unsafe extern "C" {
2876 #[doc = " Get the current world AABB"]
2877 pub fn b2Shape_GetAABB(shapeId: b2ShapeId) -> b2AABB;
2878}
2879unsafe extern "C" {
2880 #[doc = " Compute the mass data for a shape"]
2881 pub fn b2Shape_ComputeMassData(shapeId: b2ShapeId) -> b2MassData;
2882}
2883unsafe extern "C" {
2884 #[doc = " Get the closest point on a shape to a target point. Target and result are in world space.\n todo need sample"]
2885 pub fn b2Shape_GetClosestPoint(shapeId: b2ShapeId, target: b2Vec2) -> b2Vec2;
2886}
2887unsafe extern "C" {
2888 pub fn b2Shape_ApplyWindForce(
2889 shapeId: b2ShapeId,
2890 wind: b2Vec2,
2891 drag: f32,
2892 lift: f32,
2893 wake: bool,
2894 );
2895}
2896unsafe extern "C" {
2897 #[doc = " Create a chain shape\n @see b2ChainDef for details"]
2898 pub fn b2CreateChain(bodyId: b2BodyId, def: *const b2ChainDef) -> b2ChainId;
2899}
2900unsafe extern "C" {
2901 #[doc = " Destroy a chain shape"]
2902 pub fn b2DestroyChain(chainId: b2ChainId);
2903}
2904unsafe extern "C" {
2905 #[doc = " Get the world that owns this chain shape"]
2906 pub fn b2Chain_GetWorld(chainId: b2ChainId) -> b2WorldId;
2907}
2908unsafe extern "C" {
2909 #[doc = " Get the number of segments on this chain"]
2910 pub fn b2Chain_GetSegmentCount(chainId: b2ChainId) -> ::std::os::raw::c_int;
2911}
2912unsafe extern "C" {
2913 #[doc = " Fill a user array with chain segment shape ids up to the specified capacity. Returns\n the actual number of segments returned."]
2914 pub fn b2Chain_GetSegments(
2915 chainId: b2ChainId,
2916 segmentArray: *mut b2ShapeId,
2917 capacity: ::std::os::raw::c_int,
2918 ) -> ::std::os::raw::c_int;
2919}
2920unsafe extern "C" {
2921 #[doc = " Get the number of materials used on this chain. Must be 1 or the number of segments."]
2922 pub fn b2Chain_GetSurfaceMaterialCount(chainId: b2ChainId) -> ::std::os::raw::c_int;
2923}
2924unsafe extern "C" {
2925 #[doc = " Set a chain material. If the chain has only one material, this material is applied to all\n segments. Otherwise it is applied to a single segment."]
2926 pub fn b2Chain_SetSurfaceMaterial(
2927 chainId: b2ChainId,
2928 material: *const b2SurfaceMaterial,
2929 materialIndex: ::std::os::raw::c_int,
2930 );
2931}
2932unsafe extern "C" {
2933 #[doc = " Get a chain material by index."]
2934 pub fn b2Chain_GetSurfaceMaterial(
2935 chainId: b2ChainId,
2936 materialIndex: ::std::os::raw::c_int,
2937 ) -> b2SurfaceMaterial;
2938}
2939unsafe extern "C" {
2940 #[doc = " Chain identifier validation. Provides validation for up to 64K allocations."]
2941 pub fn b2Chain_IsValid(id: b2ChainId) -> bool;
2942}
2943unsafe extern "C" {
2944 #[doc = " Destroy a joint. Optionally wake attached bodies."]
2945 pub fn b2DestroyJoint(jointId: b2JointId, wakeAttached: bool);
2946}
2947unsafe extern "C" {
2948 #[doc = " Joint identifier validation. Provides validation for up to 64K allocations."]
2949 pub fn b2Joint_IsValid(id: b2JointId) -> bool;
2950}
2951unsafe extern "C" {
2952 #[doc = " Get the joint type"]
2953 pub fn b2Joint_GetType(jointId: b2JointId) -> b2JointType;
2954}
2955unsafe extern "C" {
2956 #[doc = " Get body A id on a joint"]
2957 pub fn b2Joint_GetBodyA(jointId: b2JointId) -> b2BodyId;
2958}
2959unsafe extern "C" {
2960 #[doc = " Get body B id on a joint"]
2961 pub fn b2Joint_GetBodyB(jointId: b2JointId) -> b2BodyId;
2962}
2963unsafe extern "C" {
2964 #[doc = " Get the world that owns this joint"]
2965 pub fn b2Joint_GetWorld(jointId: b2JointId) -> b2WorldId;
2966}
2967unsafe extern "C" {
2968 #[doc = " Set the local frame on bodyA"]
2969 pub fn b2Joint_SetLocalFrameA(jointId: b2JointId, localFrame: b2Transform);
2970}
2971unsafe extern "C" {
2972 #[doc = " Get the local frame on bodyA"]
2973 pub fn b2Joint_GetLocalFrameA(jointId: b2JointId) -> b2Transform;
2974}
2975unsafe extern "C" {
2976 #[doc = " Set the local frame on bodyB"]
2977 pub fn b2Joint_SetLocalFrameB(jointId: b2JointId, localFrame: b2Transform);
2978}
2979unsafe extern "C" {
2980 #[doc = " Get the local frame on bodyB"]
2981 pub fn b2Joint_GetLocalFrameB(jointId: b2JointId) -> b2Transform;
2982}
2983unsafe extern "C" {
2984 #[doc = " Toggle collision between connected bodies"]
2985 pub fn b2Joint_SetCollideConnected(jointId: b2JointId, shouldCollide: bool);
2986}
2987unsafe extern "C" {
2988 #[doc = " Is collision allowed between connected bodies?"]
2989 pub fn b2Joint_GetCollideConnected(jointId: b2JointId) -> bool;
2990}
2991unsafe extern "C" {
2992 #[doc = " Set the user data on a joint"]
2993 pub fn b2Joint_SetUserData(jointId: b2JointId, userData: *mut ::std::os::raw::c_void);
2994}
2995unsafe extern "C" {
2996 #[doc = " Get the user data on a joint"]
2997 pub fn b2Joint_GetUserData(jointId: b2JointId) -> *mut ::std::os::raw::c_void;
2998}
2999unsafe extern "C" {
3000 #[doc = " Wake the bodies connect to this joint"]
3001 pub fn b2Joint_WakeBodies(jointId: b2JointId);
3002}
3003unsafe extern "C" {
3004 #[doc = " Get the current constraint force for this joint. Usually in Newtons."]
3005 pub fn b2Joint_GetConstraintForce(jointId: b2JointId) -> b2Vec2;
3006}
3007unsafe extern "C" {
3008 #[doc = " Get the current constraint torque for this joint. Usually in Newton * meters."]
3009 pub fn b2Joint_GetConstraintTorque(jointId: b2JointId) -> f32;
3010}
3011unsafe extern "C" {
3012 #[doc = " Get the current linear separation error for this joint. Does not consider admissible movement. Usually in meters."]
3013 pub fn b2Joint_GetLinearSeparation(jointId: b2JointId) -> f32;
3014}
3015unsafe extern "C" {
3016 #[doc = " Get the current angular separation error for this joint. Does not consider admissible movement. Usually in meters."]
3017 pub fn b2Joint_GetAngularSeparation(jointId: b2JointId) -> f32;
3018}
3019unsafe extern "C" {
3020 #[doc = " Set the joint constraint tuning. Advanced feature.\n @param jointId the joint\n @param hertz the stiffness in Hertz (cycles per second)\n @param dampingRatio the non-dimensional damping ratio (one for critical damping)"]
3021 pub fn b2Joint_SetConstraintTuning(jointId: b2JointId, hertz: f32, dampingRatio: f32);
3022}
3023unsafe extern "C" {
3024 #[doc = " Get the joint constraint tuning. Advanced feature."]
3025 pub fn b2Joint_GetConstraintTuning(jointId: b2JointId, hertz: *mut f32, dampingRatio: *mut f32);
3026}
3027unsafe extern "C" {
3028 #[doc = " Set the force threshold for joint events (Newtons)"]
3029 pub fn b2Joint_SetForceThreshold(jointId: b2JointId, threshold: f32);
3030}
3031unsafe extern "C" {
3032 #[doc = " Get the force threshold for joint events (Newtons)"]
3033 pub fn b2Joint_GetForceThreshold(jointId: b2JointId) -> f32;
3034}
3035unsafe extern "C" {
3036 #[doc = " Set the torque threshold for joint events (N-m)"]
3037 pub fn b2Joint_SetTorqueThreshold(jointId: b2JointId, threshold: f32);
3038}
3039unsafe extern "C" {
3040 #[doc = " Get the torque threshold for joint events (N-m)"]
3041 pub fn b2Joint_GetTorqueThreshold(jointId: b2JointId) -> f32;
3042}
3043unsafe extern "C" {
3044 #[doc = " Create a distance joint\n @see b2DistanceJointDef for details"]
3045 pub fn b2CreateDistanceJoint(worldId: b2WorldId, def: *const b2DistanceJointDef) -> b2JointId;
3046}
3047unsafe extern "C" {
3048 #[doc = " Set the rest length of a distance joint\n @param jointId The id for a distance joint\n @param length The new distance joint length"]
3049 pub fn b2DistanceJoint_SetLength(jointId: b2JointId, length: f32);
3050}
3051unsafe extern "C" {
3052 #[doc = " Get the rest length of a distance joint"]
3053 pub fn b2DistanceJoint_GetLength(jointId: b2JointId) -> f32;
3054}
3055unsafe extern "C" {
3056 #[doc = " Enable/disable the distance joint spring. When disabled the distance joint is rigid."]
3057 pub fn b2DistanceJoint_EnableSpring(jointId: b2JointId, enableSpring: bool);
3058}
3059unsafe extern "C" {
3060 #[doc = " Is the distance joint spring enabled?"]
3061 pub fn b2DistanceJoint_IsSpringEnabled(jointId: b2JointId) -> bool;
3062}
3063unsafe extern "C" {
3064 #[doc = " Set the force range for the spring."]
3065 pub fn b2DistanceJoint_SetSpringForceRange(
3066 jointId: b2JointId,
3067 lowerForce: f32,
3068 upperForce: f32,
3069 );
3070}
3071unsafe extern "C" {
3072 #[doc = " Get the force range for the spring."]
3073 pub fn b2DistanceJoint_GetSpringForceRange(
3074 jointId: b2JointId,
3075 lowerForce: *mut f32,
3076 upperForce: *mut f32,
3077 );
3078}
3079unsafe extern "C" {
3080 #[doc = " Set the spring stiffness in Hertz"]
3081 pub fn b2DistanceJoint_SetSpringHertz(jointId: b2JointId, hertz: f32);
3082}
3083unsafe extern "C" {
3084 #[doc = " Set the spring damping ratio, non-dimensional"]
3085 pub fn b2DistanceJoint_SetSpringDampingRatio(jointId: b2JointId, dampingRatio: f32);
3086}
3087unsafe extern "C" {
3088 #[doc = " Get the spring Hertz"]
3089 pub fn b2DistanceJoint_GetSpringHertz(jointId: b2JointId) -> f32;
3090}
3091unsafe extern "C" {
3092 #[doc = " Get the spring damping ratio"]
3093 pub fn b2DistanceJoint_GetSpringDampingRatio(jointId: b2JointId) -> f32;
3094}
3095unsafe extern "C" {
3096 #[doc = " Enable joint limit. The limit only works if the joint spring is enabled. Otherwise the joint is rigid\n and the limit has no effect."]
3097 pub fn b2DistanceJoint_EnableLimit(jointId: b2JointId, enableLimit: bool);
3098}
3099unsafe extern "C" {
3100 #[doc = " Is the distance joint limit enabled?"]
3101 pub fn b2DistanceJoint_IsLimitEnabled(jointId: b2JointId) -> bool;
3102}
3103unsafe extern "C" {
3104 #[doc = " Set the minimum and maximum length parameters of a distance joint"]
3105 pub fn b2DistanceJoint_SetLengthRange(jointId: b2JointId, minLength: f32, maxLength: f32);
3106}
3107unsafe extern "C" {
3108 #[doc = " Get the distance joint minimum length"]
3109 pub fn b2DistanceJoint_GetMinLength(jointId: b2JointId) -> f32;
3110}
3111unsafe extern "C" {
3112 #[doc = " Get the distance joint maximum length"]
3113 pub fn b2DistanceJoint_GetMaxLength(jointId: b2JointId) -> f32;
3114}
3115unsafe extern "C" {
3116 #[doc = " Get the current length of a distance joint"]
3117 pub fn b2DistanceJoint_GetCurrentLength(jointId: b2JointId) -> f32;
3118}
3119unsafe extern "C" {
3120 #[doc = " Enable/disable the distance joint motor"]
3121 pub fn b2DistanceJoint_EnableMotor(jointId: b2JointId, enableMotor: bool);
3122}
3123unsafe extern "C" {
3124 #[doc = " Is the distance joint motor enabled?"]
3125 pub fn b2DistanceJoint_IsMotorEnabled(jointId: b2JointId) -> bool;
3126}
3127unsafe extern "C" {
3128 #[doc = " Set the distance joint motor speed, usually in meters per second"]
3129 pub fn b2DistanceJoint_SetMotorSpeed(jointId: b2JointId, motorSpeed: f32);
3130}
3131unsafe extern "C" {
3132 #[doc = " Get the distance joint motor speed, usually in meters per second"]
3133 pub fn b2DistanceJoint_GetMotorSpeed(jointId: b2JointId) -> f32;
3134}
3135unsafe extern "C" {
3136 #[doc = " Set the distance joint maximum motor force, usually in newtons"]
3137 pub fn b2DistanceJoint_SetMaxMotorForce(jointId: b2JointId, force: f32);
3138}
3139unsafe extern "C" {
3140 #[doc = " Get the distance joint maximum motor force, usually in newtons"]
3141 pub fn b2DistanceJoint_GetMaxMotorForce(jointId: b2JointId) -> f32;
3142}
3143unsafe extern "C" {
3144 #[doc = " Get the distance joint current motor force, usually in newtons"]
3145 pub fn b2DistanceJoint_GetMotorForce(jointId: b2JointId) -> f32;
3146}
3147unsafe extern "C" {
3148 #[doc = " Create a motor joint\n @see b2MotorJointDef for details"]
3149 pub fn b2CreateMotorJoint(worldId: b2WorldId, def: *const b2MotorJointDef) -> b2JointId;
3150}
3151unsafe extern "C" {
3152 #[doc = " Set the desired relative linear velocity in meters per second"]
3153 pub fn b2MotorJoint_SetLinearVelocity(jointId: b2JointId, velocity: b2Vec2);
3154}
3155unsafe extern "C" {
3156 #[doc = " Get the desired relative linear velocity in meters per second"]
3157 pub fn b2MotorJoint_GetLinearVelocity(jointId: b2JointId) -> b2Vec2;
3158}
3159unsafe extern "C" {
3160 #[doc = " Set the desired relative angular velocity in radians per second"]
3161 pub fn b2MotorJoint_SetAngularVelocity(jointId: b2JointId, velocity: f32);
3162}
3163unsafe extern "C" {
3164 #[doc = " Get the desired relative angular velocity in radians per second"]
3165 pub fn b2MotorJoint_GetAngularVelocity(jointId: b2JointId) -> f32;
3166}
3167unsafe extern "C" {
3168 #[doc = " Set the motor joint maximum force, usually in newtons"]
3169 pub fn b2MotorJoint_SetMaxVelocityForce(jointId: b2JointId, maxForce: f32);
3170}
3171unsafe extern "C" {
3172 #[doc = " Get the motor joint maximum force, usually in newtons"]
3173 pub fn b2MotorJoint_GetMaxVelocityForce(jointId: b2JointId) -> f32;
3174}
3175unsafe extern "C" {
3176 #[doc = " Set the motor joint maximum torque, usually in newton-meters"]
3177 pub fn b2MotorJoint_SetMaxVelocityTorque(jointId: b2JointId, maxTorque: f32);
3178}
3179unsafe extern "C" {
3180 #[doc = " Get the motor joint maximum torque, usually in newton-meters"]
3181 pub fn b2MotorJoint_GetMaxVelocityTorque(jointId: b2JointId) -> f32;
3182}
3183unsafe extern "C" {
3184 #[doc = " Set the spring linear hertz stiffness"]
3185 pub fn b2MotorJoint_SetLinearHertz(jointId: b2JointId, hertz: f32);
3186}
3187unsafe extern "C" {
3188 #[doc = " Get the spring linear hertz stiffness"]
3189 pub fn b2MotorJoint_GetLinearHertz(jointId: b2JointId) -> f32;
3190}
3191unsafe extern "C" {
3192 #[doc = " Set the spring linear damping ratio. Use 1.0 for critical damping."]
3193 pub fn b2MotorJoint_SetLinearDampingRatio(jointId: b2JointId, damping: f32);
3194}
3195unsafe extern "C" {
3196 #[doc = " Get the spring linear damping ratio."]
3197 pub fn b2MotorJoint_GetLinearDampingRatio(jointId: b2JointId) -> f32;
3198}
3199unsafe extern "C" {
3200 #[doc = " Set the spring angular hertz stiffness"]
3201 pub fn b2MotorJoint_SetAngularHertz(jointId: b2JointId, hertz: f32);
3202}
3203unsafe extern "C" {
3204 #[doc = " Get the spring angular hertz stiffness"]
3205 pub fn b2MotorJoint_GetAngularHertz(jointId: b2JointId) -> f32;
3206}
3207unsafe extern "C" {
3208 #[doc = " Set the spring angular damping ratio. Use 1.0 for critical damping."]
3209 pub fn b2MotorJoint_SetAngularDampingRatio(jointId: b2JointId, damping: f32);
3210}
3211unsafe extern "C" {
3212 #[doc = " Get the spring angular damping ratio."]
3213 pub fn b2MotorJoint_GetAngularDampingRatio(jointId: b2JointId) -> f32;
3214}
3215unsafe extern "C" {
3216 #[doc = " Set the maximum spring force in newtons."]
3217 pub fn b2MotorJoint_SetMaxSpringForce(jointId: b2JointId, maxForce: f32);
3218}
3219unsafe extern "C" {
3220 #[doc = " Get the maximum spring force in newtons."]
3221 pub fn b2MotorJoint_GetMaxSpringForce(jointId: b2JointId) -> f32;
3222}
3223unsafe extern "C" {
3224 #[doc = " Set the maximum spring torque in newtons * meters"]
3225 pub fn b2MotorJoint_SetMaxSpringTorque(jointId: b2JointId, maxTorque: f32);
3226}
3227unsafe extern "C" {
3228 #[doc = " Get the maximum spring torque in newtons * meters"]
3229 pub fn b2MotorJoint_GetMaxSpringTorque(jointId: b2JointId) -> f32;
3230}
3231unsafe extern "C" {
3232 #[doc = " Create a filter joint.\n @see b2FilterJointDef for details"]
3233 pub fn b2CreateFilterJoint(worldId: b2WorldId, def: *const b2FilterJointDef) -> b2JointId;
3234}
3235unsafe extern "C" {
3236 #[doc = " Create a prismatic (slider) joint.\n @see b2PrismaticJointDef for details"]
3237 pub fn b2CreatePrismaticJoint(worldId: b2WorldId, def: *const b2PrismaticJointDef)
3238 -> b2JointId;
3239}
3240unsafe extern "C" {
3241 #[doc = " Enable/disable the joint spring."]
3242 pub fn b2PrismaticJoint_EnableSpring(jointId: b2JointId, enableSpring: bool);
3243}
3244unsafe extern "C" {
3245 #[doc = " Is the prismatic joint spring enabled or not?"]
3246 pub fn b2PrismaticJoint_IsSpringEnabled(jointId: b2JointId) -> bool;
3247}
3248unsafe extern "C" {
3249 #[doc = " Set the prismatic joint stiffness in Hertz.\n This should usually be less than a quarter of the simulation rate. For example, if the simulation\n runs at 60Hz then the joint stiffness should be 15Hz or less."]
3250 pub fn b2PrismaticJoint_SetSpringHertz(jointId: b2JointId, hertz: f32);
3251}
3252unsafe extern "C" {
3253 #[doc = " Get the prismatic joint stiffness in Hertz"]
3254 pub fn b2PrismaticJoint_GetSpringHertz(jointId: b2JointId) -> f32;
3255}
3256unsafe extern "C" {
3257 #[doc = " Set the prismatic joint damping ratio (non-dimensional)"]
3258 pub fn b2PrismaticJoint_SetSpringDampingRatio(jointId: b2JointId, dampingRatio: f32);
3259}
3260unsafe extern "C" {
3261 #[doc = " Get the prismatic spring damping ratio (non-dimensional)"]
3262 pub fn b2PrismaticJoint_GetSpringDampingRatio(jointId: b2JointId) -> f32;
3263}
3264unsafe extern "C" {
3265 #[doc = " Set the prismatic joint spring target angle, usually in meters"]
3266 pub fn b2PrismaticJoint_SetTargetTranslation(jointId: b2JointId, translation: f32);
3267}
3268unsafe extern "C" {
3269 #[doc = " Get the prismatic joint spring target translation, usually in meters"]
3270 pub fn b2PrismaticJoint_GetTargetTranslation(jointId: b2JointId) -> f32;
3271}
3272unsafe extern "C" {
3273 #[doc = " Enable/disable a prismatic joint limit"]
3274 pub fn b2PrismaticJoint_EnableLimit(jointId: b2JointId, enableLimit: bool);
3275}
3276unsafe extern "C" {
3277 #[doc = " Is the prismatic joint limit enabled?"]
3278 pub fn b2PrismaticJoint_IsLimitEnabled(jointId: b2JointId) -> bool;
3279}
3280unsafe extern "C" {
3281 #[doc = " Get the prismatic joint lower limit"]
3282 pub fn b2PrismaticJoint_GetLowerLimit(jointId: b2JointId) -> f32;
3283}
3284unsafe extern "C" {
3285 #[doc = " Get the prismatic joint upper limit"]
3286 pub fn b2PrismaticJoint_GetUpperLimit(jointId: b2JointId) -> f32;
3287}
3288unsafe extern "C" {
3289 #[doc = " Set the prismatic joint limits"]
3290 pub fn b2PrismaticJoint_SetLimits(jointId: b2JointId, lower: f32, upper: f32);
3291}
3292unsafe extern "C" {
3293 #[doc = " Enable/disable a prismatic joint motor"]
3294 pub fn b2PrismaticJoint_EnableMotor(jointId: b2JointId, enableMotor: bool);
3295}
3296unsafe extern "C" {
3297 #[doc = " Is the prismatic joint motor enabled?"]
3298 pub fn b2PrismaticJoint_IsMotorEnabled(jointId: b2JointId) -> bool;
3299}
3300unsafe extern "C" {
3301 #[doc = " Set the prismatic joint motor speed, usually in meters per second"]
3302 pub fn b2PrismaticJoint_SetMotorSpeed(jointId: b2JointId, motorSpeed: f32);
3303}
3304unsafe extern "C" {
3305 #[doc = " Get the prismatic joint motor speed, usually in meters per second"]
3306 pub fn b2PrismaticJoint_GetMotorSpeed(jointId: b2JointId) -> f32;
3307}
3308unsafe extern "C" {
3309 #[doc = " Set the prismatic joint maximum motor force, usually in newtons"]
3310 pub fn b2PrismaticJoint_SetMaxMotorForce(jointId: b2JointId, force: f32);
3311}
3312unsafe extern "C" {
3313 #[doc = " Get the prismatic joint maximum motor force, usually in newtons"]
3314 pub fn b2PrismaticJoint_GetMaxMotorForce(jointId: b2JointId) -> f32;
3315}
3316unsafe extern "C" {
3317 #[doc = " Get the prismatic joint current motor force, usually in newtons"]
3318 pub fn b2PrismaticJoint_GetMotorForce(jointId: b2JointId) -> f32;
3319}
3320unsafe extern "C" {
3321 #[doc = " Get the current joint translation, usually in meters."]
3322 pub fn b2PrismaticJoint_GetTranslation(jointId: b2JointId) -> f32;
3323}
3324unsafe extern "C" {
3325 #[doc = " Get the current joint translation speed, usually in meters per second."]
3326 pub fn b2PrismaticJoint_GetSpeed(jointId: b2JointId) -> f32;
3327}
3328unsafe extern "C" {
3329 #[doc = " Create a revolute joint\n @see b2RevoluteJointDef for details"]
3330 pub fn b2CreateRevoluteJoint(worldId: b2WorldId, def: *const b2RevoluteJointDef) -> b2JointId;
3331}
3332unsafe extern "C" {
3333 #[doc = " Enable/disable the revolute joint spring"]
3334 pub fn b2RevoluteJoint_EnableSpring(jointId: b2JointId, enableSpring: bool);
3335}
3336unsafe extern "C" {
3337 #[doc = " It the revolute angular spring enabled?"]
3338 pub fn b2RevoluteJoint_IsSpringEnabled(jointId: b2JointId) -> bool;
3339}
3340unsafe extern "C" {
3341 #[doc = " Set the revolute joint spring stiffness in Hertz"]
3342 pub fn b2RevoluteJoint_SetSpringHertz(jointId: b2JointId, hertz: f32);
3343}
3344unsafe extern "C" {
3345 #[doc = " Get the revolute joint spring stiffness in Hertz"]
3346 pub fn b2RevoluteJoint_GetSpringHertz(jointId: b2JointId) -> f32;
3347}
3348unsafe extern "C" {
3349 #[doc = " Set the revolute joint spring damping ratio, non-dimensional"]
3350 pub fn b2RevoluteJoint_SetSpringDampingRatio(jointId: b2JointId, dampingRatio: f32);
3351}
3352unsafe extern "C" {
3353 #[doc = " Get the revolute joint spring damping ratio, non-dimensional"]
3354 pub fn b2RevoluteJoint_GetSpringDampingRatio(jointId: b2JointId) -> f32;
3355}
3356unsafe extern "C" {
3357 #[doc = " Set the revolute joint spring target angle, radians"]
3358 pub fn b2RevoluteJoint_SetTargetAngle(jointId: b2JointId, angle: f32);
3359}
3360unsafe extern "C" {
3361 #[doc = " Get the revolute joint spring target angle, radians"]
3362 pub fn b2RevoluteJoint_GetTargetAngle(jointId: b2JointId) -> f32;
3363}
3364unsafe extern "C" {
3365 #[doc = " Get the revolute joint current angle in radians relative to the reference angle\n @see b2RevoluteJointDef::referenceAngle"]
3366 pub fn b2RevoluteJoint_GetAngle(jointId: b2JointId) -> f32;
3367}
3368unsafe extern "C" {
3369 #[doc = " Enable/disable the revolute joint limit"]
3370 pub fn b2RevoluteJoint_EnableLimit(jointId: b2JointId, enableLimit: bool);
3371}
3372unsafe extern "C" {
3373 #[doc = " Is the revolute joint limit enabled?"]
3374 pub fn b2RevoluteJoint_IsLimitEnabled(jointId: b2JointId) -> bool;
3375}
3376unsafe extern "C" {
3377 #[doc = " Get the revolute joint lower limit in radians"]
3378 pub fn b2RevoluteJoint_GetLowerLimit(jointId: b2JointId) -> f32;
3379}
3380unsafe extern "C" {
3381 #[doc = " Get the revolute joint upper limit in radians"]
3382 pub fn b2RevoluteJoint_GetUpperLimit(jointId: b2JointId) -> f32;
3383}
3384unsafe extern "C" {
3385 #[doc = " Set the revolute joint limits in radians. It is expected that lower <= upper\n and that -0.99 * B2_PI <= lower && upper <= -0.99 * B2_PI."]
3386 pub fn b2RevoluteJoint_SetLimits(jointId: b2JointId, lower: f32, upper: f32);
3387}
3388unsafe extern "C" {
3389 #[doc = " Enable/disable a revolute joint motor"]
3390 pub fn b2RevoluteJoint_EnableMotor(jointId: b2JointId, enableMotor: bool);
3391}
3392unsafe extern "C" {
3393 #[doc = " Is the revolute joint motor enabled?"]
3394 pub fn b2RevoluteJoint_IsMotorEnabled(jointId: b2JointId) -> bool;
3395}
3396unsafe extern "C" {
3397 #[doc = " Set the revolute joint motor speed in radians per second"]
3398 pub fn b2RevoluteJoint_SetMotorSpeed(jointId: b2JointId, motorSpeed: f32);
3399}
3400unsafe extern "C" {
3401 #[doc = " Get the revolute joint motor speed in radians per second"]
3402 pub fn b2RevoluteJoint_GetMotorSpeed(jointId: b2JointId) -> f32;
3403}
3404unsafe extern "C" {
3405 #[doc = " Get the revolute joint current motor torque, usually in newton-meters"]
3406 pub fn b2RevoluteJoint_GetMotorTorque(jointId: b2JointId) -> f32;
3407}
3408unsafe extern "C" {
3409 #[doc = " Set the revolute joint maximum motor torque, usually in newton-meters"]
3410 pub fn b2RevoluteJoint_SetMaxMotorTorque(jointId: b2JointId, torque: f32);
3411}
3412unsafe extern "C" {
3413 #[doc = " Get the revolute joint maximum motor torque, usually in newton-meters"]
3414 pub fn b2RevoluteJoint_GetMaxMotorTorque(jointId: b2JointId) -> f32;
3415}
3416unsafe extern "C" {
3417 #[doc = " Create a weld joint\n @see b2WeldJointDef for details"]
3418 pub fn b2CreateWeldJoint(worldId: b2WorldId, def: *const b2WeldJointDef) -> b2JointId;
3419}
3420unsafe extern "C" {
3421 #[doc = " Set the weld joint linear stiffness in Hertz. 0 is rigid."]
3422 pub fn b2WeldJoint_SetLinearHertz(jointId: b2JointId, hertz: f32);
3423}
3424unsafe extern "C" {
3425 #[doc = " Get the weld joint linear stiffness in Hertz"]
3426 pub fn b2WeldJoint_GetLinearHertz(jointId: b2JointId) -> f32;
3427}
3428unsafe extern "C" {
3429 #[doc = " Set the weld joint linear damping ratio (non-dimensional)"]
3430 pub fn b2WeldJoint_SetLinearDampingRatio(jointId: b2JointId, dampingRatio: f32);
3431}
3432unsafe extern "C" {
3433 #[doc = " Get the weld joint linear damping ratio (non-dimensional)"]
3434 pub fn b2WeldJoint_GetLinearDampingRatio(jointId: b2JointId) -> f32;
3435}
3436unsafe extern "C" {
3437 #[doc = " Set the weld joint angular stiffness in Hertz. 0 is rigid."]
3438 pub fn b2WeldJoint_SetAngularHertz(jointId: b2JointId, hertz: f32);
3439}
3440unsafe extern "C" {
3441 #[doc = " Get the weld joint angular stiffness in Hertz"]
3442 pub fn b2WeldJoint_GetAngularHertz(jointId: b2JointId) -> f32;
3443}
3444unsafe extern "C" {
3445 #[doc = " Set weld joint angular damping ratio, non-dimensional"]
3446 pub fn b2WeldJoint_SetAngularDampingRatio(jointId: b2JointId, dampingRatio: f32);
3447}
3448unsafe extern "C" {
3449 #[doc = " Get the weld joint angular damping ratio, non-dimensional"]
3450 pub fn b2WeldJoint_GetAngularDampingRatio(jointId: b2JointId) -> f32;
3451}
3452unsafe extern "C" {
3453 #[doc = " Create a wheel joint\n @see b2WheelJointDef for details"]
3454 pub fn b2CreateWheelJoint(worldId: b2WorldId, def: *const b2WheelJointDef) -> b2JointId;
3455}
3456unsafe extern "C" {
3457 #[doc = " Enable/disable the wheel joint spring"]
3458 pub fn b2WheelJoint_EnableSpring(jointId: b2JointId, enableSpring: bool);
3459}
3460unsafe extern "C" {
3461 #[doc = " Is the wheel joint spring enabled?"]
3462 pub fn b2WheelJoint_IsSpringEnabled(jointId: b2JointId) -> bool;
3463}
3464unsafe extern "C" {
3465 #[doc = " Set the wheel joint stiffness in Hertz"]
3466 pub fn b2WheelJoint_SetSpringHertz(jointId: b2JointId, hertz: f32);
3467}
3468unsafe extern "C" {
3469 #[doc = " Get the wheel joint stiffness in Hertz"]
3470 pub fn b2WheelJoint_GetSpringHertz(jointId: b2JointId) -> f32;
3471}
3472unsafe extern "C" {
3473 #[doc = " Set the wheel joint damping ratio, non-dimensional"]
3474 pub fn b2WheelJoint_SetSpringDampingRatio(jointId: b2JointId, dampingRatio: f32);
3475}
3476unsafe extern "C" {
3477 #[doc = " Get the wheel joint damping ratio, non-dimensional"]
3478 pub fn b2WheelJoint_GetSpringDampingRatio(jointId: b2JointId) -> f32;
3479}
3480unsafe extern "C" {
3481 #[doc = " Enable/disable the wheel joint limit"]
3482 pub fn b2WheelJoint_EnableLimit(jointId: b2JointId, enableLimit: bool);
3483}
3484unsafe extern "C" {
3485 #[doc = " Is the wheel joint limit enabled?"]
3486 pub fn b2WheelJoint_IsLimitEnabled(jointId: b2JointId) -> bool;
3487}
3488unsafe extern "C" {
3489 #[doc = " Get the wheel joint lower limit"]
3490 pub fn b2WheelJoint_GetLowerLimit(jointId: b2JointId) -> f32;
3491}
3492unsafe extern "C" {
3493 #[doc = " Get the wheel joint upper limit"]
3494 pub fn b2WheelJoint_GetUpperLimit(jointId: b2JointId) -> f32;
3495}
3496unsafe extern "C" {
3497 #[doc = " Set the wheel joint limits"]
3498 pub fn b2WheelJoint_SetLimits(jointId: b2JointId, lower: f32, upper: f32);
3499}
3500unsafe extern "C" {
3501 #[doc = " Enable/disable the wheel joint motor"]
3502 pub fn b2WheelJoint_EnableMotor(jointId: b2JointId, enableMotor: bool);
3503}
3504unsafe extern "C" {
3505 #[doc = " Is the wheel joint motor enabled?"]
3506 pub fn b2WheelJoint_IsMotorEnabled(jointId: b2JointId) -> bool;
3507}
3508unsafe extern "C" {
3509 #[doc = " Set the wheel joint motor speed in radians per second"]
3510 pub fn b2WheelJoint_SetMotorSpeed(jointId: b2JointId, motorSpeed: f32);
3511}
3512unsafe extern "C" {
3513 #[doc = " Get the wheel joint motor speed in radians per second"]
3514 pub fn b2WheelJoint_GetMotorSpeed(jointId: b2JointId) -> f32;
3515}
3516unsafe extern "C" {
3517 #[doc = " Set the wheel joint maximum motor torque, usually in newton-meters"]
3518 pub fn b2WheelJoint_SetMaxMotorTorque(jointId: b2JointId, torque: f32);
3519}
3520unsafe extern "C" {
3521 #[doc = " Get the wheel joint maximum motor torque, usually in newton-meters"]
3522 pub fn b2WheelJoint_GetMaxMotorTorque(jointId: b2JointId) -> f32;
3523}
3524unsafe extern "C" {
3525 #[doc = " Get the wheel joint current motor torque, usually in newton-meters"]
3526 pub fn b2WheelJoint_GetMotorTorque(jointId: b2JointId) -> f32;
3527}
3528unsafe extern "C" {
3529 #[doc = " Contact identifier validation. Provides validation for up to 2^32 allocations."]
3530 pub fn b2Contact_IsValid(id: b2ContactId) -> bool;
3531}
3532unsafe extern "C" {
3533 #[doc = " Get the data for a contact. The manifold may have no points if the contact is not touching."]
3534 pub fn b2Contact_GetData(contactId: b2ContactId) -> b2ContactData;
3535}
3536#[doc = " The tree nodes"]
3537#[repr(C)]
3538#[derive(Debug, Copy, Clone)]
3539pub struct b2TreeNode {
3540 pub _address: u8,
3541}