// AUTOGENERATED: pregenerated Box3D bindings for docs.rs/offline builds
// To refresh, run tools/update_box3d_and_bindings.py --mode default
/* automatically generated by rust-bindgen 0.72.1 */
#[repr(C)]
#[derive(Copy, Clone, Debug, Default, Eq, Hash, Ord, PartialEq, PartialOrd)]
pub struct __BindgenBitfieldUnit<Storage> {
storage: Storage,
}
impl<Storage> __BindgenBitfieldUnit<Storage> {
#[inline]
pub const fn new(storage: Storage) -> Self {
Self { storage }
}
}
impl<Storage> __BindgenBitfieldUnit<Storage>
where
Storage: AsRef<[u8]> + AsMut<[u8]>,
{
#[inline]
fn extract_bit(byte: u8, index: usize) -> bool {
let bit_index = if cfg!(target_endian = "big") {
7 - (index % 8)
} else {
index % 8
};
let mask = 1 << bit_index;
byte & mask == mask
}
#[inline]
pub fn get_bit(&self, index: usize) -> bool {
debug_assert!(index / 8 < self.storage.as_ref().len());
let byte_index = index / 8;
let byte = self.storage.as_ref()[byte_index];
Self::extract_bit(byte, index)
}
#[inline]
pub unsafe fn raw_get_bit(this: *const Self, index: usize) -> bool {
debug_assert!(index / 8 < core::mem::size_of::<Storage>());
let byte_index = index / 8;
let byte = unsafe {
*(core::ptr::addr_of!((*this).storage) as *const u8).offset(byte_index as isize)
};
Self::extract_bit(byte, index)
}
#[inline]
fn change_bit(byte: u8, index: usize, val: bool) -> u8 {
let bit_index = if cfg!(target_endian = "big") {
7 - (index % 8)
} else {
index % 8
};
let mask = 1 << bit_index;
if val { byte | mask } else { byte & !mask }
}
#[inline]
pub fn set_bit(&mut self, index: usize, val: bool) {
debug_assert!(index / 8 < self.storage.as_ref().len());
let byte_index = index / 8;
let byte = &mut self.storage.as_mut()[byte_index];
*byte = Self::change_bit(*byte, index, val);
}
#[inline]
pub unsafe fn raw_set_bit(this: *mut Self, index: usize, val: bool) {
debug_assert!(index / 8 < core::mem::size_of::<Storage>());
let byte_index = index / 8;
let byte = unsafe {
(core::ptr::addr_of_mut!((*this).storage) as *mut u8).offset(byte_index as isize)
};
unsafe { *byte = Self::change_bit(*byte, index, val) };
}
#[inline]
pub fn get(&self, bit_offset: usize, bit_width: u8) -> u64 {
debug_assert!(bit_width <= 64);
debug_assert!(bit_offset / 8 < self.storage.as_ref().len());
debug_assert!((bit_offset + (bit_width as usize)) / 8 <= self.storage.as_ref().len());
let mut val = 0;
for i in 0..(bit_width as usize) {
if self.get_bit(i + bit_offset) {
let index = if cfg!(target_endian = "big") {
bit_width as usize - 1 - i
} else {
i
};
val |= 1 << index;
}
}
val
}
#[inline]
pub unsafe fn raw_get(this: *const Self, bit_offset: usize, bit_width: u8) -> u64 {
debug_assert!(bit_width <= 64);
debug_assert!(bit_offset / 8 < core::mem::size_of::<Storage>());
debug_assert!((bit_offset + (bit_width as usize)) / 8 <= core::mem::size_of::<Storage>());
let mut val = 0;
for i in 0..(bit_width as usize) {
if unsafe { Self::raw_get_bit(this, i + bit_offset) } {
let index = if cfg!(target_endian = "big") {
bit_width as usize - 1 - i
} else {
i
};
val |= 1 << index;
}
}
val
}
#[inline]
pub fn set(&mut self, bit_offset: usize, bit_width: u8, val: u64) {
debug_assert!(bit_width <= 64);
debug_assert!(bit_offset / 8 < self.storage.as_ref().len());
debug_assert!((bit_offset + (bit_width as usize)) / 8 <= self.storage.as_ref().len());
for i in 0..(bit_width as usize) {
let mask = 1 << i;
let val_bit_is_set = val & mask == mask;
let index = if cfg!(target_endian = "big") {
bit_width as usize - 1 - i
} else {
i
};
self.set_bit(index + bit_offset, val_bit_is_set);
}
}
#[inline]
pub unsafe fn raw_set(this: *mut Self, bit_offset: usize, bit_width: u8, val: u64) {
debug_assert!(bit_width <= 64);
debug_assert!(bit_offset / 8 < core::mem::size_of::<Storage>());
debug_assert!((bit_offset + (bit_width as usize)) / 8 <= core::mem::size_of::<Storage>());
for i in 0..(bit_width as usize) {
let mask = 1 << i;
let val_bit_is_set = val & mask == mask;
let index = if cfg!(target_endian = "big") {
bit_width as usize - 1 - i
} else {
i
};
unsafe { Self::raw_set_bit(this, index + bit_offset, val_bit_is_set) };
}
}
}
pub const B3_ENABLE_VALIDATION: u32 = 0;
pub const B3_NULL_INDEX: i32 = -1;
pub const B3_HASH_INIT: u32 = 5381;
pub const B3_PI: f64 = 3.14159265359;
pub const B3_DEG_TO_RAD: f64 = 0.01745329251;
pub const B3_RAD_TO_DEG: f64 = 57.2957795131;
pub const B3_MIN_SCALE: f64 = 0.01;
pub const B3_MAX_WORKERS: u32 = 32;
pub const B3_MAX_TASKS: u32 = 256;
pub const B3_GRAPH_COLOR_COUNT: u32 = 24;
pub const B3_CONTACT_MANIFOLD_COUNT_BUCKETS: u32 = 8;
pub const B3_MAX_WORLDS: u32 = 128;
pub const B3_MAX_ROTATION: f64 = 0.7853981633975;
pub const B3_CONTACT_RECYCLE_ANGULAR_DISTANCE: f64 = 0.99240388;
pub const B3_AABB_MARGIN_FRACTION: f64 = 0.125;
pub const B3_TIME_TO_SLEEP: f64 = 0.5;
pub const B3_BODY_NAME_LENGTH: u32 = 18;
pub const B3_SHAPE_NAME_LENGTH: u32 = 18;
pub const B3_MAX_MANIFOLD_POINTS: u32 = 4;
pub const B3_MAX_SHAPE_CAST_POINTS: u32 = 64;
pub const B3_SHAPE_POWER: u32 = 22;
pub const B3_CHILD_POWER: u32 = 20;
pub const B3_MAX_SHAPES: u32 = 4194304;
pub const B3_MAX_CHILD_SHAPES: u32 = 1048576;
pub const B3_DYNAMIC_TREE_VERSION: i64 = -7787375179321898166;
pub const B3_HULL_VERSION: i64 = -7113692011456917490;
pub const B3_MESH_VERSION: i64 = -6066037853393090451;
pub const B3_HEIGHT_FIELD_HOLE: u32 = 255;
pub const B3_HEIGHT_FIELD_VERSION: i64 = -8423759003537458044;
pub const B3_COMPOUND_VERSION: u64 = 2773332450517351837;
pub const B3_MAX_COMPOUND_MESH_MATERIALS: u32 = 4;
#[doc = " Prototype for user allocation function.\n\t@param size the allocation size in bytes\n\t@param alignment the required alignment, guaranteed to be a power of 2"]
pub type b3AllocFcn = ::std::option::Option<
unsafe extern "C" fn(size: i32, alignment: i32) -> *mut ::std::os::raw::c_void,
>;
#[doc = " Prototype for user free function.\n\t@param mem the memory previously allocated through `b3AllocFcn`"]
pub type b3FreeFcn = ::std::option::Option<unsafe extern "C" fn(mem: *mut ::std::os::raw::c_void)>;
#[doc = " Prototype for the user assert callback. Return 0 to skip the debugger break."]
pub type b3AssertFcn = ::std::option::Option<
unsafe extern "C" fn(
condition: *const ::std::os::raw::c_char,
fileName: *const ::std::os::raw::c_char,
lineNumber: ::std::os::raw::c_int,
) -> ::std::os::raw::c_int,
>;
#[doc = " Prototype for user log callback. Used to log warnings."]
pub type b3LogFcn =
::std::option::Option<unsafe extern "C" fn(message: *const ::std::os::raw::c_char)>;
unsafe extern "C" {
#[doc = " This allows the user to override the allocation functions. These should be\n\tset during application startup."]
pub fn b3SetAllocator(allocFcn: b3AllocFcn, freeFcn: b3FreeFcn);
}
unsafe extern "C" {
#[doc = " Total bytes allocated by Box3D"]
pub fn b3GetByteCount() -> i32;
}
unsafe extern "C" {
#[doc = " Override the default assert callback.\n\t@param assertFcn a non-null assert callback"]
pub fn b3SetAssertFcn(assertFcn: b3AssertFcn);
}
unsafe extern "C" {
#[doc = " Internal assertion handler. Allows for host intervention."]
pub fn b3InternalAssert(
condition: *const ::std::os::raw::c_char,
fileName: *const ::std::os::raw::c_char,
lineNumber: ::std::os::raw::c_int,
) -> ::std::os::raw::c_int;
}
unsafe extern "C" {
#[doc = " Override the default logging callback."]
pub fn b3SetLogFcn(logFcn: b3LogFcn);
}
#[doc = " Version numbering scheme.\n See https://semver.org/"]
#[repr(C)]
#[derive(Debug, Copy, Clone)]
pub struct b3Version {
#[doc = " Significant changes"]
pub major: ::std::os::raw::c_int,
#[doc = " Incremental changes"]
pub minor: ::std::os::raw::c_int,
#[doc = " Bug fixes"]
pub revision: ::std::os::raw::c_int,
}
unsafe extern "C" {
#[doc = " Get the current version of Box3D"]
pub fn b3GetVersion() -> b3Version;
}
unsafe extern "C" {
#[doc = " @return true if the library was built with BOX3D_DOUBLE_PRECISION (large world mode)"]
pub fn b3IsDoublePrecision() -> bool;
}
unsafe extern "C" {
#[doc = " Get the absolute number of system ticks. The value is platform specific."]
pub fn b3GetTicks() -> u64;
}
unsafe extern "C" {
#[doc = " Get the milliseconds passed from an initial tick value."]
pub fn b3GetMilliseconds(ticks: u64) -> f32;
}
unsafe extern "C" {
#[doc = " Get the milliseconds passed from an initial tick value."]
pub fn b3GetMillisecondsAndReset(ticks: *mut u64) -> f32;
}
unsafe extern "C" {
#[doc = " Yield to be used in a busy loop."]
pub fn b3Yield();
}
unsafe extern "C" {
#[doc = " Sleep the current thread for a number of milliseconds."]
pub fn b3Sleep(milliseconds: ::std::os::raw::c_int);
}
unsafe extern "C" {
pub fn b3Hash(hash: u32, data: *const u8, count: ::std::os::raw::c_int) -> u32;
}
unsafe extern "C" {
pub fn b3WriteBinaryFile(
data: *mut ::std::os::raw::c_void,
size: ::std::os::raw::c_int,
fileName: *const ::std::os::raw::c_char,
);
}
unsafe extern "C" {
pub fn b3ReadBinaryFile(
prefix: *const ::std::os::raw::c_char,
fileName: *const ::std::os::raw::c_char,
memSize: *mut ::std::os::raw::c_int,
) -> *mut ::std::os::raw::c_void;
}
#[doc = " A 2D vector."]
#[repr(C)]
#[derive(Debug, Copy, Clone)]
pub struct b3Vec2 {
pub x: f32,
pub y: f32,
}
#[doc = " A 3D vector."]
#[repr(C)]
#[derive(Debug, Copy, Clone)]
pub struct b3Vec3 {
pub x: f32,
pub y: f32,
pub z: f32,
}
#[doc = " Cosine and sine pair.\n This uses a custom implementation designed for cross-platform determinism."]
#[repr(C)]
#[derive(Debug, Copy, Clone)]
pub struct b3CosSin {
#[doc = " cosine and sine"]
pub cosine: f32,
pub sine: f32,
}
#[doc = " A quaternion."]
#[repr(C)]
#[derive(Debug, Copy, Clone)]
pub struct b3Quat {
pub v: b3Vec3,
pub s: f32,
}
#[doc = " A rigid transform."]
#[repr(C)]
#[derive(Debug, Copy, Clone)]
pub struct b3Transform {
pub p: b3Vec3,
pub q: b3Quat,
}
#[doc = " In single precision mode these types are the same."]
pub type b3Pos = b3Vec3;
#[doc = " In single precision mode these types are the same."]
pub type b3WorldTransform = b3Transform;
#[doc = " A 3x3 matrix."]
#[repr(C)]
#[derive(Debug, Copy, Clone)]
pub struct b3Matrix3 {
pub cx: b3Vec3,
pub cy: b3Vec3,
pub cz: b3Vec3,
}
#[doc = " Axis aligned bounding box."]
#[repr(C)]
#[derive(Debug, Copy, Clone)]
pub struct b3AABB {
pub lowerBound: b3Vec3,
pub upperBound: b3Vec3,
}
#[doc = " A plane.\n separation = dot(normal, point) - offset"]
#[repr(C)]
#[derive(Debug, Copy, Clone)]
pub struct b3Plane {
pub normal: b3Vec3,
pub offset: f32,
}
unsafe extern "C" {
#[doc = " @return is this float valid (finite and not NaN)."]
pub fn b3IsValidFloat(a: f32) -> bool;
}
unsafe extern "C" {
#[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."]
pub fn b3Atan2(y: f32, x: f32) -> f32;
}
unsafe extern "C" {
#[doc = " Compute the cosine and sine of an angle in radians. Implemented\n for cross-platform determinism."]
pub fn b3ComputeCosSin(radians: f32) -> b3CosSin;
}
unsafe extern "C" {
#[doc = " Extract a quaternion from a rotation matrix."]
pub fn b3MakeQuatFromMatrix(m: *const b3Matrix3) -> b3Quat;
}
unsafe extern "C" {
#[doc = " Find a quaternion that rotates one vector to another."]
pub fn b3ComputeQuatBetweenUnitVectors(v1: b3Vec3, v2: b3Vec3) -> b3Quat;
}
unsafe extern "C" {
#[doc = " Get the inertia tensor of an offset point.\n https://en.wikipedia.org/wiki/Parallel_axis_theorem"]
pub fn b3Steiner(mass: f32, origin: b3Vec3) -> b3Matrix3;
}
#[doc = " The closest points between to segments or infinite lines."]
#[repr(C)]
#[derive(Debug, Copy, Clone)]
pub struct b3SegmentDistanceResult {
pub point1: b3Vec3,
pub fraction1: f32,
pub point2: b3Vec3,
pub fraction2: f32,
}
unsafe extern "C" {
#[doc = " Compute the closest point on the segment a-b to the target q."]
pub fn b3PointToSegmentDistance(a: b3Vec3, b: b3Vec3, q: b3Vec3) -> b3Vec3;
}
unsafe extern "C" {
#[doc = " Compute the closest points on two infinite lines."]
pub fn b3LineDistance(
p1: b3Vec3,
d1: b3Vec3,
p2: b3Vec3,
d2: b3Vec3,
) -> b3SegmentDistanceResult;
}
unsafe extern "C" {
#[doc = " Compute the closest points on two line segments."]
pub fn b3SegmentDistance(
p1: b3Vec3,
q1: b3Vec3,
p2: b3Vec3,
q2: b3Vec3,
) -> b3SegmentDistanceResult;
}
unsafe extern "C" {
#[doc = " Is this a valid vector? Not NaN or infinity."]
pub fn b3IsValidVec3(a: b3Vec3) -> bool;
}
unsafe extern "C" {
#[doc = " Is this a valid quaternion? Not NaN or infinity. Is normalized."]
pub fn b3IsValidQuat(q: b3Quat) -> bool;
}
unsafe extern "C" {
#[doc = " Is this a valid transform? Not NaN or infinity. Is normalized."]
pub fn b3IsValidTransform(a: b3Transform) -> bool;
}
unsafe extern "C" {
#[doc = " Is this a valid matrix? Not NaN or infinity."]
pub fn b3IsValidMatrix3(a: b3Matrix3) -> bool;
}
unsafe extern "C" {
#[doc = " Is this a valid bounding box? Not Nan or infinity. Upper bound greater than or equal to lower bound."]
pub fn b3IsValidAABB(a: b3AABB) -> bool;
}
unsafe extern "C" {
#[doc = " Is this AABB reasonably close to the origin? See B3_HUGE."]
pub fn b3IsBoundedAABB(a: b3AABB) -> bool;
}
unsafe extern "C" {
#[doc = " Is this AABB valid and reasonable?"]
pub fn b3IsSaneAABB(a: b3AABB) -> bool;
}
unsafe extern "C" {
#[doc = " Is this a valid plane? Normal is a unit vector. Not Nan or infinity."]
pub fn b3IsValidPlane(a: b3Plane) -> bool;
}
unsafe extern "C" {
#[doc = " Is this a valid world position? Not NaN or infinity."]
pub fn b3IsValidPosition(p: b3Pos) -> bool;
}
unsafe extern "C" {
#[doc = " Is this a valid world transform? Not NaN or infinity. Rotation is normalized."]
pub fn b3IsValidWorldTransform(t: b3WorldTransform) -> bool;
}
unsafe extern "C" {
#[doc = " Box3D 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 @warning This must be modified before any calls to Box3D"]
pub fn b3SetLengthUnitsPerMeter(lengthUnits: f32);
}
unsafe extern "C" {
#[doc = " Get the current length units per meter."]
pub fn b3GetLengthUnitsPerMeter() -> f32;
}
unsafe extern "C" {
#[doc = " Set the threshold for logging stalls."]
pub fn b3SetStallThreshold(seconds: f32);
}
unsafe extern "C" {
#[doc = " Get the threshold for logging stalls."]
pub fn b3GetStallThreshold() -> f32;
}
#[doc = " World id references a world instance. This should be treated as an opaque handle."]
#[repr(C)]
#[derive(Debug, Copy, Clone)]
pub struct b3WorldId {
pub index1: u16,
pub generation: u16,
}
#[doc = " Body id references a body instance. This should be treated as an opaque handle."]
#[repr(C)]
#[derive(Debug, Copy, Clone)]
pub struct b3BodyId {
pub index1: i32,
pub world0: u16,
pub generation: u16,
}
#[doc = " Shape id references a shape instance. This should be treated as an opaque handle."]
#[repr(C)]
#[derive(Debug, Copy, Clone)]
pub struct b3ShapeId {
pub index1: i32,
pub world0: u16,
pub generation: u16,
}
#[doc = " Joint id references a joint instance. This should be treated as an opaque handle."]
#[repr(C)]
#[derive(Debug, Copy, Clone)]
pub struct b3JointId {
pub index1: i32,
pub world0: u16,
pub generation: u16,
}
#[doc = " Contact id references a contact instance. This should be treated as an opaque handle."]
#[repr(C)]
#[derive(Debug, Copy, Clone)]
pub struct b3ContactId {
pub index1: i32,
pub world0: u16,
pub padding: i16,
pub generation: u32,
}
#[doc = " Task interface\n This is the prototype for a Box3D task. Your task system is expected to run this callback on a worker thread,\n exactly once per enqueue, passing back the same taskContext pointer supplied to b3EnqueueTaskCallback.\n @ingroup world"]
pub type b3TaskCallback =
::std::option::Option<unsafe extern "C" fn(taskContext: *mut ::std::os::raw::c_void)>;
#[doc = " These functions can be provided to Box3D to invoke a task system.\n Returns a pointer to the user's task object. May be nullptr. A nullptr indicates to Box3D that the work was executed\n serially within the callback and there is no need to call b3FinishTaskCallback. Otherwise the returned\n value must be non-null will be passed to b3FinishTaskCallback as the userTask.\n @param task the Box3D task to be called by the scheduler\n @param taskContext the Box3D context object that the scheduler must pass to the task\n @param userContext the scheduler context object that is opaque to Box3D\n @param taskName the Box3D task name that the scheduler can use for diagnostics\n @ingroup world"]
pub type b3EnqueueTaskCallback = ::std::option::Option<
unsafe extern "C" fn(
task: b3TaskCallback,
taskContext: *mut ::std::os::raw::c_void,
userContext: *mut ::std::os::raw::c_void,
taskName: *const ::std::os::raw::c_char,
) -> *mut ::std::os::raw::c_void,
>;
#[doc = " Finishes a user task object that wraps a Box3D task. This must block until the task has completed.\n The step blocks here on the tasks it spawned, so b3World_Step holds its stack across every\n fork/join. Drive it from a thread you can dedicate to the step, or from a fiber this callback can\n park to free the underlying thread. In a job system that cannot park a job's stack, do not call\n b3World_Step from inside a job: a job that blocks on its own sub-jobs without yielding its thread\n can deadlock. The in-tree scheduler instead runs other pending tasks on the waiting thread.\n @ingroup world"]
pub type b3FinishTaskCallback = ::std::option::Option<
unsafe extern "C" fn(
userTask: *mut ::std::os::raw::c_void,
userContext: *mut ::std::os::raw::c_void,
),
>;
#[doc = " The user needs to be able to create debug draw shapes for multi-pass rendering to work efficiently.\n These user shapes are created and destroyed via callback so they can be bound to shape lifetime and scaling updates.\n @ingroup debug_draw"]
pub type b3CreateDebugShapeCallback = ::std::option::Option<
unsafe extern "C" fn(
debugShape: *const b3DebugShape,
userContext: *mut ::std::os::raw::c_void,
) -> *mut ::std::os::raw::c_void,
>;
pub type b3DestroyDebugShapeCallback = ::std::option::Option<
unsafe extern "C" fn(
userShape: *mut ::std::os::raw::c_void,
userContext: *mut ::std::os::raw::c_void,
),
>;
#[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 Box3D state or user application state.\n @ingroup world"]
pub type b3FrictionCallback = ::std::option::Option<
unsafe extern "C" fn(
frictionA: f32,
userMaterialIdA: u64,
frictionB: f32,
userMaterialIdB: u64,
) -> f32,
>;
#[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 Box3D state or user application state.\n @ingroup world"]
pub type b3RestitutionCallback = ::std::option::Option<
unsafe extern "C" fn(
restitutionA: f32,
userMaterialIdA: u64,
restitutionB: f32,
userMaterialIdB: u64,
) -> f32,
>;
#[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. @see b3ShapeDef.\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 is called only for awake dynamic bodies\n Return false if you want to disable the collision\n @warning Do not attempt to modify the world inside this callback\n @ingroup world"]
pub type b3CustomFilterFcn = ::std::option::Option<
unsafe extern "C" fn(
shapeIdA: b3ShapeId,
shapeIdB: b3ShapeId,
context: *mut ::std::os::raw::c_void,
) -> bool,
>;
#[doc = " Prototype for a pre-solve callback.\n This is called after a contact is updated. This allows you to inspect a\n collision before it goes to the solver.\n Notes:\n - this function must be thread-safe\n - this is only called if the shape has enabled pre-solve events\n - this may be called for awake dynamic bodies and sensors\n - this is not called for sensors\n Return false if you want to disable the contact this step\n This has limited information because it is used during CCD which does not have the\n full contact manifold.\n @warning Do not attempt to modify the world inside this callback\n @ingroup world"]
pub type b3PreSolveFcn = ::std::option::Option<
unsafe extern "C" fn(
shapeIdA: b3ShapeId,
shapeIdB: b3ShapeId,
point: b3Pos,
normal: b3Vec3,
context: *mut ::std::os::raw::c_void,
) -> bool,
>;
#[doc = " Prototype callback for overlap queries.\n Called for each shape found in the query.\n @see b3World_OverlapAABB\n @return false to terminate the query.\n @ingroup world"]
pub type b3OverlapResultFcn = ::std::option::Option<
unsafe extern "C" fn(shapeId: b3ShapeId, context: *mut ::std::os::raw::c_void) -> bool,
>;
#[doc = " Prototype callback for ray 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 @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\n @param fraction the fraction along the ray at the point of intersection\n @param userMaterialId the shape or triangle surface type\n @param triangleIndex the triangle index for mesh or height field shapes or -1 for other shape types\n @param childIndex the child shape index for compound shapes\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 b3World_CastRay\n @ingroup world"]
pub type b3CastResultFcn = ::std::option::Option<
unsafe extern "C" fn(
shapeId: b3ShapeId,
point: b3Pos,
normal: b3Vec3,
fraction: f32,
userMaterialId: u64,
triangleIndex: ::std::os::raw::c_int,
childIndex: ::std::os::raw::c_int,
context: *mut ::std::os::raw::c_void,
) -> f32,
>;
#[doc = " Optional world capacities that can be use to avoid run-time allocations\n @ingroup world"]
#[repr(C)]
#[derive(Debug, Copy, Clone)]
pub struct b3Capacity {
#[doc = " Number of expected static shapes."]
pub staticShapeCount: ::std::os::raw::c_int,
#[doc = " Number of expected dynamic and kinematic shapes."]
pub dynamicShapeCount: ::std::os::raw::c_int,
#[doc = " Number of expected static bodies."]
pub staticBodyCount: ::std::os::raw::c_int,
#[doc = " Number of expected dynamic and kinematic bodies."]
pub dynamicBodyCount: ::std::os::raw::c_int,
#[doc = " Number of expected contacts."]
pub contactCount: ::std::os::raw::c_int,
}
#[doc = " World definition used to create a simulation world. Must be initialized using b3DefaultWorldDef.\n @ingroup world"]
#[repr(C)]
#[derive(Debug, Copy, Clone)]
pub struct b3WorldDef {
#[doc = " Gravity vector. Box3D has no up-vector defined."]
pub gravity: b3Vec3,
#[doc = " Restitution speed threshold, usually in m/s. Collisions above this\n speed have restitution applied (will bounce)."]
pub restitutionThreshold: f32,
#[doc = " Hit event speed threshold, usually in m/s. Collisions above this\n speed can generate hit events if the shape also enables hit events."]
pub hitEventThreshold: f32,
#[doc = " Contact stiffness. Cycles per second. Increasing this increases the speed of overlap recovery, but can introduce jitter."]
pub contactHertz: f32,
#[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."]
pub contactDampingRatio: f32,
#[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."]
pub contactSpeed: f32,
#[doc = " Maximum linear speed. Usually meters per second."]
pub maximumLinearSpeed: f32,
#[doc = " Optional mixing callback for friction. The default uses sqrt(frictionA * frictionB)."]
pub frictionCallback: b3FrictionCallback,
#[doc = " Optional mixing callback for restitution. The default uses max(restitutionA, restitutionB)."]
pub restitutionCallback: b3RestitutionCallback,
#[doc = " Can bodies go to sleep to improve performance"]
pub enableSleep: bool,
#[doc = " Enable continuous collision"]
pub enableContinuous: bool,
#[doc = " Number of workers to use with the provided task system. Box3D 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 This is clamped to the range [1, B3_MAX_WORKERS]. Using a value above 1 will turn on multithreading.\n If task callbacks are provided then Box3D will use the user provided task system. Otherwise Box3D\n will create threads and use an internal scheduler."]
pub workerCount: u32,
#[doc = " function to spawn task"]
pub enqueueTask: b3EnqueueTaskCallback,
#[doc = " function to finish a task"]
pub finishTask: b3FinishTaskCallback,
#[doc = " User context that is provided to enqueueTask and finishTask"]
pub userTaskContext: *mut ::std::os::raw::c_void,
#[doc = " User data associated with a world"]
pub userData: *mut ::std::os::raw::c_void,
#[doc = " Used to create debug draw shapes. This is called when a shape is\n first drawn using b3DebugDraw."]
pub createDebugShape: b3CreateDebugShapeCallback,
#[doc = " Used to destroy debug draw shapes. This is called when a shape is modified or destroyed."]
pub destroyDebugShape: b3DestroyDebugShapeCallback,
#[doc = " This is passed to the debug shape callbacks to provide a user context."]
pub userDebugShapeContext: *mut ::std::os::raw::c_void,
#[doc = " Optional initial capacities"]
pub capacity: b3Capacity,
#[doc = " Used internally to detect a valid definition. DO NOT SET."]
pub internalValue: ::std::os::raw::c_int,
}
unsafe extern "C" {
#[doc = " Use this to initialize your world definition\n @ingroup world"]
pub fn b3DefaultWorldDef() -> b3WorldDef;
}
#[doc = " zero mass, zero velocity, may be manually moved"]
pub const b3BodyType_b3_staticBody: b3BodyType = 0;
#[doc = " zero mass, velocity set by user, moved by solver"]
pub const b3BodyType_b3_kinematicBody: b3BodyType = 1;
#[doc = " positive mass, velocity determined by forces, moved by solver"]
pub const b3BodyType_b3_dynamicBody: b3BodyType = 2;
#[doc = " number of body types"]
pub const b3BodyType_b3_bodyTypeCount: b3BodyType = 3;
#[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"]
pub type b3BodyType = ::std::os::raw::c_int;
#[doc = " Motion locks to restrict the body movement\n @ingroup body"]
#[repr(C)]
#[derive(Debug, Copy, Clone)]
pub struct b3MotionLocks {
#[doc = " Prevent translation along the x-axis"]
pub linearX: bool,
#[doc = " Prevent translation along the y-axis"]
pub linearY: bool,
#[doc = " Prevent translation along the z-axis"]
pub linearZ: bool,
#[doc = " Prevent rotation around the x-axis"]
pub angularX: bool,
#[doc = " Prevent rotation around the y-axis"]
pub angularY: bool,
#[doc = " Prevent rotation around the z-axis"]
pub angularZ: bool,
}
#[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 b3DefaultBodyDef().\n @ingroup body"]
#[repr(C)]
#[derive(Debug, Copy, Clone)]
pub struct b3BodyDef {
#[doc = " The body type: static, kinematic, or dynamic."]
pub type_: b3BodyType,
#[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."]
pub position: b3Pos,
#[doc = " The initial world rotation of the body."]
pub rotation: b3Quat,
#[doc = " The initial linear velocity of the body's origin. Usually in meters per second."]
pub linearVelocity: b3Vec3,
#[doc = " The initial angular velocity of the body. Radians per second."]
pub angularVelocity: b3Vec3,
#[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."]
pub linearDamping: f32,
#[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 used to slow down rotating bodies."]
pub angularDamping: f32,
#[doc = " Scale the gravity applied to this body. Non-dimensional."]
pub gravityScale: f32,
#[doc = " Sleep speed threshold, default is 0.05 meters per second"]
pub sleepThreshold: f32,
#[doc = " Optional body name for debugging. Up to B3_BODY_NAME_LENGTH characters (including null termination)"]
pub name: *const ::std::os::raw::c_char,
#[doc = " Use this to store application specific body data."]
pub userData: *mut ::std::os::raw::c_void,
#[doc = " Motions locks to restrict linear and angular movement"]
pub motionLocks: b3MotionLocks,
#[doc = " Set this flag to false if this body should never fall asleep."]
pub enableSleep: bool,
#[doc = " Is this body initially awake or sleeping?"]
pub isAwake: bool,
#[doc = " Treat this body as a 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. They do not guarantee accurate collision if both bodies are fast moving because\n the bullet does a continuous check after all non-bullet bodies have moved. You could get unlucky and have\n the bullet body end a time step very close to a non-bullet body and the non-bullet body then moves over\n the bullet body. In continuous collision, initial overlap is ignored to avoid freezing bodies in place.\n I do not recommend using them for game projectiles if precise collision timing is needed. Instead consider\n using a ray or shape cast. You can use a marching ray or shape cast for projectile that moves over time.\n If you want a fast moving projectile to collide with a fast moving target, you need to consider the relative\n movement in your ray or shape cast. This is out of the scope of Box3D.\n So what are good use cases for bullets? Pinball games or games with dynamic containers that hold other objects.\n It should be a use case where it doesn't break the game if there is a collision missed, but having them\n captured improves the quality of the game."]
pub isBullet: bool,
#[doc = " Used to disable a body. A disabled body does not move or collide."]
pub isEnabled: bool,
#[doc = " This allows this body to bypass rotational speed limits. Should only be used\n for circular objects, like wheels."]
pub allowFastRotation: bool,
#[doc = " Enable contact recycling. True by default. Leaving this enabled improves performance\n but may lead to ghost collision that should be avoided on characters."]
pub enableContactRecycling: bool,
#[doc = " Used internally to detect a valid definition. DO NOT SET."]
pub internalValue: ::std::os::raw::c_int,
}
unsafe extern "C" {
#[doc = " Use this to initialize your body definition\n @ingroup body"]
pub fn b3DefaultBodyDef() -> b3BodyDef;
}
#[doc = " This is used to filter collision on shapes. It affects shape-vs-shape collision\n and shape-versus-query collision (such as b3World_CastRay).\n @ingroup shape"]
#[repr(C)]
#[derive(Debug, Copy, Clone)]
pub struct b3Filter {
#[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"]
pub categoryBits: u64,
#[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"]
pub maskBits: u64,
#[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."]
pub groupIndex: ::std::os::raw::c_int,
}
unsafe extern "C" {
#[doc = " Use this to initialize your filter\n @ingroup shape"]
pub fn b3DefaultFilter() -> b3Filter;
}
#[doc = " Material properties supported per triangle on meshes and height fields\n @ingroup shape"]
#[repr(C)]
#[derive(Debug, Copy, Clone)]
pub struct b3SurfaceMaterial {
#[doc = " The Coulomb (dry) friction coefficient, usually in the range [0,1]."]
pub friction: f32,
#[doc = " The coefficient of restitution (bounce) usually in the range [0,1].\n https://en.wikipedia.org/wiki/Coefficient_of_restitution"]
pub restitution: f32,
#[doc = " The rolling resistance usually in the range [0,1]. This is only used for spheres and capsules."]
pub rollingResistance: f32,
#[doc = " The tangent velocity for conveyor belts. This is local to the shape and will be projected\n onto the contact surface."]
pub tangentVelocity: b3Vec3,
#[doc = " User material identifier. This is passed with query results and to friction and restitution\n combining functions. It is not used internally."]
pub userMaterialId: u64,
#[doc = " Custom debug draw color. Ignored if 0. The low 24 bits are RGB. The high byte may\n carry a b3DebugMaterial preset, see b3MakeDebugColor.\n @see b3HexColor"]
pub customColor: u32,
}
unsafe extern "C" {
#[doc = " Use this to initialize your surface material\n @ingroup shape"]
pub fn b3DefaultSurfaceMaterial() -> b3SurfaceMaterial;
}
#[doc = " A capsule is an extruded sphere"]
pub const b3ShapeType_b3_capsuleShape: b3ShapeType = 0;
#[doc = " A compound shape composed of up to 64K spheres, capsules, hulls, and meshes"]
pub const b3ShapeType_b3_compoundShape: b3ShapeType = 1;
#[doc = " A height field useful for terrain"]
pub const b3ShapeType_b3_heightShape: b3ShapeType = 2;
#[doc = " A convex hull"]
pub const b3ShapeType_b3_hullShape: b3ShapeType = 3;
#[doc = " A triangle soup"]
pub const b3ShapeType_b3_meshShape: b3ShapeType = 4;
#[doc = " A sphere with an offset"]
pub const b3ShapeType_b3_sphereShape: b3ShapeType = 5;
#[doc = " The number of shape types"]
pub const b3ShapeType_b3_shapeTypeCount: b3ShapeType = 6;
#[doc = " Shape type\n @ingroup shape"]
pub type b3ShapeType = ::std::os::raw::c_int;
#[doc = " Used to create a shape\n @ingroup shape"]
#[repr(C)]
#[derive(Debug, Copy, Clone)]
pub struct b3ShapeDef {
#[doc = " Use this to store application specific shape data."]
pub userData: *mut ::std::os::raw::c_void,
#[doc = " Surface material used on mesh shapes per triangle. Ignored for convex shapes. Ignored for compound shapes."]
pub materials: *mut b3SurfaceMaterial,
#[doc = " Surface material count."]
pub materialCount: ::std::os::raw::c_int,
#[doc = " The base surface material. Ignored for compound shapes."]
pub baseMaterial: b3SurfaceMaterial,
#[doc = " The density, usually in kg/m^3."]
pub density: f32,
#[doc = " Explosion scale for b3World_Explode. non-dimensional"]
pub explosionScale: f32,
#[doc = " Contact filtering data."]
pub filter: b3Filter,
#[doc = " Enable custom filtering. Only one of the two shapes needs to enable custom filtering. See b3WorldDef."]
pub enableCustomFiltering: bool,
#[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"]
pub isSensor: bool,
#[doc = " Enable sensor events for this shape. This applies to sensors and non-sensors. False by default, even for sensors."]
pub enableSensorEvents: bool,
#[doc = " Enable contact events for this shape. Only applies to kinematic and dynamic bodies. Ignored for sensors. False by default."]
pub enableContactEvents: bool,
#[doc = " Enable hit events for this shape. Only applies to kinematic and dynamic bodies. Ignored for sensors. False by default."]
pub enableHitEvents: bool,
#[doc = " Enable pre-solve contact events for this shape. Only applies to dynamic bodies. These are expensive\n\tand must be carefully handled due to multithreading. Ignored for sensors."]
pub enablePreSolveEvents: bool,
#[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."]
pub invokeContactCreation: bool,
#[doc = " Should the body update the mass properties when this shape is created. Default is true."]
pub updateBodyMass: bool,
#[doc = " Used internally to detect a valid definition. DO NOT SET."]
pub internalValue: ::std::os::raw::c_int,
}
unsafe extern "C" {
#[doc = " Use this to initialize your shape definition\n @ingroup shape"]
pub fn b3DefaultShapeDef() -> b3ShapeDef;
}
#[doc = "! @cond\n Profiling data. Times are in milliseconds.\n @ingroup world"]
#[repr(C)]
#[derive(Debug, Copy, Clone)]
pub struct b3Profile {
pub step: f32,
pub pairs: f32,
pub collide: f32,
pub solve: f32,
pub solverSetup: f32,
pub constraints: f32,
pub prepareConstraints: f32,
pub integrateVelocities: f32,
pub warmStart: f32,
pub solveImpulses: f32,
pub integratePositions: f32,
pub relaxImpulses: f32,
pub applyRestitution: f32,
pub storeImpulses: f32,
pub splitIslands: f32,
pub transforms: f32,
pub sensorHits: f32,
pub jointEvents: f32,
pub hitEvents: f32,
pub refit: f32,
pub bullets: f32,
pub sleepIslands: f32,
pub sensors: f32,
}
#[doc = " Counters that give details of the simulation size.\n @ingroup world"]
#[repr(C)]
#[derive(Debug, Copy, Clone)]
pub struct b3Counters {
pub bodyCount: ::std::os::raw::c_int,
pub shapeCount: ::std::os::raw::c_int,
pub contactCount: ::std::os::raw::c_int,
pub jointCount: ::std::os::raw::c_int,
pub islandCount: ::std::os::raw::c_int,
pub stackUsed: ::std::os::raw::c_int,
pub arenaCapacity: ::std::os::raw::c_int,
pub staticTreeHeight: ::std::os::raw::c_int,
pub treeHeight: ::std::os::raw::c_int,
pub satCallCount: ::std::os::raw::c_int,
pub satCacheHitCount: ::std::os::raw::c_int,
pub byteCount: ::std::os::raw::c_int,
pub taskCount: ::std::os::raw::c_int,
pub colorCounts: [::std::os::raw::c_int; 24usize],
pub manifoldCounts: [::std::os::raw::c_int; 8usize],
#[doc = " Number of contacts touched by the collide pass\n graph contacts + awake-set non-touching"]
pub awakeContactCount: ::std::os::raw::c_int,
#[doc = " Number of contacts recycled in the most recent step."]
pub recycledContactCount: ::std::os::raw::c_int,
#[doc = " Maximum number of time of impact iterations"]
pub distanceIterations: ::std::os::raw::c_int,
pub pushBackIterations: ::std::os::raw::c_int,
pub rootIterations: ::std::os::raw::c_int,
}
pub const b3JointType_b3_parallelJoint: b3JointType = 0;
pub const b3JointType_b3_distanceJoint: b3JointType = 1;
pub const b3JointType_b3_filterJoint: b3JointType = 2;
pub const b3JointType_b3_motorJoint: b3JointType = 3;
pub const b3JointType_b3_prismaticJoint: b3JointType = 4;
pub const b3JointType_b3_revoluteJoint: b3JointType = 5;
pub const b3JointType_b3_sphericalJoint: b3JointType = 6;
pub const b3JointType_b3_weldJoint: b3JointType = 7;
pub const b3JointType_b3_wheelJoint: b3JointType = 8;
#[doc = " Joint type enumeration. This is useful because all joint types use b3JointId and sometimes you\n want to get the type of a joint.\n @ingroup joint"]
pub type b3JointType = ::std::os::raw::c_int;
#[doc = " Base joint definition used by all joint types. The local frames are measured from the\n 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.\n @ingroup joint"]
#[repr(C)]
#[derive(Debug, Copy, Clone)]
pub struct b3JointDef {
#[doc = " User data pointer"]
pub userData: *mut ::std::os::raw::c_void,
#[doc = " The first attached body"]
pub bodyIdA: b3BodyId,
#[doc = " The second attached body"]
pub bodyIdB: b3BodyId,
#[doc = " The first local joint frame"]
pub localFrameA: b3Transform,
#[doc = " The second local joint frame"]
pub localFrameB: b3Transform,
#[doc = " Force threshold for joint events"]
pub forceThreshold: f32,
#[doc = " Torque threshold for joint events"]
pub torqueThreshold: f32,
#[doc = " Constraint hertz (advanced feature)"]
pub constraintHertz: f32,
#[doc = " Constraint damping ratio (advanced feature)"]
pub constraintDampingRatio: f32,
#[doc = " Debug draw scale"]
pub drawScale: f32,
#[doc = " Set this flag to true if the attached bodies should collide"]
pub collideConnected: bool,
#[doc = " Used internally to detect a valid definition. DO NOT SET."]
pub internalValue: ::std::os::raw::c_int,
}
#[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"]
#[repr(C)]
#[derive(Debug, Copy, Clone)]
pub struct b3DistanceJointDef {
#[doc = " Base joint definition"]
pub base: b3JointDef,
#[doc = " The rest length of this joint. Clamped to a stable minimum value."]
pub length: f32,
#[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."]
pub enableSpring: bool,
#[doc = " The lower spring force controls how much tension it can sustain"]
pub lowerSpringForce: f32,
#[doc = " The upper spring force controls how much compression it can sustain"]
pub upperSpringForce: f32,
#[doc = " The spring linear stiffness Hertz, cycles per second"]
pub hertz: f32,
#[doc = " The spring linear damping ratio, non-dimensional"]
pub dampingRatio: f32,
#[doc = " Enable/disable the joint limit"]
pub enableLimit: bool,
#[doc = " Minimum length. Clamped to a stable minimum value."]
pub minLength: f32,
#[doc = " Maximum length. Must be greater than or equal to the minimum length."]
pub maxLength: f32,
#[doc = " Enable/disable the joint motor"]
pub enableMotor: bool,
#[doc = " The maximum motor force, usually in newtons"]
pub maxMotorForce: f32,
#[doc = " The desired motor speed, usually in meters per second"]
pub motorSpeed: f32,
}
unsafe extern "C" {
#[doc = " Use this to initialize your joint definition\n @ingroup distance_joint"]
pub fn b3DefaultDistanceJointDef() -> b3DistanceJointDef;
}
#[doc = " A motor joint is used to control the relative position and velocity between two bodies.\n @ingroup motor_joint"]
#[repr(C)]
#[derive(Debug, Copy, Clone)]
pub struct b3MotorJointDef {
#[doc = " Base joint definition"]
pub base: b3JointDef,
#[doc = " The desired linear velocity"]
pub linearVelocity: b3Vec3,
#[doc = " The maximum motor force in newtons"]
pub maxVelocityForce: f32,
#[doc = " The desired angular velocity"]
pub angularVelocity: b3Vec3,
#[doc = " The maximum motor torque in newton-meters"]
pub maxVelocityTorque: f32,
#[doc = " Linear spring hertz for position control"]
pub linearHertz: f32,
#[doc = " Linear spring damping ratio"]
pub linearDampingRatio: f32,
#[doc = " Maximum spring force in newtons"]
pub maxSpringForce: f32,
#[doc = " Angular spring hertz for position control"]
pub angularHertz: f32,
#[doc = " Angular spring damping ratio"]
pub angularDampingRatio: f32,
#[doc = " Maximum spring torque in newton-meters"]
pub maxSpringTorque: f32,
}
unsafe extern "C" {
#[doc = " Use this to initialize your joint definition\n @ingroup motor_joint"]
pub fn b3DefaultMotorJointDef() -> b3MotorJointDef;
}
#[doc = " A filter joint is used to disable collision between two specific bodies.\n @ingroup filter_joint"]
#[repr(C)]
#[derive(Debug, Copy, Clone)]
pub struct b3FilterJointDef {
#[doc = " Base joint definition"]
pub base: b3JointDef,
}
unsafe extern "C" {
#[doc = " Use this to initialize your joint definition\n @ingroup filter_joint"]
pub fn b3DefaultFilterJointDef() -> b3FilterJointDef;
}
#[doc = " Parallel joint definition. Constrains the angle between axis z in body A and axis z in body B\n using a spring. Useful to keep a body upright.\n @ingroup parallel_joint"]
#[repr(C)]
#[derive(Debug, Copy, Clone)]
pub struct b3ParallelJointDef {
#[doc = " Base joint definition"]
pub base: b3JointDef,
#[doc = " The spring stiffness Hertz, cycles per second"]
pub hertz: f32,
#[doc = " The spring damping ratio, non-dimensional"]
pub dampingRatio: f32,
#[doc = " The maximum spring torque, typically in newton-meters."]
pub maxTorque: f32,
}
unsafe extern "C" {
#[doc = " Use this to initialize your joint definition\n @ingroup parallel_joint"]
pub fn b3DefaultParallelJointDef() -> b3ParallelJointDef;
}
#[doc = " Prismatic joint definition. Body B may slide along the x-axis in local frame A.\n Body B cannot rotate relative to body A. The joint translation is zero when the\n local frame origins coincide in world space.\n @ingroup prismatic_joint"]
#[repr(C)]
#[derive(Debug, Copy, Clone)]
pub struct b3PrismaticJointDef {
#[doc = " Base joint definition"]
pub base: b3JointDef,
#[doc = " Enable a linear spring along the prismatic joint axis"]
pub enableSpring: bool,
#[doc = " The spring stiffness Hertz, cycles per second"]
pub hertz: f32,
#[doc = " The spring damping ratio, non-dimensional"]
pub dampingRatio: f32,
#[doc = " The target translation for the joint in meters. The spring-damper will drive\n to this translation."]
pub targetTranslation: f32,
#[doc = " Enable/disable the joint limit"]
pub enableLimit: bool,
#[doc = " The lower translation limit"]
pub lowerTranslation: f32,
#[doc = " The upper translation limit"]
pub upperTranslation: f32,
#[doc = " Enable/disable the joint motor"]
pub enableMotor: bool,
#[doc = " The maximum motor force, typically in newtons"]
pub maxMotorForce: f32,
#[doc = " The desired motor speed, typically in meters per second"]
pub motorSpeed: f32,
}
unsafe extern "C" {
#[doc = " Use this to initialize your joint definition\n @ingroup prismatic_joint"]
pub fn b3DefaultPrismaticJointDef() -> b3PrismaticJointDef;
}
#[doc = " Revolute joint definition. A point on body B is fixed to a point on body A.\n Allows relative rotation about the z-axis.\n @ingroup revolute_joint"]
#[repr(C)]
#[derive(Debug, Copy, Clone)]
pub struct b3RevoluteJointDef {
#[doc = " Base joint definition."]
pub base: b3JointDef,
#[doc = " The bodyB angle minus bodyA angle in the reference state (radians).\n This defines the zero angle for the joint limit."]
pub targetAngle: f32,
#[doc = " Enable a rotational spring on the revolute hinge axis."]
pub enableSpring: bool,
#[doc = " The spring stiffness Hertz, cycles per second."]
pub hertz: f32,
#[doc = " The spring damping ratio, non-dimensional."]
pub dampingRatio: f32,
#[doc = " A flag to enable joint limits."]
pub enableLimit: bool,
#[doc = " The lower angle for the joint limit in radians. Minimum of -0.99*pi radians."]
pub lowerAngle: f32,
#[doc = " The upper angle for the joint limit in radians. Maximum of 0.99*pi radians."]
pub upperAngle: f32,
#[doc = " A flag to enable the joint motor."]
pub enableMotor: bool,
#[doc = " The maximum motor torque, typically in newton-meters."]
pub maxMotorTorque: f32,
#[doc = " The desired motor speed in radians per second."]
pub motorSpeed: f32,
}
unsafe extern "C" {
#[doc = " Use this to initialize your joint definition.\n @ingroup revolute_joint"]
pub fn b3DefaultRevoluteJointDef() -> b3RevoluteJointDef;
}
#[doc = " Spherical joint definition. A point on body B is fixed to a point on body A.\n Allows rotation about the shared point.\n @ingroup spherical_joint"]
#[repr(C)]
#[derive(Debug, Copy, Clone)]
pub struct b3SphericalJointDef {
#[doc = " Base joint definition"]
pub base: b3JointDef,
#[doc = " Enable a rotational spring that attempts to align the two joint frames."]
pub enableSpring: bool,
#[doc = " The spring stiffness Hertz, cycles per second. This may be clamped internally\n according to the time step to maintain stability. Non-negative number."]
pub hertz: f32,
#[doc = " The spring damping ratio, non-dimensional. Non-negative number."]
pub dampingRatio: f32,
#[doc = " Target spring rotation, joint frame B relative to joint frame A."]
pub targetRotation: b3Quat,
#[doc = " A flag to enable the cone limit. The cone is centered on the frameA z-axis."]
pub enableConeLimit: bool,
#[doc = " The angle for the cone limit in radians. Valid range is [0, pi]"]
pub coneAngle: f32,
#[doc = " A flag to enable the twist limit. The twist is centered on the frameB z-axis."]
pub enableTwistLimit: bool,
#[doc = " The angle for the lower twist limit in radians. Minimum of -0.99*pi radians."]
pub lowerTwistAngle: f32,
#[doc = " The angle for the upper twist limit in radians. Maximum of 0.99*pi radians."]
pub upperTwistAngle: f32,
#[doc = " A flag to enable the joint motor"]
pub enableMotor: bool,
#[doc = " The maximum motor torque, typically in newton-meters. Non-negative number."]
pub maxMotorTorque: f32,
#[doc = " The desired motor angular velocity in radians per second."]
pub motorVelocity: b3Vec3,
}
unsafe extern "C" {
#[doc = " Use this to initialize your joint definition.\n @ingroup spherical_joint"]
pub fn b3DefaultSphericalJointDef() -> b3SphericalJointDef;
}
#[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 Box3D cannot hold many bodies together rigidly\n @ingroup weld_joint"]
#[repr(C)]
#[derive(Debug, Copy, Clone)]
pub struct b3WeldJointDef {
#[doc = " Base joint definition"]
pub base: b3JointDef,
#[doc = " Linear stiffness expressed as Hertz (cycles per second). Use zero for maximum stiffness."]
pub linearHertz: f32,
#[doc = " Angular stiffness as Hertz (cycles per second). Use zero for maximum stiffness."]
pub angularHertz: f32,
#[doc = " Linear damping ratio, non-dimensional. Use 1 for critical damping."]
pub linearDampingRatio: f32,
#[doc = " Linear damping ratio, non-dimensional. Use 1 for critical damping."]
pub angularDampingRatio: f32,
}
unsafe extern "C" {
#[doc = " Use this to initialize your joint definition\n @ingroup weld_joint"]
pub fn b3DefaultWeldJointDef() -> b3WeldJointDef;
}
#[doc = " Wheel joint definition\n Body A is the chassis and body B is the wheel.\n The wheel rotates around the local z-axis in frame B.\n The wheel translates along the local x-axis in frame A.\n The wheel can optionally steer along the x-axis in frame A.\n @ingroup wheel_joint"]
#[repr(C)]
#[derive(Debug, Copy, Clone)]
pub struct b3WheelJointDef {
#[doc = " Base joint definition"]
pub base: b3JointDef,
#[doc = " Enable a linear spring along the local axis"]
pub enableSuspensionSpring: bool,
#[doc = " Spring stiffness in Hertz"]
pub suspensionHertz: f32,
#[doc = " Spring damping ratio, non-dimensional"]
pub suspensionDampingRatio: f32,
#[doc = " Enable/disable the joint linear limit"]
pub enableSuspensionLimit: bool,
#[doc = " The lower suspension translation limit"]
pub lowerSuspensionLimit: f32,
#[doc = " The upper translation limit"]
pub upperSuspensionLimit: f32,
#[doc = " Enable/disable the joint rotational motor"]
pub enableSpinMotor: bool,
#[doc = " The maximum motor torque, typically in newton-meters"]
pub maxSpinTorque: f32,
#[doc = " The desired motor speed in radians per second"]
pub spinSpeed: f32,
#[doc = " Enable steering, otherwise the steering is fixed forward"]
pub enableSteering: bool,
#[doc = " Steering stiffness in Hertz"]
pub steeringHertz: f32,
#[doc = " Spring damping ratio, non-dimensional"]
pub steeringDampingRatio: f32,
#[doc = " The target steering angle in radians"]
pub targetSteeringAngle: f32,
#[doc = " The maximum steering torque in N*m"]
pub maxSteeringTorque: f32,
#[doc = " Enable/disable the steering angular limit"]
pub enableSteeringLimit: bool,
#[doc = " The lower steering angle in radians"]
pub lowerSteeringLimit: f32,
#[doc = " The upper steering angle in radians"]
pub upperSteeringLimit: f32,
}
unsafe extern "C" {
#[doc = " Use this to initialize your joint definition\n @ingroup wheel_joint"]
pub fn b3DefaultWheelJointDef() -> b3WheelJointDef;
}
#[doc = " The explosion definition is used to configure options for explosions. Explosions\n consider shape geometry when computing the impulse.\n @ingroup world"]
#[repr(C)]
#[derive(Debug, Copy, Clone)]
pub struct b3ExplosionDef {
#[doc = " Mask bits to filter shapes"]
pub maskBits: u64,
#[doc = " The center of the explosion in world space"]
pub position: b3Pos,
#[doc = " The radius of the explosion"]
pub radius: f32,
#[doc = " The falloff distance beyond the radius. Impulse is reduced to zero at this distance."]
pub falloff: f32,
#[doc = " Impulse per unit area. This applies an impulse according to the shape area that\n is facing the explosion. Explosions only apply to spheres, capsules, and hulls. This\n may be negative for implosions."]
pub impulsePerArea: f32,
}
unsafe extern "C" {
#[doc = " Use this to initialize your explosion definition\n @ingroup world"]
pub fn b3DefaultExplosionDef() -> b3ExplosionDef;
}
#[doc = " A begin-touch event is generated when a shape starts to overlap a sensor shape."]
#[repr(C)]
#[derive(Debug, Copy, Clone)]
pub struct b3SensorBeginTouchEvent {
#[doc = " The id of the sensor shape"]
pub sensorShapeId: b3ShapeId,
#[doc = " The id of the shape that began touching the sensor shape"]
pub visitorShapeId: b3ShapeId,
}
#[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 b3Shape_IsValid."]
#[repr(C)]
#[derive(Debug, Copy, Clone)]
pub struct b3SensorEndTouchEvent {
#[doc = " The id of the sensor shape\n\t@warning this shape may have been destroyed\n\t@see b3Shape_IsValid"]
pub sensorShapeId: b3ShapeId,
#[doc = " The id of the shape that stopped touching the sensor shape\n\t@warning this shape may have been destroyed\n\t@see b3Shape_IsValid"]
pub visitorShapeId: b3ShapeId,
}
#[doc = " Sensor events are buffered in the world and are available\n\tas begin/end overlap event arrays after the time step is complete.\n\tNote: these may become invalid if bodies and/or shapes are destroyed"]
#[repr(C)]
#[derive(Debug, Copy, Clone)]
pub struct b3SensorEvents {
#[doc = " Array of sensor begin touch events"]
pub beginEvents: *mut b3SensorBeginTouchEvent,
#[doc = " Array of sensor end touch events"]
pub endEvents: *mut b3SensorEndTouchEvent,
#[doc = " The number of begin touch events"]
pub beginCount: ::std::os::raw::c_int,
#[doc = " The number of end touch events"]
pub endCount: ::std::os::raw::c_int,
}
#[doc = " A begin-touch event is generated when two shapes begin touching."]
#[repr(C)]
#[derive(Debug, Copy, Clone)]
pub struct b3ContactBeginTouchEvent {
#[doc = " Id of the first shape"]
pub shapeIdA: b3ShapeId,
#[doc = " Id of the second shape"]
pub shapeIdB: b3ShapeId,
#[doc = " The transient contact id. This contact may be destroyed automatically when the world is modified or simulated.\n Use b3Contact_IsValid before using this id."]
pub contactId: b3ContactId,
}
#[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."]
#[repr(C)]
#[derive(Debug, Copy, Clone)]
pub struct b3ContactEndTouchEvent {
#[doc = " Id of the first shape\n\t@warning this shape may have been destroyed\n\t@see b3Shape_IsValid"]
pub shapeIdA: b3ShapeId,
#[doc = " Id of the first shape\n\t@warning this shape may have been destroyed\n\t@see b3Shape_IsValid"]
pub shapeIdB: b3ShapeId,
#[doc = " Id of the contact.\n\t@warning this contact may have been destroyed\n\t@see b3Contact_IsValid"]
pub contactId: b3ContactId,
}
#[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."]
#[repr(C)]
#[derive(Debug, Copy, Clone)]
pub struct b3ContactHitEvent {
#[doc = " Id of the first shape"]
pub shapeIdA: b3ShapeId,
#[doc = " Id of the second shape"]
pub shapeIdB: b3ShapeId,
#[doc = " Id of the contact.\n\t@warning this contact may have been destroyed\n\t@see b3Contact_IsValid"]
pub contactId: b3ContactId,
#[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."]
pub point: b3Pos,
#[doc = " Normal vector pointing from shape A to shape B"]
pub normal: b3Vec3,
#[doc = " The speed the shapes are approaching. Always positive. Typically in meters per second."]
pub approachSpeed: f32,
#[doc = " User material on shape A"]
pub userMaterialIdA: u64,
#[doc = " User material on shape B"]
pub userMaterialIdB: u64,
}
#[doc = " Contact events are buffered in the world and are available\n\tas event arrays after the time step is complete.\n\tNote: these may become invalid if bodies and/or shapes are destroyed"]
#[repr(C)]
#[derive(Debug, Copy, Clone)]
pub struct b3ContactEvents {
#[doc = " Array of begin touch events"]
pub beginEvents: *mut b3ContactBeginTouchEvent,
#[doc = " Array of end touch events"]
pub endEvents: *mut b3ContactEndTouchEvent,
#[doc = " Array of hit events"]
pub hitEvents: *mut b3ContactHitEvent,
#[doc = " Number of begin touch events"]
pub beginCount: ::std::os::raw::c_int,
#[doc = " Number of end touch events"]
pub endCount: ::std::os::raw::c_int,
#[doc = " Number of hit events"]
pub hitCount: ::std::os::raw::c_int,
}
#[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 b3Body_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."]
#[repr(C)]
#[derive(Debug, Copy, Clone)]
pub struct b3BodyMoveEvent {
#[doc = " The body user data."]
pub userData: *mut ::std::os::raw::c_void,
#[doc = " The body transform."]
pub transform: b3WorldTransform,
#[doc = " The body id."]
pub bodyId: b3BodyId,
#[doc = " Did the body fall asleep this time step?"]
pub fellAsleep: bool,
}
#[doc = " Body events are buffered in the world and are available\n\tas event arrays after the time step is complete.\n\tNote: this data becomes invalid if bodies are destroyed"]
#[repr(C)]
#[derive(Debug, Copy, Clone)]
pub struct b3BodyEvents {
#[doc = " Array of move events"]
pub moveEvents: *mut b3BodyMoveEvent,
#[doc = " Number of move events"]
pub moveCount: ::std::os::raw::c_int,
}
#[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."]
#[repr(C)]
#[derive(Debug, Copy, Clone)]
pub struct b3JointEvent {
#[doc = " The joint id"]
pub jointId: b3JointId,
#[doc = " The user data from the joint for convenience"]
pub userData: *mut ::std::os::raw::c_void,
}
#[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"]
#[repr(C)]
#[derive(Debug, Copy, Clone)]
pub struct b3JointEvents {
#[doc = " Array of events"]
pub jointEvents: *mut b3JointEvent,
#[doc = " Number of events"]
pub count: ::std::os::raw::c_int,
}
#[doc = " The contact data for two shapes. By convention the manifold normal points\n from shape A to shape B.\n @see b3Shape_GetContactData() and b3Body_GetContactData()"]
#[repr(C)]
#[derive(Debug, Copy, Clone)]
pub struct b3ContactData {
#[doc = " The contact id. You may hold onto this to track a contact across time steps.\n This id may become orphaned. Use b3Contact_IsValid before using it for other functions."]
pub contactId: b3ContactId,
#[doc = " The first shape id."]
pub shapeIdA: b3ShapeId,
#[doc = " The second shape id."]
pub shapeIdB: b3ShapeId,
#[doc = " The contact manifold. This points to internal data and may become invalid. Do not store\n this pointer."]
pub manifolds: *const b3Manifold,
#[doc = " The number of contact manifolds. For mesh and height-field collision there can be multiple manifolds."]
pub manifoldCount: ::std::os::raw::c_int,
}
#[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."]
#[repr(C)]
#[derive(Debug, Copy, Clone)]
pub struct b3QueryFilter {
#[doc = " The collision category bits of this query. Normally you would just set one bit."]
pub categoryBits: u64,
#[doc = " The collision mask bits. This states the shape categories that this\n query would accept for collision."]
pub maskBits: u64,
#[doc = " Optional id combined with @ref name to identify this query in a recording, e.g. an entity id.\n Need not be unique on its own. 0 with a null name means untagged. Ignored when not recording."]
pub id: u64,
#[doc = " Optional label combined with @ref id to identify this query, e.g. \"bullet\". Need not be unique\n on its own. The recorder hashes (id, name) into one stable key the viewer tracks the query by,\n so the same id and name pair identifies the same query across frames. NULL means none. Ignored\n when not recording."]
pub name: *const ::std::os::raw::c_char,
}
unsafe extern "C" {
#[doc = " Use this to initialize your query filter"]
pub fn b3DefaultQueryFilter() -> b3QueryFilter;
}
#[doc = " Low level ray cast input data."]
#[repr(C)]
#[derive(Debug, Copy, Clone)]
pub struct b3RayCastInput {
#[doc = " Start point of the ray cast."]
pub origin: b3Vec3,
#[doc = " Translation of the ray cast.\n end = start + translation."]
pub translation: b3Vec3,
#[doc = " The maximum fraction of the translation to consider, typically 1"]
pub maxFraction: f32,
}
#[doc = " Result from b3World_RayCastClosest."]
#[repr(C)]
#[derive(Debug, Copy, Clone)]
pub struct b3RayResult {
#[doc = " The shape hit."]
pub shapeId: b3ShapeId,
#[doc = " The world point of the hit."]
pub point: b3Pos,
#[doc = " The world normal of the shape surface at the hit point."]
pub normal: b3Vec3,
#[doc = " The user material id at the hit point. This can be per triangle\n if the shape is a mesh, height-field, or compound with child mesh."]
pub userMaterialId: u64,
#[doc = " The fraction of the input ray."]
pub fraction: f32,
#[doc = " The triangle index if the shape is a mesh, height-field, or compound with\n child mesh."]
pub triangleIndex: ::std::os::raw::c_int,
#[doc = " The child index if the shape is a compound."]
pub childIndex: ::std::os::raw::c_int,
#[doc = " The number of BVH nodes visited. Diagnostic."]
pub nodeVisits: ::std::os::raw::c_int,
#[doc = " The number of BVH leaves visited. Diagnostic."]
pub leafVisits: ::std::os::raw::c_int,
#[doc = " Did the ray hit? If false, all other data is invalid."]
pub hit: bool,
}
#[doc = " A shape proxy is used by the GJK algorithm. It can represent a convex shape."]
#[repr(C)]
#[derive(Debug, Copy, Clone)]
pub struct b3ShapeProxy {
#[doc = " The point cloud."]
pub points: *const b3Vec3,
#[doc = " The number of points. Do not exceed B3_MAX_SHAPE_CAST_POINTS."]
pub count: ::std::os::raw::c_int,
#[doc = " The external radius of the point cloud."]
pub radius: f32,
}
#[doc = " Low level shape cast input in generic form. This allows casting an arbitrary point\n cloud wrap with a radius. For example, a sphere 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."]
#[repr(C)]
#[derive(Debug, Copy, Clone)]
pub struct b3ShapeCastInput {
#[doc = " A generic query shape."]
pub proxy: b3ShapeProxy,
#[doc = " The translation of the shape cast."]
pub translation: b3Vec3,
#[doc = " The maximum fraction of the translation to consider, typically 1."]
pub maxFraction: f32,
#[doc = " Allow shape cast to encroach when initially touching. This only works if the radius is greater than zero."]
pub canEncroach: bool,
}
#[doc = " Input for sweeping an AABB through a dynamic tree. The box is in the tree's world float frame.\n The caller folds the cast shape radius and any world origin into the box, so the tree traversal\n stays a conservative box sweep and the precise narrow phase happens per shape in the callback."]
#[repr(C)]
#[derive(Debug, Copy, Clone)]
pub struct b3BoxCastInput {
#[doc = " The AABB to cast, in the tree's frame."]
pub box_: b3AABB,
#[doc = " The sweep translation."]
pub translation: b3Vec3,
#[doc = " The maximum fraction of the translation to consider, typically 1."]
pub maxFraction: f32,
}
#[doc = " Low level ray cast or shape-cast output data."]
#[repr(C)]
#[derive(Debug, Copy, Clone)]
pub struct b3CastOutput {
#[doc = " The surface normal at the hit point."]
pub normal: b3Vec3,
#[doc = " The surface hit point."]
pub point: b3Vec3,
#[doc = " The fraction of the input translation at collision."]
pub fraction: f32,
#[doc = " The number of iterations used."]
pub iterations: ::std::os::raw::c_int,
#[doc = " The index of the mesh or height field triangle hit."]
pub triangleIndex: ::std::os::raw::c_int,
#[doc = " The index of the compound child shape."]
pub childIndex: ::std::os::raw::c_int,
#[doc = " The material index. May be -1 for null."]
pub materialIndex: ::std::os::raw::c_int,
#[doc = " Did the cast hit?"]
pub hit: bool,
}
#[doc = " Same type in single precision."]
pub type b3WorldCastOutput = b3CastOutput;
#[doc = " Body cast result for ray and shape casts."]
#[repr(C)]
#[derive(Debug, Copy, Clone)]
pub struct b3BodyCastResult {
#[doc = " The shape hit."]
pub shapeId: b3ShapeId,
#[doc = " The world point on the shape surface."]
pub point: b3Pos,
#[doc = " The world normal vector on the shape surface."]
pub normal: b3Vec3,
#[doc = " The fraction along the ray hit.\n hit point = origin + fraction * translation"]
pub fraction: f32,
#[doc = " The triangle index if the shape is a mesh or height-field."]
pub triangleIndex: ::std::os::raw::c_int,
#[doc = " The user material id at the hit point. This can be per triangle\n if the shape is a mesh, height-field, or compound with child mesh."]
pub userMaterialId: u64,
#[doc = " The number of iterations used. Diagnostic."]
pub iterations: ::std::os::raw::c_int,
#[doc = " Did the cast hit? If false, all other fields are invalid."]
pub hit: bool,
}
#[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."]
#[repr(C)]
#[derive(Debug, Copy, Clone)]
pub struct b3SimplexCache {
#[doc = " Value use to compare length, area, volume of two simplexes."]
pub metric: f32,
#[doc = " The number of stored simplex points"]
pub count: u16,
#[doc = " The cached simplex indices on shape A"]
pub indexA: [u8; 4usize],
#[doc = " The cached simplex indices on shape B"]
pub indexB: [u8; 4usize],
}
#[doc = " Input parameters for b3ShapeCast"]
#[repr(C)]
#[derive(Debug, Copy, Clone)]
pub struct b3ShapeCastPairInput {
#[doc = "< The proxy for shape A"]
pub proxyA: b3ShapeProxy,
#[doc = "< The proxy for shape B"]
pub proxyB: b3ShapeProxy,
#[doc = "< Transform of shape B in shape A's frame, the relative pose B in A"]
pub transform: b3Transform,
#[doc = "< The translation of shape B, in A's frame"]
pub translationB: b3Vec3,
#[doc = "< The fraction of the translation to consider, typically 1"]
pub maxFraction: f32,
#[doc = "< Allows shapes with a radius to move slightly closer if already touching"]
pub canEncroach: bool,
}
#[doc = " Input for b3ShapeDistance"]
#[repr(C)]
#[derive(Debug, Copy, Clone)]
pub struct b3DistanceInput {
#[doc = " The proxy for shape A"]
pub proxyA: b3ShapeProxy,
#[doc = " The proxy for shape B"]
pub proxyB: b3ShapeProxy,
#[doc = " Transform of shape B in shape A's frame, the relative pose B in A\n (b3InvMulWorldTransforms( worldA, worldB )). The query is origin independent and runs in frame A."]
pub transform: b3Transform,
#[doc = " Should the proxy radius be considered?"]
pub useRadii: bool,
}
#[doc = " Output for b3ShapeDistance"]
#[repr(C)]
#[derive(Debug, Copy, Clone)]
pub struct b3DistanceOutput {
#[doc = "< Closest point on shapeA, in shape A's frame"]
pub pointA: b3Vec3,
#[doc = "< Closest point on shapeB, in shape A's frame"]
pub pointB: b3Vec3,
#[doc = "< A to B normal in shape A's frame. Invalid if distance is zero."]
pub normal: b3Vec3,
#[doc = "< The final distance, zero if overlapped"]
pub distance: f32,
#[doc = "< Number of GJK iterations used"]
pub iterations: ::std::os::raw::c_int,
#[doc = "< The number of simplexes stored in the simplex array"]
pub simplexCount: ::std::os::raw::c_int,
}
#[doc = " Simplex vertex for debugging the GJK algorithm"]
#[repr(C)]
#[derive(Debug, Copy, Clone)]
pub struct b3SimplexVertex {
#[doc = "< support point in proxyA"]
pub wA: b3Vec3,
#[doc = "< support point in proxyB"]
pub wB: b3Vec3,
#[doc = "< wB - wA"]
pub w: b3Vec3,
#[doc = "< barycentric coordinates"]
pub a: f32,
#[doc = "< wA index"]
pub indexA: ::std::os::raw::c_int,
#[doc = "< wB index"]
pub indexB: ::std::os::raw::c_int,
}
#[doc = " Simplex from the GJK algorithm"]
#[repr(C)]
#[derive(Debug, Copy, Clone)]
pub struct b3Simplex {
#[doc = "< vertices"]
pub vertices: [b3SimplexVertex; 4usize],
#[doc = "< number of valid vertices"]
pub count: ::std::os::raw::c_int,
}
#[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."]
#[repr(C)]
#[derive(Debug, Copy, Clone)]
pub struct b3Sweep {
#[doc = "< Local center of mass position"]
pub localCenter: b3Vec3,
#[doc = "< Starting center of mass world position"]
pub c1: b3Vec3,
#[doc = "< Ending center of mass world position"]
pub c2: b3Vec3,
#[doc = "< Starting world rotation"]
pub q1: b3Quat,
#[doc = "< Ending world rotation"]
pub q2: b3Quat,
}
#[doc = " Time of impact input"]
#[repr(C)]
#[derive(Debug, Copy, Clone)]
pub struct b3TOIInput {
#[doc = "< The proxy for shape A"]
pub proxyA: b3ShapeProxy,
#[doc = "< The proxy for shape B"]
pub proxyB: b3ShapeProxy,
#[doc = "< The movement of shape A"]
pub sweepA: b3Sweep,
#[doc = "< The movement of shape B"]
pub sweepB: b3Sweep,
#[doc = "< Defines the sweep interval [0, tMax]"]
pub maxFraction: f32,
}
pub const b3TOIState_b3_toiStateUnknown: b3TOIState = 0;
pub const b3TOIState_b3_toiStateFailed: b3TOIState = 1;
pub const b3TOIState_b3_toiStateOverlapped: b3TOIState = 2;
pub const b3TOIState_b3_toiStateHit: b3TOIState = 3;
pub const b3TOIState_b3_toiStateSeparated: b3TOIState = 4;
#[doc = " Describes the TOI output"]
pub type b3TOIState = ::std::os::raw::c_int;
#[doc = " Time of impact output"]
#[repr(C)]
#[derive(Debug, Copy, Clone)]
pub struct b3TOIOutput {
#[doc = " The type of result"]
pub state: b3TOIState,
#[doc = " The hit point"]
pub point: b3Vec3,
#[doc = " The hit normal"]
pub normal: b3Vec3,
#[doc = " The sweep time of the collision"]
pub fraction: f32,
#[doc = " The final distance"]
pub distance: f32,
#[doc = " Number of outer iterations"]
pub distanceIterations: ::std::os::raw::c_int,
#[doc = " Total number of push back iterations"]
pub pushBackIterations: ::std::os::raw::c_int,
#[doc = " Total number of root iterations"]
pub rootIterations: ::std::os::raw::c_int,
#[doc = " Indicates that the time of impact detected initial\n overlap and used a fallback sphere as a last ditch effort\n to prevent tunneling."]
pub usedFallback: bool,
}
pub const b3TreeNodeFlags_b3_allocatedNode: b3TreeNodeFlags = 1;
pub const b3TreeNodeFlags_b3_enlargedNode: b3TreeNodeFlags = 2;
pub const b3TreeNodeFlags_b3_leafNode: b3TreeNodeFlags = 4;
#[doc = " Flags for tree nodes. For internal usage."]
pub type b3TreeNodeFlags = ::std::os::raw::c_int;
#[doc = " Tree node child indices. For internal usage."]
#[repr(C)]
#[derive(Debug, Copy, Clone)]
pub struct b3TreeNodeChildren {
#[doc = "< child node index 1"]
pub child1: ::std::os::raw::c_int,
#[doc = "< child node index 2"]
pub child2: ::std::os::raw::c_int,
}
#[doc = " A node in the dynamic tree. This is private data placed here for performance reasons.\n todo test padding to 64 bytes to avoid straddling cache lines"]
#[repr(C)]
#[derive(Copy, Clone)]
pub struct b3TreeNode {
#[doc = " The node bounding box"]
pub aabb: b3AABB,
#[doc = " Category bits for collision filtering"]
pub categoryBits: u64,
pub __bindgen_anon_1: b3TreeNode__bindgen_ty_1,
pub __bindgen_anon_2: b3TreeNode__bindgen_ty_2,
#[doc = " Height of the node. Leaves have a height of 0."]
pub height: u16,
#[doc = " @see b3TreeNodeFlags"]
pub flags: u16,
}
#[repr(C)]
#[derive(Copy, Clone)]
pub union b3TreeNode__bindgen_ty_1 {
#[doc = " Children (internal node)"]
pub children: b3TreeNodeChildren,
#[doc = " User data (leaf node)"]
pub userData: u64,
}
#[repr(C)]
#[derive(Copy, Clone)]
pub union b3TreeNode__bindgen_ty_2 {
#[doc = " The node parent index (allocated node)"]
pub parent: ::std::os::raw::c_int,
#[doc = " The node freelist next index (free node)"]
pub next: ::std::os::raw::c_int,
}
#[doc = " The dynamic tree structure. This should be considered private data.\n It is placed here for performance reasons."]
#[repr(C)]
#[derive(Debug, Copy, Clone)]
pub struct b3DynamicTree {
#[doc = " The dynamic tree version. Always the first field. Useful\n if the tree is serialized."]
pub version: u64,
#[doc = " The tree nodes"]
pub nodes: *mut b3TreeNode,
#[doc = " The root index"]
pub root: ::std::os::raw::c_int,
#[doc = " The number of nodes"]
pub nodeCount: ::std::os::raw::c_int,
#[doc = " The allocated node space"]
pub nodeCapacity: ::std::os::raw::c_int,
#[doc = " Number of proxies created"]
pub proxyCount: ::std::os::raw::c_int,
#[doc = " Node free list"]
pub freeList: ::std::os::raw::c_int,
#[doc = " Leaf indices for rebuild"]
pub leafIndices: *mut ::std::os::raw::c_int,
#[doc = " Leaf bounding boxes for rebuild"]
pub leafBoxes: *mut b3AABB,
#[doc = " Leaf bounding box centers for rebuild"]
pub leafCenters: *mut b3Vec3,
#[doc = " Bins for sorting during rebuild"]
pub binIndices: *mut ::std::os::raw::c_int,
#[doc = " Allocated space for rebuilding"]
pub rebuildCapacity: ::std::os::raw::c_int,
}
#[doc = " These are performance results returned by dynamic tree queries."]
#[repr(C)]
#[derive(Debug, Copy, Clone)]
pub struct b3TreeStats {
#[doc = " Number of internal nodes visited during the query"]
pub nodeVisits: ::std::os::raw::c_int,
#[doc = " Number of leaf nodes visited during the query"]
pub leafVisits: ::std::os::raw::c_int,
}
#[doc = " This function receives proxies found in the AABB query.\n @return true if the query should continue"]
pub type b3TreeQueryCallbackFcn = ::std::option::Option<
unsafe extern "C" fn(
proxyId: ::std::os::raw::c_int,
userData: u64,
context: *mut ::std::os::raw::c_void,
) -> bool,
>;
#[doc = " This function receives the minimum distance squared so far and proxy to check in the closest query.\n @return minimum distance squared to user objects in the proxy"]
pub type b3TreeQueryClosestCallbackFcn = ::std::option::Option<
unsafe extern "C" fn(
distanceSqrMin: f32,
proxyId: ::std::os::raw::c_int,
userData: u64,
context: *mut ::std::os::raw::c_void,
) -> f32,
>;
#[doc = " This function receives clipped AABB cast input for a proxy. The function returns the new cast\n fraction.\n - return a value of 0 to terminate the cast\n - return a value less than input->maxFraction to clip the cast\n - return a value of input->maxFraction to continue the cast without clipping"]
pub type b3TreeBoxCastCallbackFcn = ::std::option::Option<
unsafe extern "C" fn(
input: *const b3BoxCastInput,
proxyId: ::std::os::raw::c_int,
userData: u64,
context: *mut ::std::os::raw::c_void,
) -> f32,
>;
#[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"]
pub type b3TreeRayCastCallbackFcn = ::std::option::Option<
unsafe extern "C" fn(
input: *const b3RayCastInput,
proxyId: ::std::os::raw::c_int,
userData: u64,
context: *mut ::std::os::raw::c_void,
) -> f32,
>;
#[doc = " The plane between a character mover and a shape"]
#[repr(C)]
#[derive(Debug, Copy, Clone)]
pub struct b3PlaneResult {
#[doc = " Outward pointing plane."]
pub plane: b3Plane,
#[doc = " Closest point on the shape. May not be unique."]
pub point: b3Vec3,
}
#[doc = " These are collision planes that can be fed to b3SolvePlanes. Normally\n this is assembled by the user from plane results in b3PlaneResult."]
#[repr(C)]
#[derive(Debug, Copy, Clone)]
pub struct b3CollisionPlane {
#[doc = " The collision plane between the mover and some shape."]
pub plane: b3Plane,
#[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."]
pub pushLimit: f32,
#[doc = " The push on the mover determined by b3SolvePlanes. Usually in meters."]
pub push: f32,
#[doc = " Indicates if b3ClipVector should clip against this plane. Should be false for soft collision."]
pub clipVelocity: bool,
}
#[doc = " Result returned by b3SolvePlanes."]
#[repr(C)]
#[derive(Debug, Copy, Clone)]
pub struct b3PlaneSolverResult {
#[doc = " The final relative translation."]
pub delta: b3Vec3,
#[doc = " The number of iterations used by the plane solver. For diagnostics."]
pub iterationCount: ::std::os::raw::c_int,
}
#[doc = " Body plane result for movers."]
#[repr(C)]
#[derive(Debug, Copy, Clone)]
pub struct b3BodyPlaneResult {
#[doc = " The shape id on the body."]
pub shapeId: b3ShapeId,
#[doc = " The plane result."]
pub result: b3PlaneResult,
}
#[doc = " Used to collect collision planes for character movers.\n Return true to continue gathering planes."]
pub type b3PlaneResultFcn = ::std::option::Option<
unsafe extern "C" fn(
shapeId: b3ShapeId,
plane: *const b3PlaneResult,
planeCount: ::std::os::raw::c_int,
context: *mut ::std::os::raw::c_void,
) -> bool,
>;
#[doc = " Used to filter shapes for shape casting character movers.\n Return true to accept the collision"]
pub type b3MoverFilterFcn = ::std::option::Option<
unsafe extern "C" fn(shapeId: b3ShapeId, context: *mut ::std::os::raw::c_void) -> bool,
>;
#[doc = " This holds the mass data computed for a shape."]
#[repr(C)]
#[derive(Debug, Copy, Clone)]
pub struct b3MassData {
#[doc = " The shape mass"]
pub mass: f32,
#[doc = " The local center of mass position."]
pub center: b3Vec3,
#[doc = " The inertia tensor about the shape center of mass."]
pub inertia: b3Matrix3,
}
#[doc = " A solid sphere"]
#[repr(C)]
#[derive(Debug, Copy, Clone)]
pub struct b3Sphere {
#[doc = " The local center"]
pub center: b3Vec3,
#[doc = " The radius"]
pub radius: f32,
}
#[doc = " A solid capsule can be viewed as two hemispheres connected\n by a rectangle."]
#[repr(C)]
#[derive(Debug, Copy, Clone)]
pub struct b3Capsule {
#[doc = " Local center of the first hemisphere"]
pub center1: b3Vec3,
#[doc = " Local center of the second hemisphere"]
pub center2: b3Vec3,
#[doc = " The radius of the hemispheres"]
pub radius: f32,
}
#[doc = " A hull vertex. Identified by a half-edge with this\n vertex as its tail."]
#[repr(C)]
#[derive(Debug, Copy, Clone)]
pub struct b3HullVertex {
#[doc = " A half-edge that has this vertex as the origin\n Can be used along with edge twins and winding order\n to traverse all the edges connected to this vertex."]
pub edge: u8,
}
#[doc = " Half-edge for hull data structure"]
#[repr(C)]
#[derive(Debug, Copy, Clone)]
pub struct b3HullHalfEdge {
#[doc = " Next edge index CCW"]
pub next: u8,
#[doc = " Twin edge index"]
pub twin: u8,
#[doc = " index of origin vertex and point"]
pub origin: u8,
#[doc = " Face to the left of this edge"]
pub face: u8,
}
#[doc = " A hull face. Hulls use a half-edge data structure, so a face\n can be determined from a single half-edge index."]
#[repr(C)]
#[derive(Debug, Copy, Clone)]
pub struct b3HullFace {
#[doc = " An arbitrary half-edge on this face"]
pub edge: u8,
}
#[doc = " A convex hull.\n @note This data structure has data hanging off the end and cannot be directly copied."]
#[repr(C)]
#[derive(Debug, Copy, Clone)]
pub struct b3HullData {
#[doc = " Version must be first and match B3_HULL_VERSION"]
pub version: u64,
#[doc = " The total number of bytes for this hull."]
pub byteCount: ::std::os::raw::c_int,
#[doc = " Hash of this hull (this field is zero when the hash is computed)."]
pub hash: u32,
#[doc = " Axis-aligned box in local space."]
pub aabb: b3AABB,
#[doc = " Surface area, typically in squared meters."]
pub surfaceArea: f32,
#[doc = " Volume, typically in m^3."]
pub volume: f32,
#[doc = " The radius of the largest sphere at the center."]
pub innerRadius: f32,
#[doc = " The local centroid"]
pub center: b3Vec3,
#[doc = " The inertia tensor about the centroid."]
pub centralInertia: b3Matrix3,
#[doc = " The vertex count."]
pub vertexCount: ::std::os::raw::c_int,
#[doc = " Offset of the vertex array in bytes from the struct address."]
pub vertexOffset: ::std::os::raw::c_int,
#[doc = " Offset of the point array in bytes from the struct address."]
pub pointOffset: ::std::os::raw::c_int,
#[doc = " This is the half-edge count (double the edge count)"]
pub edgeCount: ::std::os::raw::c_int,
#[doc = " Offset of the edge array in bytes from the struct address."]
pub edgeOffset: ::std::os::raw::c_int,
#[doc = " The face count. Hulls faces are convex polygons."]
pub faceCount: ::std::os::raw::c_int,
#[doc = " Offset of the face array in bytes from the struct address."]
pub faceOffset: ::std::os::raw::c_int,
#[doc = " Offset of the face plane array in bytes from the struct address."]
pub planeOffset: ::std::os::raw::c_int,
#[doc = " Explicit padding. Hull identity is a content hash and memcmp over raw bytes,\n so there must be no unnamed padding for struct copies to scramble."]
pub padding: ::std::os::raw::c_int,
}
#[doc = " Efficient box hull"]
#[repr(C)]
#[derive(Debug, Copy, Clone)]
pub struct b3BoxHull {
#[doc = " The embedded hull. So the offsets index into the arrays that follow."]
pub base: b3HullData,
#[doc = "< Box vertices."]
pub boxVertices: [b3HullVertex; 8usize],
#[doc = "< Box points."]
pub boxPoints: [b3Vec3; 8usize],
#[doc = "< Box half-edges."]
pub boxEdges: [b3HullHalfEdge; 24usize],
#[doc = "< Box faces."]
pub boxFaces: [b3HullFace; 6usize],
#[doc = "< Explicit padding, see b3HullData::padding."]
pub padding: [u8; 2usize],
#[doc = "< Box face planes."]
pub boxPlanes: [b3Plane; 6usize],
}
#[doc = " This is used to create a re-usable collision mesh"]
#[repr(C)]
#[derive(Debug, Copy, Clone)]
pub struct b3MeshDef {
#[doc = " Triangle vertices"]
pub vertices: *mut b3Vec3,
#[doc = " Triangle vertex indices. 3 for each triangle."]
pub indices: *mut i32,
#[doc = " Triangle material index. 1 per triangle. Indexes into b3ShapeDef::materials.\n This allows different run-time material data to be associated with different\n instances of this mesh."]
pub materialIndices: *mut u8,
#[doc = " Tolerance for vertex welding in length units."]
pub weldTolerance: f32,
#[doc = " The vertex count. Must be 3 or more."]
pub vertexCount: ::std::os::raw::c_int,
#[doc = " The triangle count. Must be 1 or more."]
pub triangleCount: ::std::os::raw::c_int,
#[doc = " Optionally weld nearby vertices."]
pub weldVertices: bool,
#[doc = " Use the median split instead of SAH to speed up mesh creation. Good\n for meshes that are structured like a grid."]
pub useMedianSplit: bool,
#[doc = " Compute triangle adjacency information using shared edges"]
pub identifyEdges: bool,
}
pub const b3MeshEdgeFlags_b3_concaveEdge1: b3MeshEdgeFlags = 1;
pub const b3MeshEdgeFlags_b3_concaveEdge2: b3MeshEdgeFlags = 2;
pub const b3MeshEdgeFlags_b3_concaveEdge3: b3MeshEdgeFlags = 4;
pub const b3MeshEdgeFlags_b3_inverseConcaveEdge1: b3MeshEdgeFlags = 16;
pub const b3MeshEdgeFlags_b3_inverseConcaveEdge2: b3MeshEdgeFlags = 32;
pub const b3MeshEdgeFlags_b3_inverseConcaveEdge3: b3MeshEdgeFlags = 64;
pub const b3MeshEdgeFlags_b3_allConcaveEdges: b3MeshEdgeFlags = 7;
pub const b3MeshEdgeFlags_b3_flatEdge1: b3MeshEdgeFlags = 17;
pub const b3MeshEdgeFlags_b3_flatEdge2: b3MeshEdgeFlags = 34;
pub const b3MeshEdgeFlags_b3_flatEdge3: b3MeshEdgeFlags = 68;
pub const b3MeshEdgeFlags_b3_allFlatEdges: b3MeshEdgeFlags = 119;
#[doc = " Triangle mesh edge flags."]
pub type b3MeshEdgeFlags = ::std::os::raw::c_int;
#[doc = " A mesh triangle."]
#[repr(C)]
#[derive(Debug, Copy, Clone)]
pub struct b3MeshTriangle {
#[doc = "< Index of vertex 1."]
pub index1: i32,
#[doc = "< Index of vertex 2."]
pub index2: i32,
#[doc = "< Index of vertex 3."]
pub index3: i32,
}
#[doc = " A mesh BVH node."]
#[repr(C)]
#[derive(Copy, Clone)]
pub struct b3MeshNode {
#[doc = " The lower bound of the node AABB. Strategic placement for SIMD."]
pub lowerBound: b3Vec3,
pub data: b3MeshNode__bindgen_ty_1,
#[doc = " The upper bound of the node AABB. Strategic placement for SIMD."]
pub upperBound: b3Vec3,
#[doc = " The index of the leaf triangles."]
pub triangleOffset: u32,
}
#[doc = " Anonymous union."]
#[repr(C)]
#[derive(Copy, Clone)]
pub union b3MeshNode__bindgen_ty_1 {
pub asNode: b3MeshNode__bindgen_ty_1__bindgen_ty_1,
pub asLeaf: b3MeshNode__bindgen_ty_1__bindgen_ty_2,
}
#[doc = " Internal node"]
#[repr(C)]
#[derive(Debug, Copy, Clone)]
pub struct b3MeshNode__bindgen_ty_1__bindgen_ty_1 {
pub _bitfield_align_1: [u32; 0],
pub _bitfield_1: __BindgenBitfieldUnit<[u8; 4usize]>,
}
impl b3MeshNode__bindgen_ty_1__bindgen_ty_1 {
#[inline]
pub fn axis(&self) -> u32 {
unsafe { ::std::mem::transmute(self._bitfield_1.get(0usize, 2u8) as u32) }
}
#[inline]
pub fn set_axis(&mut self, val: u32) {
unsafe {
let val: u32 = ::std::mem::transmute(val);
self._bitfield_1.set(0usize, 2u8, val as u64)
}
}
#[inline]
pub unsafe fn axis_raw(this: *const Self) -> u32 {
unsafe {
::std::mem::transmute(<__BindgenBitfieldUnit<[u8; 4usize]>>::raw_get(
::std::ptr::addr_of!((*this)._bitfield_1),
0usize,
2u8,
) as u32)
}
}
#[inline]
pub unsafe fn set_axis_raw(this: *mut Self, val: u32) {
unsafe {
let val: u32 = ::std::mem::transmute(val);
<__BindgenBitfieldUnit<[u8; 4usize]>>::raw_set(
::std::ptr::addr_of_mut!((*this)._bitfield_1),
0usize,
2u8,
val as u64,
)
}
}
#[inline]
pub fn childOffset(&self) -> u32 {
unsafe { ::std::mem::transmute(self._bitfield_1.get(2usize, 30u8) as u32) }
}
#[inline]
pub fn set_childOffset(&mut self, val: u32) {
unsafe {
let val: u32 = ::std::mem::transmute(val);
self._bitfield_1.set(2usize, 30u8, val as u64)
}
}
#[inline]
pub unsafe fn childOffset_raw(this: *const Self) -> u32 {
unsafe {
::std::mem::transmute(<__BindgenBitfieldUnit<[u8; 4usize]>>::raw_get(
::std::ptr::addr_of!((*this)._bitfield_1),
2usize,
30u8,
) as u32)
}
}
#[inline]
pub unsafe fn set_childOffset_raw(this: *mut Self, val: u32) {
unsafe {
let val: u32 = ::std::mem::transmute(val);
<__BindgenBitfieldUnit<[u8; 4usize]>>::raw_set(
::std::ptr::addr_of_mut!((*this)._bitfield_1),
2usize,
30u8,
val as u64,
)
}
}
#[inline]
pub fn new_bitfield_1(axis: u32, childOffset: u32) -> __BindgenBitfieldUnit<[u8; 4usize]> {
let mut __bindgen_bitfield_unit: __BindgenBitfieldUnit<[u8; 4usize]> = Default::default();
__bindgen_bitfield_unit.set(0usize, 2u8, {
let axis: u32 = unsafe { ::std::mem::transmute(axis) };
axis as u64
});
__bindgen_bitfield_unit.set(2usize, 30u8, {
let childOffset: u32 = unsafe { ::std::mem::transmute(childOffset) };
childOffset as u64
});
__bindgen_bitfield_unit
}
}
#[doc = " Leaf node"]
#[repr(C)]
#[derive(Debug, Copy, Clone)]
pub struct b3MeshNode__bindgen_ty_1__bindgen_ty_2 {
pub _bitfield_align_1: [u32; 0],
pub _bitfield_1: __BindgenBitfieldUnit<[u8; 4usize]>,
}
impl b3MeshNode__bindgen_ty_1__bindgen_ty_2 {
#[inline]
pub fn type_(&self) -> u32 {
unsafe { ::std::mem::transmute(self._bitfield_1.get(0usize, 2u8) as u32) }
}
#[inline]
pub fn set_type(&mut self, val: u32) {
unsafe {
let val: u32 = ::std::mem::transmute(val);
self._bitfield_1.set(0usize, 2u8, val as u64)
}
}
#[inline]
pub unsafe fn type__raw(this: *const Self) -> u32 {
unsafe {
::std::mem::transmute(<__BindgenBitfieldUnit<[u8; 4usize]>>::raw_get(
::std::ptr::addr_of!((*this)._bitfield_1),
0usize,
2u8,
) as u32)
}
}
#[inline]
pub unsafe fn set_type_raw(this: *mut Self, val: u32) {
unsafe {
let val: u32 = ::std::mem::transmute(val);
<__BindgenBitfieldUnit<[u8; 4usize]>>::raw_set(
::std::ptr::addr_of_mut!((*this)._bitfield_1),
0usize,
2u8,
val as u64,
)
}
}
#[inline]
pub fn triangleCount(&self) -> u32 {
unsafe { ::std::mem::transmute(self._bitfield_1.get(2usize, 30u8) as u32) }
}
#[inline]
pub fn set_triangleCount(&mut self, val: u32) {
unsafe {
let val: u32 = ::std::mem::transmute(val);
self._bitfield_1.set(2usize, 30u8, val as u64)
}
}
#[inline]
pub unsafe fn triangleCount_raw(this: *const Self) -> u32 {
unsafe {
::std::mem::transmute(<__BindgenBitfieldUnit<[u8; 4usize]>>::raw_get(
::std::ptr::addr_of!((*this)._bitfield_1),
2usize,
30u8,
) as u32)
}
}
#[inline]
pub unsafe fn set_triangleCount_raw(this: *mut Self, val: u32) {
unsafe {
let val: u32 = ::std::mem::transmute(val);
<__BindgenBitfieldUnit<[u8; 4usize]>>::raw_set(
::std::ptr::addr_of_mut!((*this)._bitfield_1),
2usize,
30u8,
val as u64,
)
}
}
#[inline]
pub fn new_bitfield_1(type_: u32, triangleCount: u32) -> __BindgenBitfieldUnit<[u8; 4usize]> {
let mut __bindgen_bitfield_unit: __BindgenBitfieldUnit<[u8; 4usize]> = Default::default();
__bindgen_bitfield_unit.set(0usize, 2u8, {
let type_: u32 = unsafe { ::std::mem::transmute(type_) };
type_ as u64
});
__bindgen_bitfield_unit.set(2usize, 30u8, {
let triangleCount: u32 = unsafe { ::std::mem::transmute(triangleCount) };
triangleCount as u64
});
__bindgen_bitfield_unit
}
}
#[doc = " This is a sorted triangle collision bounding volume hierarchy.\n @note This struct has data hanging off the end and cannot be directly copied."]
#[repr(C)]
#[derive(Debug, Copy, Clone)]
pub struct b3MeshData {
#[doc = " Version must be first."]
pub version: u64,
#[doc = " The total number of bytes for this mesh."]
pub byteCount: ::std::os::raw::c_int,
#[doc = " Hash of this mesh (this field is zero when the hash is computed)"]
pub hash: u32,
#[doc = " Local axis-aligned box."]
pub bounds: b3AABB,
#[doc = " Combined surface area of all triangles. Single-sided."]
pub surfaceArea: f32,
#[doc = " The height of the bounding volume hierarchy."]
pub treeHeight: ::std::os::raw::c_int,
#[doc = " The number of degenerate triangles. Diagnostic."]
pub degenerateCount: ::std::os::raw::c_int,
#[doc = " Offset of the node array in bytes from the struct address."]
pub nodeOffset: ::std::os::raw::c_int,
#[doc = " The number of BVH nodes."]
pub nodeCount: ::std::os::raw::c_int,
#[doc = " Offset of the vertex array in bytes from the struct address."]
pub vertexOffset: ::std::os::raw::c_int,
#[doc = " The number of vertices."]
pub vertexCount: ::std::os::raw::c_int,
#[doc = " Offset of the triangle array in bytes from the struct address."]
pub triangleOffset: ::std::os::raw::c_int,
#[doc = " The number of triangles."]
pub triangleCount: ::std::os::raw::c_int,
#[doc = " Offset of the material array in bytes from the struct address."]
pub materialOffset: ::std::os::raw::c_int,
#[doc = " The number of materials."]
pub materialCount: ::std::os::raw::c_int,
#[doc = " Offset of the triangle flag array in bytes from the struct address."]
pub flagsOffset: ::std::os::raw::c_int,
}
#[doc = " This allows mesh data to be re-used with different scales."]
#[repr(C)]
#[derive(Debug, Copy, Clone)]
pub struct b3Mesh {
#[doc = " Immutable pointer to the mesh data."]
pub data: *const b3MeshData,
#[doc = " This scale may be non-uniform and have negative components. However,\n no component may be very small in magnitude."]
pub scale: b3Vec3,
}
#[doc = " Data used to create a height field"]
#[repr(C)]
#[derive(Debug, Copy, Clone)]
pub struct b3HeightFieldDef {
#[doc = " Grid point heights\n count = countX * countZ"]
pub heights: *mut f32,
#[doc = " Grid cell material\n A value of 0xFF is reserved for holes\n count = (countX - 1) * (countZ - 1)"]
pub materialIndices: *mut u8,
#[doc = " The height field scale. All components must be positive values."]
pub scale: b3Vec3,
#[doc = " The number of grid lines along the x-axis."]
pub countX: ::std::os::raw::c_int,
#[doc = " The number of grid lines along the z-axis."]
pub countZ: ::std::os::raw::c_int,
#[doc = " Global minimum and maximum heights used for quantization. This is important\n if you want height fields to be placed next to each other and line up exactly.\n In that case, both height fields should use the same minimum and maximum heights.\n All height values are clamped to this range.\n These values are in unscaled space."]
pub globalMinimumHeight: f32,
#[doc = " The maximum."]
pub globalMaximumHeight: f32,
#[doc = " Use clock-wise winding. This effectively inverts the height-field along the y-axis."]
pub clockwiseWinding: bool,
}
#[doc = " A height field with compressed storage.\n @note This data structure has data hanging off the end and cannot be directly copied."]
#[repr(C)]
#[derive(Debug, Copy, Clone)]
pub struct b3HeightFieldData {
#[doc = " Version must be first and match B3_HEIGHT_FIELD_VERSION"]
pub version: u64,
#[doc = " The total number of bytes for this height field."]
pub byteCount: ::std::os::raw::c_int,
#[doc = " Hash of this height field (this field is zero when the hash is computed)."]
pub hash: u32,
#[doc = " The local axis-aligned bounding box."]
pub aabb: b3AABB,
#[doc = " The minimum y value."]
pub minHeight: f32,
#[doc = " The maximum y value"]
pub maxHeight: f32,
#[doc = " The quantization scale."]
pub heightScale: f32,
#[doc = " The overall scale."]
pub scale: b3Vec3,
#[doc = " The number of grid columns along the local x-axis."]
pub columnCount: ::std::os::raw::c_int,
#[doc = " The number of grid rows along the local z-axis."]
pub rowCount: ::std::os::raw::c_int,
#[doc = " Offset of the compressed height array in bytes from the struct address.\n uint16_t, one per grid point."]
pub heightsOffset: ::std::os::raw::c_int,
#[doc = " Offset of the material index array in bytes from the struct address.\n uint8_t, one per cell."]
pub materialOffset: ::std::os::raw::c_int,
#[doc = " Offset of the flag array in bytes from the struct address.\n uint8_t, one per triangle."]
pub flagsOffset: ::std::os::raw::c_int,
#[doc = " Triangle winding."]
pub clockwise: bool,
#[doc = " Explicit padding. Identity is a content hash over raw bytes, so there must\n be no unnamed padding for struct copies to scramble."]
pub padding: [u8; 3usize],
}
#[doc = " Definition for a capsule in a compound shape."]
#[repr(C)]
#[derive(Debug, Copy, Clone)]
pub struct b3CompoundCapsuleDef {
#[doc = " Local capsule."]
pub capsule: b3Capsule,
#[doc = " Material properties."]
pub material: b3SurfaceMaterial,
}
#[doc = " Definition for a convex hull in a compound shape."]
#[repr(C)]
#[derive(Debug, Copy, Clone)]
pub struct b3CompoundHullDef {
#[doc = " Shared hull."]
pub hull: *const b3HullData,
#[doc = " Transform of the shared hull into compound local space."]
pub transform: b3Transform,
#[doc = " Material properties."]
pub material: b3SurfaceMaterial,
}
#[doc = " Definition for a triangle mesh in a compound shape."]
#[repr(C)]
#[derive(Debug, Copy, Clone)]
pub struct b3CompoundMeshDef {
#[doc = " Shared mesh."]
pub meshData: *const b3MeshData,
#[doc = " Transform of the shared mesh into compound local space."]
pub transform: b3Transform,
#[doc = " Local space non-uniform mesh scale. May have negative components."]
pub scale: b3Vec3,
#[doc = " Material properties.\n This array must line up with the material indices on the triangles."]
pub materials: *const b3SurfaceMaterial,
#[doc = " Number of materials."]
pub materialCount: ::std::os::raw::c_int,
}
#[doc = " Definition for a sphere in a compound shape."]
#[repr(C)]
#[derive(Debug, Copy, Clone)]
pub struct b3CompoundSphereDef {
#[doc = " Local sphere."]
pub sphere: b3Sphere,
#[doc = " Material properties."]
pub material: b3SurfaceMaterial,
}
#[doc = " Definition for creating a compound shape. All this data is fully cloned\n into the run-time compound shape."]
#[repr(C)]
#[derive(Debug, Copy, Clone)]
pub struct b3CompoundDef {
#[doc = " Capsule instances."]
pub capsules: *mut b3CompoundCapsuleDef,
#[doc = " Number of capsules."]
pub capsuleCount: ::std::os::raw::c_int,
#[doc = " Hulls instances."]
pub hulls: *mut b3CompoundHullDef,
#[doc = " Number of hull instances."]
pub hullCount: ::std::os::raw::c_int,
#[doc = " Mesh instances."]
pub meshes: *mut b3CompoundMeshDef,
#[doc = " Number of mesh instances."]
pub meshCount: ::std::os::raw::c_int,
#[doc = " Sphere instances."]
pub spheres: *mut b3CompoundSphereDef,
#[doc = " Number of spheres."]
pub sphereCount: ::std::os::raw::c_int,
}
#[doc = " The runtime data for a compound shape. This is a potentially large yet highly optimized\n data structure. It can contain thousands of child shapes, yet at runtime it populates\n into the world as a single shape in the runtime broad-phase.\n This data structure has data living off the end and must be accessed using offsets.\n Accessors are provided for user relevant data."]
#[repr(C)]
#[derive(Debug, Copy, Clone)]
pub struct b3CompoundData {
#[doc = " The compound version is always first."]
pub version: u64,
#[doc = " The total number of bytes for this compound."]
pub byteCount: ::std::os::raw::c_int,
#[doc = " Offset of the tree node array in bytes from the struct address."]
pub nodeOffset: ::std::os::raw::c_int,
#[doc = " Immutable dynamic tree. The tree node pointer must be fixed up using the node offset"]
pub tree: b3DynamicTree,
#[doc = " Offset of the material array in bytes from the struct address."]
pub materialOffset: ::std::os::raw::c_int,
#[doc = " The number of materials."]
pub materialCount: ::std::os::raw::c_int,
#[doc = " Offset of the capsule array in bytes from the struct address."]
pub capsuleOffset: ::std::os::raw::c_int,
#[doc = " The number of capsules."]
pub capsuleCount: ::std::os::raw::c_int,
#[doc = " Offset of the hull instance array in bytes from the struct address."]
pub hullOffset: ::std::os::raw::c_int,
#[doc = " The number of hull instances."]
pub hullCount: ::std::os::raw::c_int,
#[doc = " The number of unique hulls. Diagnostic."]
pub sharedHullCount: ::std::os::raw::c_int,
#[doc = " Offset of the mesh instance array in bytes from the struct address."]
pub meshOffset: ::std::os::raw::c_int,
#[doc = " The number of mesh instances."]
pub meshCount: ::std::os::raw::c_int,
#[doc = " The number of unique meshes. Diagnostic."]
pub sharedMeshCount: ::std::os::raw::c_int,
#[doc = " Offset of the sphere array in bytes from the struct address."]
pub sphereOffset: ::std::os::raw::c_int,
#[doc = " The number of spheres."]
pub sphereCount: ::std::os::raw::c_int,
}
#[doc = " A capsule that lives in a compound."]
#[repr(C)]
#[derive(Debug, Copy, Clone)]
pub struct b3CompoundCapsule {
#[doc = " Local capsule."]
pub capsule: b3Capsule,
#[doc = " Index to a shared material."]
pub materialIndex: ::std::os::raw::c_int,
}
#[doc = " A hull that lives in a compound."]
#[repr(C)]
#[derive(Debug, Copy, Clone)]
pub struct b3CompoundHull {
#[doc = " Pointer to the unique shared hull."]
pub hull: *const b3HullData,
#[doc = " The transform of this hull instance."]
pub transform: b3Transform,
#[doc = " Index to a shared material."]
pub materialIndex: ::std::os::raw::c_int,
}
#[doc = " A mesh with non-uniform scale that lives in a compound."]
#[repr(C)]
#[derive(Debug, Copy, Clone)]
pub struct b3CompoundMesh {
#[doc = " Pointer to the unique shared mesh."]
pub meshData: *const b3MeshData,
#[doc = " The transform of this mesh instance."]
pub transform: b3Transform,
#[doc = " Non-uniform scale of this mesh instance."]
pub scale: b3Vec3,
#[doc = " This is used to access the surface material from b3GetCompoundMaterials.\n Requires an extra level of indirection. The triangle material index\n is clamped to B3_MAX_COMPOUND_MESH_MATERIALS.\n materialIndex = materialIndices[triangle->materialIndex]"]
pub materialIndices: [::std::os::raw::c_int; 4usize],
}
#[doc = " A sphere that lives in a compound."]
#[repr(C)]
#[derive(Debug, Copy, Clone)]
pub struct b3CompoundSphere {
#[doc = " Local sphere."]
pub sphere: b3Sphere,
#[doc = " Index to a shared material."]
pub materialIndex: ::std::os::raw::c_int,
}
#[doc = " Child shape of a compound"]
#[repr(C)]
#[derive(Copy, Clone)]
pub struct b3ChildShape {
pub __bindgen_anon_1: b3ChildShape__bindgen_ty_1,
#[doc = " Transform of the shape into compound local space."]
pub transform: b3Transform,
#[doc = " Material indices. Index 0 is used for convex shapes.\n todo limit to 64K?"]
pub materialIndices: [::std::os::raw::c_int; 4usize],
#[doc = " The shape type (union tag)."]
pub type_: b3ShapeType,
}
#[doc = " Tagged union."]
#[repr(C)]
#[derive(Copy, Clone)]
pub union b3ChildShape__bindgen_ty_1 {
#[doc = "< Capsule."]
pub capsule: b3Capsule,
#[doc = "< Hull."]
pub hull: *const b3HullData,
#[doc = "< Mesh."]
pub mesh: b3Mesh,
#[doc = "< Sphere."]
pub sphere: b3Sphere,
}
#[doc = " Callback for compound overlap queries."]
pub type b3CompoundQueryFcn = ::std::option::Option<
unsafe extern "C" fn(
compound: *const b3CompoundData,
childIndex: ::std::os::raw::c_int,
context: *mut ::std::os::raw::c_void,
) -> bool,
>;
#[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 Box3D uses speculative collision so some contact points may be separated.\n You may use the maxNormalImpulse to determine if there was an interaction during\n the time step."]
#[repr(C)]
#[derive(Debug, Copy, Clone)]
pub struct b3ManifoldPoint {
#[doc = " Location of the contact point relative to the bodyA center of mass in world space."]
pub anchorA: b3Vec3,
#[doc = " Location of the contact point relative to the bodyB center of mass in world space."]
pub anchorB: b3Vec3,
#[doc = " The separation of the contact point, negative if penetrating"]
pub separation: f32,
#[doc = " Cached separation used for contact recycling"]
pub baseSeparation: f32,
#[doc = " The impulse along the manifold normal vector. Since Box3D uses sub-stepping, this is\n result from the final sub-step."]
pub normalImpulse: f32,
#[doc = " The total normal impulse applied during sub-stepping. This is important\n to identify speculative contact points that had an interaction in the time step."]
pub totalNormalImpulse: f32,
#[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."]
pub normalVelocity: f32,
#[doc = " Local point for matching\n Uniquely identifies a contact point between two shapes"]
pub featureId: u32,
#[doc = " Triangle index if one of the shapes is a mesh or height field"]
pub triangleIndex: ::std::os::raw::c_int,
#[doc = " Did this contact point exist in the previous step?"]
pub persisted: bool,
}
#[doc = " A contact manifold describes the contact points between colliding shapes.\n @note Box3D uses speculative collision so some contact points may be separated."]
#[repr(C)]
#[derive(Debug, Copy, Clone)]
pub struct b3Manifold {
#[doc = " The manifold points. There may be 1 to 4 valid points."]
pub points: [b3ManifoldPoint; 4usize],
#[doc = " The unit normal vector in world space, points from shape A to shape B"]
pub normal: b3Vec3,
#[doc = " Central friction angular impulse (applied about the normal)"]
pub twistImpulse: f32,
#[doc = " Central friction linear impulse"]
pub frictionImpulse: b3Vec3,
#[doc = " Rolling resistance angular impulse"]
pub rollingImpulse: b3Vec3,
#[doc = " The number of contact points, will be 0 to 4"]
pub pointCount: ::std::os::raw::c_int,
}
pub const b3SeparatingFeature_b3_invalidAxis: b3SeparatingFeature = 0;
pub const b3SeparatingFeature_b3_backsideAxis: b3SeparatingFeature = 1;
pub const b3SeparatingFeature_b3_faceAxisA: b3SeparatingFeature = 2;
pub const b3SeparatingFeature_b3_faceAxisB: b3SeparatingFeature = 3;
pub const b3SeparatingFeature_b3_edgePairAxis: b3SeparatingFeature = 4;
pub const b3SeparatingFeature_b3_closestPointsAxis: b3SeparatingFeature = 5;
#[doc = " These are for testing"]
pub const b3SeparatingFeature_b3_manualFaceAxisA: b3SeparatingFeature = 6;
#[doc = " These are for testing"]
pub const b3SeparatingFeature_b3_manualFaceAxisB: b3SeparatingFeature = 7;
#[doc = " These are for testing"]
pub const b3SeparatingFeature_b3_manualEdgePairAxis: b3SeparatingFeature = 8;
#[doc = " Cached separating axis feature."]
pub type b3SeparatingFeature = ::std::os::raw::c_int;
pub const b3TriangleFeature_b3_featureNone: b3TriangleFeature = 0;
pub const b3TriangleFeature_b3_featureTriangleFace: b3TriangleFeature = 1;
pub const b3TriangleFeature_b3_featureHullFace: b3TriangleFeature = 2;
#[doc = " v1-v2"]
pub const b3TriangleFeature_b3_featureEdge1: b3TriangleFeature = 3;
#[doc = " v2-v3"]
pub const b3TriangleFeature_b3_featureEdge2: b3TriangleFeature = 4;
#[doc = " v3-v1"]
pub const b3TriangleFeature_b3_featureEdge3: b3TriangleFeature = 5;
#[doc = " v3-v1"]
pub const b3TriangleFeature_b3_featureVertex1: b3TriangleFeature = 6;
#[doc = " v3-v1"]
pub const b3TriangleFeature_b3_featureVertex2: b3TriangleFeature = 7;
#[doc = " v3-v1"]
pub const b3TriangleFeature_b3_featureVertex3: b3TriangleFeature = 8;
#[doc = " Cached triangle feature."]
pub type b3TriangleFeature = ::std::os::raw::c_int;
#[doc = " Separating axis test cache. Provides temporal acceleration of collision routines."]
#[repr(C)]
#[derive(Debug, Copy, Clone)]
pub struct b3SATCache {
#[doc = " The separation when the cache is populated. Negative for overlap."]
pub separation: f32,
#[doc = " b3SeparatingFeature."]
pub type_: u8,
#[doc = " Index of the feature on shape A."]
pub indexA: u8,
#[doc = " Index of the feature on shape B."]
pub indexB: u8,
#[doc = " Was the cache re-used?"]
pub hit: u8,
}
#[doc = " Contact points are always the result of two edges intersecting.\n It can be two edges of the same shape, which is just a shape vertex.\n Or a contact point can be the result of two edges crossing from different shapes.\n This is designed to support hull versus hull, but it is adapted to work\n with all shape types. The feature pair is used to identify contact points\n for temporal coherence and warm starting."]
#[repr(C)]
#[derive(Debug, Copy, Clone)]
pub struct b3FeaturePair {
#[doc = " Incoming type (either edge on shape A or shape B)"]
pub owner1: u8,
#[doc = " Incoming edge index (into associated shape array)"]
pub index1: u8,
#[doc = " Outgoing type (either edge on shape A or shape B)"]
pub owner2: u8,
#[doc = " Outgoing edge index (into associated shape array)"]
pub index2: u8,
}
#[doc = " A local manifold point and normal in frame A."]
#[repr(C)]
#[derive(Debug, Copy, Clone)]
pub struct b3LocalManifoldPoint {
#[doc = " Local point in frame A."]
pub point: b3Vec3,
#[doc = " The contact point separation. Negative for overlap."]
pub separation: f32,
#[doc = " The feature pair for this point."]
pub pair: b3FeaturePair,
#[doc = " The triangle index when collide with a mesh or height-field."]
pub triangleIndex: ::std::os::raw::c_int,
}
#[doc = " A local manifold with no dynamic information. Used by b3Collide functions."]
#[repr(C)]
#[derive(Debug, Copy, Clone)]
pub struct b3LocalManifold {
#[doc = " Local normal in frame A."]
pub normal: b3Vec3,
#[doc = " The triangle normal."]
pub triangleNormal: b3Vec3,
#[doc = " The manifold points. From a point buffer."]
pub points: *mut b3LocalManifoldPoint,
#[doc = " The number of manifold points. Only bounded by the buffer capacity."]
pub pointCount: ::std::os::raw::c_int,
#[doc = " The index of the triangle."]
pub triangleIndex: ::std::os::raw::c_int,
#[doc = "< Vertex 1 index."]
pub i1: ::std::os::raw::c_int,
#[doc = "< Vertex 2 index."]
pub i2: ::std::os::raw::c_int,
#[doc = "< Vertex 3 index."]
pub i3: ::std::os::raw::c_int,
#[doc = " The squared distance of a sphere from a triangle. For ghost collision reduction."]
pub squaredDistance: f32,
#[doc = " The triangle feature involved."]
pub feature: b3TriangleFeature,
#[doc = " b3MeshEdgeFlags."]
pub triangleFlags: ::std::os::raw::c_int,
}
pub const b3HexColor_b3_colorAliceBlue: b3HexColor = 15792383;
pub const b3HexColor_b3_colorAntiqueWhite: b3HexColor = 16444375;
pub const b3HexColor_b3_colorAqua: b3HexColor = 65535;
pub const b3HexColor_b3_colorAquamarine: b3HexColor = 8388564;
pub const b3HexColor_b3_colorAzure: b3HexColor = 15794175;
pub const b3HexColor_b3_colorBeige: b3HexColor = 16119260;
pub const b3HexColor_b3_colorBisque: b3HexColor = 16770244;
pub const b3HexColor_b3_colorBlack: b3HexColor = 0;
pub const b3HexColor_b3_colorBlanchedAlmond: b3HexColor = 16772045;
pub const b3HexColor_b3_colorBlue: b3HexColor = 255;
pub const b3HexColor_b3_colorBlueViolet: b3HexColor = 9055202;
pub const b3HexColor_b3_colorBrown: b3HexColor = 10824234;
pub const b3HexColor_b3_colorBurlywood: b3HexColor = 14596231;
pub const b3HexColor_b3_colorCadetBlue: b3HexColor = 6266528;
pub const b3HexColor_b3_colorChartreuse: b3HexColor = 8388352;
pub const b3HexColor_b3_colorChocolate: b3HexColor = 13789470;
pub const b3HexColor_b3_colorCoral: b3HexColor = 16744272;
pub const b3HexColor_b3_colorCornflowerBlue: b3HexColor = 6591981;
pub const b3HexColor_b3_colorCornsilk: b3HexColor = 16775388;
pub const b3HexColor_b3_colorCrimson: b3HexColor = 14423100;
pub const b3HexColor_b3_colorCyan: b3HexColor = 65535;
pub const b3HexColor_b3_colorDarkBlue: b3HexColor = 139;
pub const b3HexColor_b3_colorDarkCyan: b3HexColor = 35723;
pub const b3HexColor_b3_colorDarkGoldenRod: b3HexColor = 12092939;
pub const b3HexColor_b3_colorDarkGray: b3HexColor = 11119017;
pub const b3HexColor_b3_colorDarkGreen: b3HexColor = 25600;
pub const b3HexColor_b3_colorDarkKhaki: b3HexColor = 12433259;
pub const b3HexColor_b3_colorDarkMagenta: b3HexColor = 9109643;
pub const b3HexColor_b3_colorDarkOliveGreen: b3HexColor = 5597999;
pub const b3HexColor_b3_colorDarkOrange: b3HexColor = 16747520;
pub const b3HexColor_b3_colorDarkOrchid: b3HexColor = 10040012;
pub const b3HexColor_b3_colorDarkRed: b3HexColor = 9109504;
pub const b3HexColor_b3_colorDarkSalmon: b3HexColor = 15308410;
pub const b3HexColor_b3_colorDarkSeaGreen: b3HexColor = 9419919;
pub const b3HexColor_b3_colorDarkSlateBlue: b3HexColor = 4734347;
pub const b3HexColor_b3_colorDarkSlateGray: b3HexColor = 3100495;
pub const b3HexColor_b3_colorDarkTurquoise: b3HexColor = 52945;
pub const b3HexColor_b3_colorDarkViolet: b3HexColor = 9699539;
pub const b3HexColor_b3_colorDeepPink: b3HexColor = 16716947;
pub const b3HexColor_b3_colorDeepSkyBlue: b3HexColor = 49151;
pub const b3HexColor_b3_colorDimGray: b3HexColor = 6908265;
pub const b3HexColor_b3_colorDodgerBlue: b3HexColor = 2003199;
pub const b3HexColor_b3_colorFireBrick: b3HexColor = 11674146;
pub const b3HexColor_b3_colorFloralWhite: b3HexColor = 16775920;
pub const b3HexColor_b3_colorForestGreen: b3HexColor = 2263842;
pub const b3HexColor_b3_colorFuchsia: b3HexColor = 16711935;
pub const b3HexColor_b3_colorGainsboro: b3HexColor = 14474460;
pub const b3HexColor_b3_colorGhostWhite: b3HexColor = 16316671;
pub const b3HexColor_b3_colorGold: b3HexColor = 16766720;
pub const b3HexColor_b3_colorGoldenRod: b3HexColor = 14329120;
pub const b3HexColor_b3_colorGray: b3HexColor = 8421504;
pub const b3HexColor_b3_colorGreen: b3HexColor = 32768;
pub const b3HexColor_b3_colorGreenYellow: b3HexColor = 11403055;
pub const b3HexColor_b3_colorHoneyDew: b3HexColor = 15794160;
pub const b3HexColor_b3_colorHotPink: b3HexColor = 16738740;
pub const b3HexColor_b3_colorIndianRed: b3HexColor = 13458524;
pub const b3HexColor_b3_colorIndigo: b3HexColor = 4915330;
pub const b3HexColor_b3_colorIvory: b3HexColor = 16777200;
pub const b3HexColor_b3_colorKhaki: b3HexColor = 15787660;
pub const b3HexColor_b3_colorLavender: b3HexColor = 15132410;
pub const b3HexColor_b3_colorLavenderBlush: b3HexColor = 16773365;
pub const b3HexColor_b3_colorLawnGreen: b3HexColor = 8190976;
pub const b3HexColor_b3_colorLemonChiffon: b3HexColor = 16775885;
pub const b3HexColor_b3_colorLightBlue: b3HexColor = 11393254;
pub const b3HexColor_b3_colorLightCoral: b3HexColor = 15761536;
pub const b3HexColor_b3_colorLightCyan: b3HexColor = 14745599;
pub const b3HexColor_b3_colorLightGoldenRodYellow: b3HexColor = 16448210;
pub const b3HexColor_b3_colorLightGray: b3HexColor = 13882323;
pub const b3HexColor_b3_colorLightGreen: b3HexColor = 9498256;
pub const b3HexColor_b3_colorLightPink: b3HexColor = 16758465;
pub const b3HexColor_b3_colorLightSalmon: b3HexColor = 16752762;
pub const b3HexColor_b3_colorLightSeaGreen: b3HexColor = 2142890;
pub const b3HexColor_b3_colorLightSkyBlue: b3HexColor = 8900346;
pub const b3HexColor_b3_colorLightSlateGray: b3HexColor = 7833753;
pub const b3HexColor_b3_colorLightSteelBlue: b3HexColor = 11584734;
pub const b3HexColor_b3_colorLightYellow: b3HexColor = 16777184;
pub const b3HexColor_b3_colorLime: b3HexColor = 65280;
pub const b3HexColor_b3_colorLimeGreen: b3HexColor = 3329330;
pub const b3HexColor_b3_colorLinen: b3HexColor = 16445670;
pub const b3HexColor_b3_colorMagenta: b3HexColor = 16711935;
pub const b3HexColor_b3_colorMaroon: b3HexColor = 8388608;
pub const b3HexColor_b3_colorMediumAquaMarine: b3HexColor = 6737322;
pub const b3HexColor_b3_colorMediumBlue: b3HexColor = 205;
pub const b3HexColor_b3_colorMediumOrchid: b3HexColor = 12211667;
pub const b3HexColor_b3_colorMediumPurple: b3HexColor = 9662683;
pub const b3HexColor_b3_colorMediumSeaGreen: b3HexColor = 3978097;
pub const b3HexColor_b3_colorMediumSlateBlue: b3HexColor = 8087790;
pub const b3HexColor_b3_colorMediumSpringGreen: b3HexColor = 64154;
pub const b3HexColor_b3_colorMediumTurquoise: b3HexColor = 4772300;
pub const b3HexColor_b3_colorMediumVioletRed: b3HexColor = 13047173;
pub const b3HexColor_b3_colorMidnightBlue: b3HexColor = 1644912;
pub const b3HexColor_b3_colorMintCream: b3HexColor = 16121850;
pub const b3HexColor_b3_colorMistyRose: b3HexColor = 16770273;
pub const b3HexColor_b3_colorMoccasin: b3HexColor = 16770229;
pub const b3HexColor_b3_colorNavajoWhite: b3HexColor = 16768685;
pub const b3HexColor_b3_colorNavy: b3HexColor = 128;
pub const b3HexColor_b3_colorOldLace: b3HexColor = 16643558;
pub const b3HexColor_b3_colorOlive: b3HexColor = 8421376;
pub const b3HexColor_b3_colorOliveDrab: b3HexColor = 7048739;
pub const b3HexColor_b3_colorOrange: b3HexColor = 16753920;
pub const b3HexColor_b3_colorOrangeRed: b3HexColor = 16729344;
pub const b3HexColor_b3_colorOrchid: b3HexColor = 14315734;
pub const b3HexColor_b3_colorPaleGoldenRod: b3HexColor = 15657130;
pub const b3HexColor_b3_colorPaleGreen: b3HexColor = 10025880;
pub const b3HexColor_b3_colorPaleTurquoise: b3HexColor = 11529966;
pub const b3HexColor_b3_colorPaleVioletRed: b3HexColor = 14381203;
pub const b3HexColor_b3_colorPapayaWhip: b3HexColor = 16773077;
pub const b3HexColor_b3_colorPeachPuff: b3HexColor = 16767673;
pub const b3HexColor_b3_colorPeru: b3HexColor = 13468991;
pub const b3HexColor_b3_colorPink: b3HexColor = 16761035;
pub const b3HexColor_b3_colorPlum: b3HexColor = 14524637;
pub const b3HexColor_b3_colorPowderBlue: b3HexColor = 11591910;
pub const b3HexColor_b3_colorPurple: b3HexColor = 8388736;
pub const b3HexColor_b3_colorRebeccaPurple: b3HexColor = 6697881;
pub const b3HexColor_b3_colorRed: b3HexColor = 16711680;
pub const b3HexColor_b3_colorRosyBrown: b3HexColor = 12357519;
pub const b3HexColor_b3_colorRoyalBlue: b3HexColor = 4286945;
pub const b3HexColor_b3_colorSaddleBrown: b3HexColor = 9127187;
pub const b3HexColor_b3_colorSalmon: b3HexColor = 16416882;
pub const b3HexColor_b3_colorSandyBrown: b3HexColor = 16032864;
pub const b3HexColor_b3_colorSeaGreen: b3HexColor = 3050327;
pub const b3HexColor_b3_colorSeaShell: b3HexColor = 16774638;
pub const b3HexColor_b3_colorSienna: b3HexColor = 10506797;
pub const b3HexColor_b3_colorSilver: b3HexColor = 12632256;
pub const b3HexColor_b3_colorSkyBlue: b3HexColor = 8900331;
pub const b3HexColor_b3_colorSlateBlue: b3HexColor = 6970061;
pub const b3HexColor_b3_colorSlateGray: b3HexColor = 7372944;
pub const b3HexColor_b3_colorSnow: b3HexColor = 16775930;
pub const b3HexColor_b3_colorSpringGreen: b3HexColor = 65407;
pub const b3HexColor_b3_colorSteelBlue: b3HexColor = 4620980;
pub const b3HexColor_b3_colorTan: b3HexColor = 13808780;
pub const b3HexColor_b3_colorTeal: b3HexColor = 32896;
pub const b3HexColor_b3_colorThistle: b3HexColor = 14204888;
pub const b3HexColor_b3_colorTomato: b3HexColor = 16737095;
pub const b3HexColor_b3_colorTurquoise: b3HexColor = 4251856;
pub const b3HexColor_b3_colorViolet: b3HexColor = 15631086;
pub const b3HexColor_b3_colorWheat: b3HexColor = 16113331;
pub const b3HexColor_b3_colorWhite: b3HexColor = 16777215;
pub const b3HexColor_b3_colorWhiteSmoke: b3HexColor = 16119285;
pub const b3HexColor_b3_colorYellow: b3HexColor = 16776960;
pub const b3HexColor_b3_colorYellowGreen: b3HexColor = 10145074;
pub const b3HexColor_b3_colorBox2DRed: b3HexColor = 14430514;
pub const b3HexColor_b3_colorBox2DBlue: b3HexColor = 3190463;
pub const b3HexColor_b3_colorBox2DGreen: b3HexColor = 9226532;
pub const b3HexColor_b3_colorBox2DYellow: b3HexColor = 16772748;
#[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"]
pub type b3HexColor = ::std::os::raw::c_int;
pub const b3DebugMaterial_b3_debugMaterialDefault: b3DebugMaterial = 0;
pub const b3DebugMaterial_b3_debugMaterialMatte: b3DebugMaterial = 1;
pub const b3DebugMaterial_b3_debugMaterialSoft: b3DebugMaterial = 2;
pub const b3DebugMaterial_b3_debugMaterialDead: b3DebugMaterial = 3;
pub const b3DebugMaterial_b3_debugMaterialGlossy: b3DebugMaterial = 4;
pub const b3DebugMaterial_b3_debugMaterialMetallic: b3DebugMaterial = 5;
#[doc = " Debug draw material preset. Optionally packed into the unused high byte of a\n b3HexColor (or b3SurfaceMaterial::customColor) to drive the renderer's PBR\n roughness and metalness. The low 24 bits stay RGB, so a plain 0xRRGGBB color\n reads as b3_debugMaterialDefault and keeps the renderer's per-body-type look."]
pub type b3DebugMaterial = ::std::os::raw::c_int;
unsafe extern "C" {
#[doc = " Get the visualization color assigned to a constraint graph color slot. The last index\n (B3_GRAPH_COLOR_COUNT - 1) is the overflow color."]
pub fn b3GetGraphColor(index: ::std::os::raw::c_int) -> b3HexColor;
}
#[doc = " This is sent to the user for debug shape creation. The user should know the type in case they have\n custom sphere or capsule rendering."]
#[repr(C)]
#[derive(Copy, Clone)]
pub struct b3DebugShape {
#[doc = " Shape id."]
pub shapeId: b3ShapeId,
#[doc = " Shape type."]
pub type_: b3ShapeType,
pub __bindgen_anon_1: b3DebugShape__bindgen_ty_1,
}
#[doc = " Tagged union."]
#[repr(C)]
#[derive(Copy, Clone)]
pub union b3DebugShape__bindgen_ty_1 {
#[doc = "< Capsule shape."]
pub capsule: *const b3Capsule,
#[doc = "< Compound shape."]
pub compound: *const b3CompoundData,
#[doc = "< Height-field shape."]
pub heightField: *const b3HeightFieldData,
#[doc = "< Convex hull shape."]
pub hull: *const b3HullData,
#[doc = "< Mesh shape with scale."]
pub mesh: *const b3Mesh,
#[doc = "< Sphere shape."]
pub sphere: *const b3Sphere,
}
#[doc = " This struct is passed to b3World_Draw to draw a debug view of the simulation world.\n Callbacks receive world coordinates. In large world mode the translation is double precision so\n it stays accurate far from the origin. Shift into your own camera frame inside the callbacks."]
#[repr(C)]
#[derive(Debug, Copy, Clone)]
pub struct b3DebugDraw {
#[doc = " Draws a shape and returns true if drawing should continue"]
pub DrawShapeFcn: ::std::option::Option<
unsafe extern "C" fn(
userShape: *mut ::std::os::raw::c_void,
transform: b3WorldTransform,
color: b3HexColor,
context: *mut ::std::os::raw::c_void,
) -> bool,
>,
#[doc = " Draw a line segment."]
pub DrawSegmentFcn: ::std::option::Option<
unsafe extern "C" fn(
p1: b3Pos,
p2: b3Pos,
color: b3HexColor,
context: *mut ::std::os::raw::c_void,
),
>,
#[doc = " Draw a transform. Choose your own length scale."]
pub DrawTransformFcn: ::std::option::Option<
unsafe extern "C" fn(transform: b3WorldTransform, context: *mut ::std::os::raw::c_void),
>,
#[doc = " Draw a point."]
pub DrawPointFcn: ::std::option::Option<
unsafe extern "C" fn(
p: b3Pos,
size: f32,
color: b3HexColor,
context: *mut ::std::os::raw::c_void,
),
>,
#[doc = " Draw a sphere."]
pub DrawSphereFcn: ::std::option::Option<
unsafe extern "C" fn(
p: b3Pos,
radius: f32,
color: b3HexColor,
alpha: f32,
context: *mut ::std::os::raw::c_void,
),
>,
#[doc = " Draw a capsule."]
pub DrawCapsuleFcn: ::std::option::Option<
unsafe extern "C" fn(
p1: b3Pos,
p2: b3Pos,
radius: f32,
color: b3HexColor,
alpha: f32,
context: *mut ::std::os::raw::c_void,
),
>,
#[doc = " Draw a bounding box."]
pub DrawBoundsFcn: ::std::option::Option<
unsafe extern "C" fn(aabb: b3AABB, color: b3HexColor, context: *mut ::std::os::raw::c_void),
>,
#[doc = " Draw an oriented box."]
pub DrawBoxFcn: ::std::option::Option<
unsafe extern "C" fn(
extents: b3Vec3,
transform: b3WorldTransform,
color: b3HexColor,
context: *mut ::std::os::raw::c_void,
),
>,
#[doc = " Draw a string in world space"]
pub DrawStringFcn: ::std::option::Option<
unsafe extern "C" fn(
p: b3Pos,
s: *const ::std::os::raw::c_char,
color: b3HexColor,
context: *mut ::std::os::raw::c_void,
),
>,
#[doc = " World bounds to use for debug draw"]
pub drawingBounds: b3AABB,
#[doc = " Scale to use when drawing forces"]
pub forceScale: f32,
#[doc = " Global scaling for joint drawing"]
pub jointScale: f32,
#[doc = " Option to draw shapes"]
pub drawShapes: bool,
#[doc = " Option to draw joints"]
pub drawJoints: bool,
#[doc = " Option to draw additional information for joints"]
pub drawJointExtras: bool,
#[doc = " Option to draw the bounding boxes for shapes"]
pub drawBounds: bool,
#[doc = " Option to draw the mass and center of mass of dynamic bodies"]
pub drawMass: bool,
#[doc = " Option to draw body names"]
pub drawBodyNames: bool,
#[doc = " Option to draw contact points"]
pub drawContacts: bool,
#[doc = " Draw contact anchor A or B"]
pub drawAnchorA: ::std::os::raw::c_int,
#[doc = " Option to visualize the graph coloring used for contacts and joints"]
pub drawGraphColors: bool,
#[doc = " Option to draw contact features"]
pub drawContactFeatures: bool,
#[doc = " Option to draw contact normals"]
pub drawContactNormals: bool,
#[doc = " Option to draw contact normal forces"]
pub drawContactForces: bool,
#[doc = " Option to draw contact friction forces"]
pub drawFrictionForces: bool,
#[doc = " Option to draw islands as bounding boxes"]
pub drawIslands: bool,
#[doc = " User context that is passed as an argument to drawing callback functions"]
pub context: *mut ::std::os::raw::c_void,
}
unsafe extern "C" {
#[doc = " Create a debug draw struct with default values."]
pub fn b3DefaultDebugDraw() -> b3DebugDraw;
}
unsafe extern "C" {
#[doc = " Constructing the tree initializes the node pool."]
pub fn b3DynamicTree_Create(proxyCapacity: ::std::os::raw::c_int) -> b3DynamicTree;
}
unsafe extern "C" {
#[doc = " Destroy the tree, freeing the node pool."]
pub fn b3DynamicTree_Destroy(tree: *mut b3DynamicTree);
}
unsafe extern "C" {
#[doc = " Create a proxy. Provide an AABB and a userData value."]
pub fn b3DynamicTree_CreateProxy(
tree: *mut b3DynamicTree,
aabb: b3AABB,
categoryBits: u64,
userData: u64,
) -> ::std::os::raw::c_int;
}
unsafe extern "C" {
#[doc = " Destroy a proxy. This asserts if the id is invalid."]
pub fn b3DynamicTree_DestroyProxy(tree: *mut b3DynamicTree, proxyId: ::std::os::raw::c_int);
}
unsafe extern "C" {
#[doc = " Move a proxy to a new AABB by removing and reinserting into the tree."]
pub fn b3DynamicTree_MoveProxy(
tree: *mut b3DynamicTree,
proxyId: ::std::os::raw::c_int,
aabb: b3AABB,
);
}
unsafe extern "C" {
#[doc = " Enlarge a proxy and enlarge ancestors as necessary."]
pub fn b3DynamicTree_EnlargeProxy(
tree: *mut b3DynamicTree,
proxyId: ::std::os::raw::c_int,
aabb: b3AABB,
);
}
unsafe extern "C" {
#[doc = " Modify the category bits on a proxy. This is an expensive operation."]
pub fn b3DynamicTree_SetCategoryBits(
tree: *mut b3DynamicTree,
proxyId: ::std::os::raw::c_int,
categoryBits: u64,
);
}
unsafe extern "C" {
#[doc = " Get the category bits on a proxy."]
pub fn b3DynamicTree_GetCategoryBits(
tree: *mut b3DynamicTree,
proxyId: ::std::os::raw::c_int,
) -> u64;
}
unsafe extern "C" {
#[doc = " Query an AABB for overlapping proxies. The callback function is called for each proxy that overlaps the supplied AABB.\n\t@return performance data"]
pub fn b3DynamicTree_Query(
tree: *const b3DynamicTree,
aabb: b3AABB,
maskBits: u64,
requireAllBits: bool,
callback: b3TreeQueryCallbackFcn,
context: *mut ::std::os::raw::c_void,
) -> b3TreeStats;
}
unsafe extern "C" {
#[doc = " Query an AABB for the closest object. The callback function is called for each proxy that might be closest to the supplied point.\n @param tree the dynamic tree to query\n @param point the query point\n @param maskBits nodes are skipped if the bit-wise AND with the node category bits is zero\n @param requireAllBits nodes are skipped if the bit-wise AND with the node category bits does not equal the maskBits\n @param callback a user provided instance of b3TreeQueryClosestCallbackFcn\n @param context a user context object that is provided to the callback\n @param minDistanceSqr the initial and final minimum squared distance. Provide a small initial to restrict the search and\n improve performance. If the value is large this query has performance that scales linearly with the number of proxies and\n would be slower than a brute force search.\n\t@return performance data"]
pub fn b3DynamicTree_QueryClosest(
tree: *const b3DynamicTree,
point: b3Vec3,
maskBits: u64,
requireAllBits: bool,
callback: b3TreeQueryClosestCallbackFcn,
context: *mut ::std::os::raw::c_void,
minDistanceSqr: *mut f32,
) -> b3TreeStats;
}
unsafe extern "C" {
#[doc = " Ray cast against the proxies in the tree. This relies on the callback\n to perform an exact ray cast in the case where the proxy contains a shape.\n The callback also performs 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 bit mask test: `bool accept = (maskBits & node->categoryBits) != 0;`\n @param requireAllBits modifies bit mask test: `bool accept = (maskBits & node->categoryBits) == maskBits;`\n @param callback a callback function 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"]
pub fn b3DynamicTree_RayCast(
tree: *const b3DynamicTree,
input: *const b3RayCastInput,
maskBits: u64,
requireAllBits: bool,
callback: b3TreeRayCastCallbackFcn,
context: *mut ::std::os::raw::c_void,
) -> b3TreeStats;
}
unsafe extern "C" {
#[doc = " Sweep an AABB through the tree. The box is in the tree's world float frame and the callback\n re-differences each shape at full precision against the query origin. Used by the large world\n spatial queries so the tree traversal stays float while the narrow phase stays precise."]
pub fn b3DynamicTree_BoxCast(
tree: *const b3DynamicTree,
input: *const b3BoxCastInput,
maskBits: u64,
requireAllBits: bool,
callback: b3TreeBoxCastCallbackFcn,
context: *mut ::std::os::raw::c_void,
) -> b3TreeStats;
}
unsafe extern "C" {
#[doc = " Validate this tree. For testing."]
pub fn b3DynamicTree_Validate(tree: *const b3DynamicTree);
}
unsafe extern "C" {
#[doc = " Get the height of the binary tree."]
pub fn b3DynamicTree_GetHeight(tree: *const b3DynamicTree) -> ::std::os::raw::c_int;
}
unsafe extern "C" {
#[doc = " Get the ratio of the sum of the node areas to the root area."]
pub fn b3DynamicTree_GetAreaRatio(tree: *const b3DynamicTree) -> f32;
}
unsafe extern "C" {
#[doc = " Get the bounding box that contains the entire tree"]
pub fn b3DynamicTree_GetRootBounds(tree: *const b3DynamicTree) -> b3AABB;
}
unsafe extern "C" {
#[doc = " Get the number of proxies created"]
pub fn b3DynamicTree_GetProxyCount(tree: *const b3DynamicTree) -> ::std::os::raw::c_int;
}
unsafe extern "C" {
#[doc = " Rebuild the tree while retaining subtrees that haven't changed. Returns the number of boxes sorted."]
pub fn b3DynamicTree_Rebuild(
tree: *mut b3DynamicTree,
fullBuild: bool,
) -> ::std::os::raw::c_int;
}
unsafe extern "C" {
#[doc = " Get the number of bytes used by this tree"]
pub fn b3DynamicTree_GetByteCount(tree: *const b3DynamicTree) -> ::std::os::raw::c_int;
}
unsafe extern "C" {
#[doc = " Validate this tree has no enlarged AABBs. For testing."]
pub fn b3DynamicTree_ValidateNoEnlarged(tree: *const b3DynamicTree);
}
unsafe extern "C" {
#[doc = " Save this tree to a file for debugging"]
pub fn b3DynamicTree_Save(tree: *const b3DynamicTree, fileName: *const ::std::os::raw::c_char);
}
unsafe extern "C" {
#[doc = " Load a file for debugging"]
pub fn b3DynamicTree_Load(fileName: *const ::std::os::raw::c_char, scale: f32)
-> b3DynamicTree;
}
unsafe extern "C" {
#[doc = " Create a tessellated cylinder as a hull."]
pub fn b3CreateCylinder(
height: f32,
radius: f32,
yOffset: f32,
sides: ::std::os::raw::c_int,
) -> *mut b3HullData;
}
unsafe extern "C" {
#[doc = " Create a tessellated cone as a hull."]
pub fn b3CreateCone(
height: f32,
radius1: f32,
radius2: f32,
slices: ::std::os::raw::c_int,
) -> *mut b3HullData;
}
unsafe extern "C" {
#[doc = " Create a rock shaped hull."]
pub fn b3CreateRock(radius: f32) -> *mut b3HullData;
}
unsafe extern "C" {
#[doc = " Create a generic convex hull."]
pub fn b3CreateHull(
points: *const b3Vec3,
pointCount: ::std::os::raw::c_int,
maxVertexCount: ::std::os::raw::c_int,
) -> *mut b3HullData;
}
unsafe extern "C" {
#[doc = " Deep clone a hull."]
pub fn b3CloneHull(hull: *const b3HullData) -> *mut b3HullData;
}
unsafe extern "C" {
#[doc = " Clone and transform a hull. Supports non-uniform and mirroring scale."]
pub fn b3CloneAndTransformHull(
original: *const b3HullData,
transform: b3Transform,
scale: b3Vec3,
) -> *mut b3HullData;
}
unsafe extern "C" {
#[doc = " Destroy a hull."]
pub fn b3DestroyHull(hull: *mut b3HullData);
}
unsafe extern "C" {
#[doc = " Make a cube as a hull. Do not call b3DestroyHull on this."]
pub fn b3MakeCubeHull(halfWidth: f32) -> b3BoxHull;
}
unsafe extern "C" {
#[doc = " Make a box as a hull. Do not call b3DestroyHull on this."]
pub fn b3MakeBoxHull(hx: f32, hy: f32, hz: f32) -> b3BoxHull;
}
unsafe extern "C" {
#[doc = " Make an offset box as a hull. Do not call b3DestroyHull on this."]
pub fn b3MakeOffsetBoxHull(hx: f32, hy: f32, hz: f32, offset: b3Vec3) -> b3BoxHull;
}
unsafe extern "C" {
#[doc = " Make a transformed box as a hull. Do not call b3DestroyHull on this.\n @param hx, hy, hz positive half widths\n @param transform local transform of box"]
pub fn b3MakeTransformedBoxHull(hx: f32, hy: f32, hz: f32, transform: b3Transform)
-> b3BoxHull;
}
unsafe extern "C" {
#[doc = " This makes a transformed box hull with post scaling. This is useful for boxes that are scaled in\n a level editor. Such scaling can have reflection and shear. In the case of shear the result\n may be approximate. If you need to support shear consider using b3CreateHull.\n Do not call b3DestroyHull on this.\n @param halfWidths positive half widths\n @param transform local transform of box\n @param postScale scale applied after the transform, may be negative"]
pub fn b3MakeScaledBoxHull(
halfWidths: b3Vec3,
transform: b3Transform,
postScale: b3Vec3,
) -> b3BoxHull;
}
unsafe extern "C" {
#[doc = " This takes a box with a transform and post scale and converts it into a box with the post scale\n resolved with new half-widths and transform. This accepts non-uniform and negative scale.\n This is approximate if there is shear.\n @param halfWidths [in/out] the box half widths\n @param transform [in/out] the box transform with rotation and translation\n @param postScale the post scale being applied to the box after the transform\n @param minHalfWidth the minimum half width after scale is applied"]
pub fn b3ScaleBox(
halfWidths: *mut b3Vec3,
transform: *mut b3Transform,
postScale: b3Vec3,
minHalfWidth: f32,
);
}
unsafe extern "C" {
#[doc = " Create a grid mesh along the x and z axes.\n @param xCount the number of rows in the x direction\n @param zCount the number of rows in the z direction\n @param cellWidth the width of each cell\n @param materialCount the number of materials to generate\n @param identifyEdges compute adjacency information"]
pub fn b3CreateGridMesh(
xCount: ::std::os::raw::c_int,
zCount: ::std::os::raw::c_int,
cellWidth: f32,
materialCount: ::std::os::raw::c_int,
identifyEdges: bool,
) -> *mut b3MeshData;
}
unsafe extern "C" {
#[doc = " Create a wave mesh along the x and z axes."]
pub fn b3CreateWaveMesh(
xCount: ::std::os::raw::c_int,
zCount: ::std::os::raw::c_int,
cellWidth: f32,
amplitude: f32,
rowFrequency: f32,
columnFrequency: f32,
) -> *mut b3MeshData;
}
unsafe extern "C" {
#[doc = " Create a torus mesh."]
pub fn b3CreateTorusMesh(
radialResolution: ::std::os::raw::c_int,
tubularResolution: ::std::os::raw::c_int,
radius: f32,
thickness: f32,
) -> *mut b3MeshData;
}
unsafe extern "C" {
#[doc = " Create a box mesh."]
pub fn b3CreateBoxMesh(center: b3Vec3, extent: b3Vec3, identifyEdges: bool) -> *mut b3MeshData;
}
unsafe extern "C" {
#[doc = " Create a hollow box mesh."]
pub fn b3CreateHollowBoxMesh(center: b3Vec3, extent: b3Vec3) -> *mut b3MeshData;
}
unsafe extern "C" {
#[doc = " Create a platform mesh. A truncated pyramid."]
pub fn b3CreatePlatformMesh(
center: b3Vec3,
height: f32,
topWidth: f32,
bottomWidth: f32,
) -> *mut b3MeshData;
}
unsafe extern "C" {
#[doc = " Create a generic mesh."]
pub fn b3CreateMesh(
def: *const b3MeshDef,
degenerateTriangleIndices: *mut ::std::os::raw::c_int,
degenerateCapacity: ::std::os::raw::c_int,
) -> *mut b3MeshData;
}
unsafe extern "C" {
#[doc = " Destroy a mesh."]
pub fn b3DestroyMesh(mesh: *mut b3MeshData);
}
unsafe extern "C" {
#[doc = " Get the height of the mesh BVH."]
pub fn b3GetHeight(mesh: *const b3MeshData) -> ::std::os::raw::c_int;
}
unsafe extern "C" {
#[doc = " Create a generic height field."]
pub fn b3CreateHeightField(data: *const b3HeightFieldDef) -> *mut b3HeightFieldData;
}
unsafe extern "C" {
#[doc = " Create a grid as a height field."]
pub fn b3CreateGrid(
rowCount: ::std::os::raw::c_int,
columnCount: ::std::os::raw::c_int,
scale: b3Vec3,
makeHoles: bool,
) -> *mut b3HeightFieldData;
}
unsafe extern "C" {
#[doc = " Create a wave grid as a height field."]
pub fn b3CreateWave(
rowCount: ::std::os::raw::c_int,
columnCount: ::std::os::raw::c_int,
scale: b3Vec3,
rowFrequency: f32,
columnFrequency: f32,
makeHoles: bool,
) -> *mut b3HeightFieldData;
}
unsafe extern "C" {
#[doc = " Destroy a height field."]
pub fn b3DestroyHeightField(heightField: *mut b3HeightFieldData);
}
unsafe extern "C" {
#[doc = " Save input height data to a file"]
pub fn b3DumpHeightData(data: *const b3HeightFieldDef, fileName: *const ::std::os::raw::c_char);
}
unsafe extern "C" {
#[doc = " Create a height field by loading a previously saved height data"]
pub fn b3LoadHeightField(fileName: *const ::std::os::raw::c_char) -> *mut b3HeightFieldData;
}
unsafe extern "C" {
#[doc = " Get a child shape of a compound."]
pub fn b3GetCompoundChild(
compound: *const b3CompoundData,
childIndex: ::std::os::raw::c_int,
) -> b3ChildShape;
}
unsafe extern "C" {
#[doc = " Query a compound shape for children that overlap an AABB."]
pub fn b3QueryCompound(
compound: *const b3CompoundData,
aabb: b3AABB,
fcn: b3CompoundQueryFcn,
context: *mut ::std::os::raw::c_void,
);
}
unsafe extern "C" {
#[doc = " Access a child capsule by index."]
pub fn b3GetCompoundCapsule(
compound: *const b3CompoundData,
index: ::std::os::raw::c_int,
) -> b3CompoundCapsule;
}
unsafe extern "C" {
#[doc = " Access a child hull by index."]
pub fn b3GetCompoundHull(
compound: *const b3CompoundData,
index: ::std::os::raw::c_int,
) -> b3CompoundHull;
}
unsafe extern "C" {
#[doc = " Access a child mesh by index."]
pub fn b3GetCompoundMesh(
compound: *const b3CompoundData,
index: ::std::os::raw::c_int,
) -> b3CompoundMesh;
}
unsafe extern "C" {
#[doc = " Access a child sphere by index."]
pub fn b3GetCompoundSphere(
compound: *const b3CompoundData,
index: ::std::os::raw::c_int,
) -> b3CompoundSphere;
}
unsafe extern "C" {
#[doc = " Access the compound material array."]
pub fn b3GetCompoundMaterials(compound: *const b3CompoundData) -> *const b3SurfaceMaterial;
}
unsafe extern "C" {
#[doc = " Create a compound shape. All input data in the definition is cloned into the resulting compound."]
pub fn b3CreateCompound(def: *const b3CompoundDef) -> *mut b3CompoundData;
}
unsafe extern "C" {
#[doc = " Destroy a compound shape."]
pub fn b3DestroyCompound(compound: *mut b3CompoundData);
}
unsafe extern "C" {
#[doc = " If bytes is null then this returns the number of required bytes. This clones all the\n data into the bytes buffer. This is expected to run offline or asynchronously.\n This mutates the compound to nullify pointers, leaving the compound in an unusable state."]
pub fn b3ConvertCompoundToBytes(compound: *mut b3CompoundData) -> *mut u8;
}
unsafe extern "C" {
#[doc = " Convert bytes to compound. This does not clone. The bytes must remain in scope while the\n compound is used. This is done to improve run-time performance and allow for instancing.\n The bytes are mutated to fixup pointers."]
pub fn b3ConvertBytesToCompound(
bytes: *mut u8,
byteCount: ::std::os::raw::c_int,
) -> *mut b3CompoundData;
}
unsafe extern "C" {
#[doc = " Compute mass properties of a sphere"]
pub fn b3ComputeSphereMass(shape: *const b3Sphere, density: f32) -> b3MassData;
}
unsafe extern "C" {
#[doc = " Compute mass properties of a capsule"]
pub fn b3ComputeCapsuleMass(shape: *const b3Capsule, density: f32) -> b3MassData;
}
unsafe extern "C" {
#[doc = " Compute mass properties of a hull"]
pub fn b3ComputeHullMass(shape: *const b3HullData, density: f32) -> b3MassData;
}
unsafe extern "C" {
#[doc = " Compute the bounding box of a transformed sphere"]
pub fn b3ComputeSphereAABB(shape: *const b3Sphere, transform: b3Transform) -> b3AABB;
}
unsafe extern "C" {
#[doc = " Compute the bounding box of a transformed capsule"]
pub fn b3ComputeCapsuleAABB(shape: *const b3Capsule, transform: b3Transform) -> b3AABB;
}
unsafe extern "C" {
#[doc = " Compute the bounding box of a transformed hull"]
pub fn b3ComputeHullAABB(shape: *const b3HullData, transform: b3Transform) -> b3AABB;
}
unsafe extern "C" {
#[doc = " Compute the bounding box of a transformed mesh. Scale may be non-uniform and have negative components."]
pub fn b3ComputeMeshAABB(
shape: *const b3MeshData,
transform: b3Transform,
scale: b3Vec3,
) -> b3AABB;
}
unsafe extern "C" {
#[doc = " Compute the bounding box of a transformed height-field"]
pub fn b3ComputeHeightFieldAABB(
shape: *const b3HeightFieldData,
transform: b3Transform,
) -> b3AABB;
}
unsafe extern "C" {
#[doc = " Compute the bounding box of a compound"]
pub fn b3ComputeCompoundAABB(shape: *const b3CompoundData, transform: b3Transform) -> b3AABB;
}
unsafe extern "C" {
#[doc = " Use this to ensure your ray cast input is valid and avoid internal assertions."]
pub fn b3IsValidRay(input: *const b3RayCastInput) -> bool;
}
unsafe extern "C" {
#[doc = " Overlap shape versus capsule"]
pub fn b3OverlapCapsule(
shape: *const b3Capsule,
shapeTransform: b3Transform,
proxy: *const b3ShapeProxy,
) -> bool;
}
unsafe extern "C" {
#[doc = " Overlap shape versus compound"]
pub fn b3OverlapCompound(
shape: *const b3CompoundData,
shapeTransform: b3Transform,
proxy: *const b3ShapeProxy,
) -> bool;
}
unsafe extern "C" {
#[doc = " Overlap shape versus height field"]
pub fn b3OverlapHeightField(
shape: *const b3HeightFieldData,
shapeTransform: b3Transform,
proxy: *const b3ShapeProxy,
) -> bool;
}
unsafe extern "C" {
#[doc = " Overlap shape versus hull"]
pub fn b3OverlapHull(
shape: *const b3HullData,
shapeTransform: b3Transform,
proxy: *const b3ShapeProxy,
) -> bool;
}
unsafe extern "C" {
#[doc = " Overlap shape versus mesh"]
pub fn b3OverlapMesh(
shape: *const b3Mesh,
shapeTransform: b3Transform,
proxy: *const b3ShapeProxy,
) -> bool;
}
unsafe extern "C" {
#[doc = " Overlap shape versus sphere"]
pub fn b3OverlapSphere(
shape: *const b3Sphere,
shapeTransform: b3Transform,
proxy: *const b3ShapeProxy,
) -> bool;
}
unsafe extern "C" {
#[doc = " Ray cast versus sphere in local space. A zero length ray is a point query. Initial overlap\n reports a hit at the ray origin with zero fraction and zero normal."]
pub fn b3RayCastSphere(shape: *const b3Sphere, input: *const b3RayCastInput) -> b3CastOutput;
}
unsafe extern "C" {
#[doc = " Ray cast versus a hollow sphere shell in local space. Unlike the solid sphere a ray starting\n inside is not an overlap: it passes through and hits the far wall."]
pub fn b3RayCastHollowSphere(
shape: *const b3Sphere,
input: *const b3RayCastInput,
) -> b3CastOutput;
}
unsafe extern "C" {
#[doc = " Ray cast versus capsule in local space. A zero length ray is a point query. Initial overlap\n reports a hit at the ray origin with zero fraction and zero normal."]
pub fn b3RayCastCapsule(shape: *const b3Capsule, input: *const b3RayCastInput) -> b3CastOutput;
}
unsafe extern "C" {
#[doc = " Ray cast versus compound in local space. A zero length ray is a point query. Initial overlap\n with a child reports a hit at the ray origin with zero fraction and zero normal."]
pub fn b3RayCastCompound(
shape: *const b3CompoundData,
input: *const b3RayCastInput,
) -> b3CastOutput;
}
unsafe extern "C" {
#[doc = " Ray cast versus hull shape in local space. A zero length ray is a point query. Initial overlap\n reports a hit at the ray origin with zero fraction and zero normal."]
pub fn b3RayCastHull(shape: *const b3HullData, input: *const b3RayCastInput) -> b3CastOutput;
}
unsafe extern "C" {
#[doc = " Ray cast versus mesh in local space. A thin surface with no interior, so there is no overlap case."]
pub fn b3RayCastMesh(shape: *const b3Mesh, input: *const b3RayCastInput) -> b3CastOutput;
}
unsafe extern "C" {
#[doc = " Ray cast versus height field in local space. A thin surface with no interior, so there is no overlap case."]
pub fn b3RayCastHeightField(
shape: *const b3HeightFieldData,
input: *const b3RayCastInput,
) -> b3CastOutput;
}
unsafe extern "C" {
#[doc = " Shape cast versus a sphere. Initial overlap is treated as a miss."]
pub fn b3ShapeCastSphere(
shape: *const b3Sphere,
input: *const b3ShapeCastInput,
) -> b3CastOutput;
}
unsafe extern "C" {
#[doc = " Shape cast versus a capsule. Initial overlap is treated as a miss."]
pub fn b3ShapeCastCapsule(
shape: *const b3Capsule,
input: *const b3ShapeCastInput,
) -> b3CastOutput;
}
unsafe extern "C" {
#[doc = " Shape cast versus compound. Initial overlap is treated as a miss."]
pub fn b3ShapeCastCompound(
shape: *const b3CompoundData,
input: *const b3ShapeCastInput,
) -> b3CastOutput;
}
unsafe extern "C" {
#[doc = " Shape cast versus a hull. Initial overlap is treated as a miss."]
pub fn b3ShapeCastHull(
shape: *const b3HullData,
input: *const b3ShapeCastInput,
) -> b3CastOutput;
}
unsafe extern "C" {
#[doc = " Shape cast versus a mesh. Initial overlap is treated as a miss."]
pub fn b3ShapeCastMesh(shape: *const b3Mesh, input: *const b3ShapeCastInput) -> b3CastOutput;
}
unsafe extern "C" {
#[doc = " Shape cast versus a height field. Initial overlap is treated as a miss."]
pub fn b3ShapeCastHeightField(
shape: *const b3HeightFieldData,
input: *const b3ShapeCastInput,
) -> b3CastOutput;
}
#[doc = " Query callback."]
pub type b3MeshQueryFcn = ::std::option::Option<
unsafe extern "C" fn(
a: b3Vec3,
b: b3Vec3,
c: b3Vec3,
triangleIndex: ::std::os::raw::c_int,
context: *mut ::std::os::raw::c_void,
) -> bool,
>;
unsafe extern "C" {
#[doc = " Query a mesh for triangles overlapping a bounding box in local space. May have false positives. Useful for debug draw.\n @param mesh the mesh to query, includes scale\n @param bounds the bounding box in local space\n @param fcn a user function to collect triangles\n @param context the context sent to the user function."]
pub fn b3QueryMesh(
mesh: *const b3Mesh,
bounds: b3AABB,
fcn: b3MeshQueryFcn,
context: *mut ::std::os::raw::c_void,
);
}
unsafe extern "C" {
#[doc = " Query a height field for triangles overlapping a bounding box in local space. May have false positives. Useful for debug draw.\n @param heightField the height field to query\n @param bounds the bounding box in local space\n @param fcn a user function to collect triangles\n @param context the context sent to the user function."]
pub fn b3QueryHeightField(
heightField: *const b3HeightFieldData,
bounds: b3AABB,
fcn: b3MeshQueryFcn,
context: *mut ::std::os::raw::c_void,
);
}
unsafe extern "C" {
#[doc = " Compute the closest points between two shapes represented as point clouds.\n b3SimplexCache cache is input/output. On the first call set b3SimplexCache.count to zero.\n The query runs in frame A, so the witness points and normal are returned in frame A.\n The underlying GJK algorithm may be debugged by passing in debug simplexes and capacity. You may pass in NULL and 0 for these."]
pub fn b3ShapeDistance(
input: *const b3DistanceInput,
cache: *mut b3SimplexCache,
simplexes: *mut b3Simplex,
simplexCapacity: ::std::os::raw::c_int,
) -> b3DistanceOutput;
}
unsafe extern "C" {
#[doc = " Perform a linear shape cast of shape B moving and shape A fixed. Determines the hit point, normal, and translation fraction.\n The query runs in frame A, so the hit point and normal are returned in frame A. Initially touching shapes are a miss."]
pub fn b3ShapeCast(input: *const b3ShapeCastPairInput) -> b3CastOutput;
}
unsafe extern "C" {
#[doc = " Evaluate the transform sweep at a specific time."]
pub fn b3GetSweepTransform(sweep: *const b3Sweep, time: f32) -> b3Transform;
}
unsafe extern "C" {
#[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."]
pub fn b3TimeOfImpact(input: *const b3TOIInput) -> b3TOIOutput;
}
unsafe extern "C" {
#[doc = " Collide two spheres."]
pub fn b3CollideSpheres(
manifold: *mut b3LocalManifold,
capacity: ::std::os::raw::c_int,
sphereA: *const b3Sphere,
sphereB: *const b3Sphere,
transformBtoA: b3Transform,
);
}
unsafe extern "C" {
#[doc = " Collide a capsule and a sphere."]
pub fn b3CollideCapsuleAndSphere(
manifold: *mut b3LocalManifold,
capacity: ::std::os::raw::c_int,
capsuleA: *const b3Capsule,
sphereB: *const b3Sphere,
transformBtoA: b3Transform,
);
}
unsafe extern "C" {
#[doc = " Collide a hull and a sphere."]
pub fn b3CollideHullAndSphere(
manifold: *mut b3LocalManifold,
capacity: ::std::os::raw::c_int,
hullA: *const b3HullData,
sphereB: *const b3Sphere,
transformBtoA: b3Transform,
cache: *mut b3SimplexCache,
);
}
unsafe extern "C" {
#[doc = " Collide two capsules."]
pub fn b3CollideCapsules(
manifold: *mut b3LocalManifold,
capacity: ::std::os::raw::c_int,
capsuleA: *const b3Capsule,
capsuleB: *const b3Capsule,
transformBtoA: b3Transform,
);
}
unsafe extern "C" {
#[doc = " Collide a hull and a capsule."]
pub fn b3CollideHullAndCapsule(
manifold: *mut b3LocalManifold,
capacity: ::std::os::raw::c_int,
hullA: *const b3HullData,
capsuleB: *const b3Capsule,
transformBtoA: b3Transform,
cache: *mut b3SimplexCache,
);
}
unsafe extern "C" {
#[doc = " Collide two hulls."]
pub fn b3CollideHulls(
manifold: *mut b3LocalManifold,
capacity: ::std::os::raw::c_int,
hullA: *const b3HullData,
hullB: *const b3HullData,
transformBtoA: b3Transform,
cache: *mut b3SATCache,
);
}
unsafe extern "C" {
#[doc = " Collide a capsule and a triangle."]
pub fn b3CollideCapsuleAndTriangle(
manifold: *mut b3LocalManifold,
capacity: ::std::os::raw::c_int,
capsuleA: *const b3Capsule,
triangleB: *const b3Vec3,
cache: *mut b3SimplexCache,
);
}
unsafe extern "C" {
#[doc = " Collide a hull and a triangle."]
pub fn b3CollideHullAndTriangle(
manifold: *mut b3LocalManifold,
capacity: ::std::os::raw::c_int,
hullA: *const b3HullData,
v1: b3Vec3,
v2: b3Vec3,
v3: b3Vec3,
triangleFlags: ::std::os::raw::c_int,
cache: *mut b3SATCache,
);
}
unsafe extern "C" {
#[doc = " Collide a sphere and a triangle."]
pub fn b3CollideSphereAndTriangle(
manifold: *mut b3LocalManifold,
capacity: ::std::os::raw::c_int,
sphereA: *const b3Sphere,
triangleB: *const b3Vec3,
);
}
unsafe extern "C" {
#[doc = " Solves the position of a mover that satisfies the given collision planes.\n @param targetDelta the desired translation from the position used to generate the collision planes\n @param planes the collision planes\n @param count the number of collision planes"]
pub fn b3SolvePlanes(
targetDelta: b3Vec3,
planes: *mut b3CollisionPlane,
count: ::std::os::raw::c_int,
) -> b3PlaneSolverResult;
}
unsafe extern "C" {
#[doc = " Clips the velocity against the given collision planes. Planes with zero push or clipVelocity\n set to false are skipped."]
pub fn b3ClipVector(
vector: b3Vec3,
planes: *const b3CollisionPlane,
count: ::std::os::raw::c_int,
) -> b3Vec3;
}
unsafe extern "C" {
#[doc = " Create a world for rigid body simulation. A world contains bodies, shapes, and constraints. You may create\n up to 128 worlds. Each world is completely independent and may be simulated in parallel.\n @return the world id."]
pub fn b3CreateWorld(def: *const b3WorldDef) -> b3WorldId;
}
unsafe extern "C" {
#[doc = " Destroy a world"]
pub fn b3DestroyWorld(worldId: b3WorldId);
}
unsafe extern "C" {
#[doc = " Get the current number of worlds"]
pub fn b3GetWorldCount() -> ::std::os::raw::c_int;
}
unsafe extern "C" {
#[doc = " Get the maximum number of simultaneous worlds that have been created"]
pub fn b3GetMaxWorldCount() -> ::std::os::raw::c_int;
}
unsafe extern "C" {
#[doc = " World id validation. Provides validation for up to 64K allocations."]
pub fn b3World_IsValid(id: b3WorldId) -> bool;
}
unsafe extern "C" {
#[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."]
pub fn b3World_Step(worldId: b3WorldId, timeStep: f32, subStepCount: ::std::os::raw::c_int);
}
unsafe extern "C" {
#[doc = " Call this to draw shapes and other debug draw data"]
pub fn b3World_Draw(worldId: b3WorldId, draw: *mut b3DebugDraw, maskBits: u64);
}
unsafe extern "C" {
#[doc = " Get the world's bounds. This is the bounding box that covers the current simulation. May have a small\n amount of padding."]
pub fn b3World_GetBounds(worldId: b3WorldId) -> b3AABB;
}
unsafe extern "C" {
#[doc = " Get the body events for the current time step. The event data is transient. Do not store a reference to this data."]
pub fn b3World_GetBodyEvents(worldId: b3WorldId) -> b3BodyEvents;
}
unsafe extern "C" {
#[doc = " Get sensor events for the current time step. The event data is transient. Do not store a reference to this data."]
pub fn b3World_GetSensorEvents(worldId: b3WorldId) -> b3SensorEvents;
}
unsafe extern "C" {
#[doc = " Get contact events for this current time step. The event data is transient. Do not store a reference to this data."]
pub fn b3World_GetContactEvents(worldId: b3WorldId) -> b3ContactEvents;
}
unsafe extern "C" {
#[doc = " Get the joint events for the current time step. The event data is transient. Do not store a reference to this data."]
pub fn b3World_GetJointEvents(worldId: b3WorldId) -> b3JointEvents;
}
unsafe extern "C" {
#[doc = " Overlap test for all shapes that *potentially* overlap the provided AABB"]
pub fn b3World_OverlapAABB(
worldId: b3WorldId,
aabb: b3AABB,
filter: b3QueryFilter,
fcn: b3OverlapResultFcn,
context: *mut ::std::os::raw::c_void,
) -> b3TreeStats;
}
unsafe extern "C" {
#[doc = " Overlap test for all shapes that overlap the provided shape proxy. The proxy points are relative\n to the world origin, which lets the query stay precise far from the world origin."]
pub fn b3World_OverlapShape(
worldId: b3WorldId,
origin: b3Pos,
proxy: *const b3ShapeProxy,
filter: b3QueryFilter,
fcn: b3OverlapResultFcn,
context: *mut ::std::os::raw::c_void,
) -> b3TreeStats;
}
unsafe extern "C" {
#[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"]
pub fn b3World_CastRay(
worldId: b3WorldId,
origin: b3Pos,
translation: b3Vec3,
filter: b3QueryFilter,
fcn: b3CastResultFcn,
context: *mut ::std::os::raw::c_void,
) -> b3TreeStats;
}
unsafe extern "C" {
#[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 b3World_CastRay() and does not allow for custom filtering."]
pub fn b3World_CastRayClosest(
worldId: b3WorldId,
origin: b3Pos,
translation: b3Vec3,
filter: b3QueryFilter,
) -> b3RayResult;
}
unsafe extern "C" {
#[doc = " Cast a shape through the world. Similar to a cast ray except that a shape is cast instead of a point.\n The proxy points are relative to the origin and the hit points come back as world positions, so the\n cast stays precise far from the world origin.\n\t@see b3World_CastRay"]
pub fn b3World_CastShape(
worldId: b3WorldId,
origin: b3Pos,
proxy: *const b3ShapeProxy,
translation: b3Vec3,
filter: b3QueryFilter,
fcn: b3CastResultFcn,
context: *mut ::std::os::raw::c_void,
) -> b3TreeStats;
}
unsafe extern "C" {
#[doc = " Cast a capsule mover through the world. This is a special shape cast that handles sliding along other shapes while reducing\n clipping. This is not a good source of information about what the mover is touching. Instead use the planes returned by\n b3World_CollideMover.\n @param worldId World to cast the mover against\n @param origin World position the mover capsule is relative to\n @param mover Capsule mover, relative to the origin\n @param translation Desired mover translation\n @param filter Contains bit flags to filter unwanted shapes from the results\n @param fcn Optional callback for custom shape filtering\n @param context A user context that is passed along to the callback function\n @return the translation fraction"]
pub fn b3World_CastMover(
worldId: b3WorldId,
origin: b3Pos,
mover: *const b3Capsule,
translation: b3Vec3,
filter: b3QueryFilter,
fcn: b3MoverFilterFcn,
context: *mut ::std::os::raw::c_void,
) -> f32;
}
unsafe extern "C" {
#[doc = " Collide a capsule mover with the world, gathering collision planes that can be fed to b3SolvePlanes. Useful for\n kinematic character movement. The mover and the returned planes are relative to the origin."]
pub fn b3World_CollideMover(
worldId: b3WorldId,
origin: b3Pos,
mover: *const b3Capsule,
filter: b3QueryFilter,
fcn: b3PlaneResultFcn,
context: *mut ::std::os::raw::c_void,
);
}
unsafe extern "C" {
#[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 b3WorldDef"]
pub fn b3World_EnableSleeping(worldId: b3WorldId, flag: bool);
}
unsafe extern "C" {
#[doc = " Is body sleeping enabled?"]
pub fn b3World_IsSleepingEnabled(worldId: b3WorldId) -> bool;
}
unsafe extern "C" {
#[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 b3WorldDef"]
pub fn b3World_EnableContinuous(worldId: b3WorldId, flag: bool);
}
unsafe extern "C" {
#[doc = " Is continuous collision enabled?"]
pub fn b3World_IsContinuousEnabled(worldId: b3WorldId) -> bool;
}
unsafe extern "C" {
#[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 b3WorldDef"]
pub fn b3World_SetRestitutionThreshold(worldId: b3WorldId, value: f32);
}
unsafe extern "C" {
#[doc = " Get the restitution speed threshold. Usually in meters per second."]
pub fn b3World_GetRestitutionThreshold(worldId: b3WorldId) -> f32;
}
unsafe extern "C" {
#[doc = " Adjust the hit event threshold. This controls the collision speed needed to generate a b3ContactHitEvent.\n Usually in meters per second.\n @see b3WorldDef::hitEventThreshold"]
pub fn b3World_SetHitEventThreshold(worldId: b3WorldId, value: f32);
}
unsafe extern "C" {
#[doc = " Get the hit event speed threshold. Usually in meters per second."]
pub fn b3World_GetHitEventThreshold(worldId: b3WorldId) -> f32;
}
unsafe extern "C" {
#[doc = " Register the custom filter callback. This is optional."]
pub fn b3World_SetCustomFilterCallback(
worldId: b3WorldId,
fcn: b3CustomFilterFcn,
context: *mut ::std::os::raw::c_void,
);
}
unsafe extern "C" {
#[doc = " Register the pre-solve callback. This is optional."]
pub fn b3World_SetPreSolveCallback(
worldId: b3WorldId,
fcn: b3PreSolveFcn,
context: *mut ::std::os::raw::c_void,
);
}
unsafe extern "C" {
#[doc = " Set the gravity vector for the entire world. Box3D 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 b3WorldDef"]
pub fn b3World_SetGravity(worldId: b3WorldId, gravity: b3Vec3);
}
unsafe extern "C" {
#[doc = " Get the gravity vector"]
pub fn b3World_GetGravity(worldId: b3WorldId) -> b3Vec3;
}
unsafe extern "C" {
#[doc = " Apply a radial explosion\n @param worldId The world id\n @param explosionDef The explosion definition"]
pub fn b3World_Explode(worldId: b3WorldId, explosionDef: *const b3ExplosionDef);
}
unsafe extern "C" {
#[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 contactSpeed The maximum contact constraint push out speed (meters per second)\n @note Advanced feature"]
pub fn b3World_SetContactTuning(
worldId: b3WorldId,
hertz: f32,
dampingRatio: f32,
contactSpeed: f32,
);
}
unsafe extern "C" {
#[doc = " Set the contact point recycling distance. Setting this to zero disables contact point recycling.\n Usually in meters."]
pub fn b3World_SetContactRecycleDistance(worldId: b3WorldId, recycleDistance: f32);
}
unsafe extern "C" {
#[doc = " Get the contact point recycling distance. Usually in meters."]
pub fn b3World_GetContactRecycleDistance(worldId: b3WorldId) -> f32;
}
unsafe extern "C" {
#[doc = " Set the maximum linear speed. Usually in m/s."]
pub fn b3World_SetMaximumLinearSpeed(worldId: b3WorldId, maximumLinearSpeed: f32);
}
unsafe extern "C" {
#[doc = " Get the maximum linear speed. Usually in m/s."]
pub fn b3World_GetMaximumLinearSpeed(worldId: b3WorldId) -> f32;
}
unsafe extern "C" {
#[doc = " Enable/disable constraint warm starting. Advanced feature for testing. Disabling\n warm starting greatly reduces stability and provides no performance gain."]
pub fn b3World_EnableWarmStarting(worldId: b3WorldId, flag: bool);
}
unsafe extern "C" {
#[doc = " Is constraint warm starting enabled?"]
pub fn b3World_IsWarmStartingEnabled(worldId: b3WorldId) -> bool;
}
unsafe extern "C" {
#[doc = " Get the number of awake bodies"]
pub fn b3World_GetAwakeBodyCount(worldId: b3WorldId) -> ::std::os::raw::c_int;
}
unsafe extern "C" {
#[doc = " Get the current world performance profile"]
pub fn b3World_GetProfile(worldId: b3WorldId) -> b3Profile;
}
unsafe extern "C" {
#[doc = " Get world counters and sizes"]
pub fn b3World_GetCounters(worldId: b3WorldId) -> b3Counters;
}
unsafe extern "C" {
#[doc = " Get max capacity. This can be used with b3WorldDef to avoid run-time allocations and copies"]
pub fn b3World_GetMaxCapacity(worldId: b3WorldId) -> b3Capacity;
}
unsafe extern "C" {
#[doc = " Set the user data pointer."]
pub fn b3World_SetUserData(worldId: b3WorldId, userData: *mut ::std::os::raw::c_void);
}
unsafe extern "C" {
#[doc = " Get the user data pointer."]
pub fn b3World_GetUserData(worldId: b3WorldId) -> *mut ::std::os::raw::c_void;
}
unsafe extern "C" {
#[doc = " Set the friction callback. Passing NULL resets to default."]
pub fn b3World_SetFrictionCallback(worldId: b3WorldId, callback: b3FrictionCallback);
}
unsafe extern "C" {
#[doc = " Set the restitution callback. Passing NULL resets to default."]
pub fn b3World_SetRestitutionCallback(worldId: b3WorldId, callback: b3RestitutionCallback);
}
unsafe extern "C" {
#[doc = " Set the worker count. Must be in the range [1, B3_MAX_WORKERS]"]
pub fn b3World_SetWorkerCount(worldId: b3WorldId, count: ::std::os::raw::c_int);
}
unsafe extern "C" {
#[doc = " Get the worker count."]
pub fn b3World_GetWorkerCount(worldId: b3WorldId) -> ::std::os::raw::c_int;
}
unsafe extern "C" {
#[doc = " Dump memory stats to log."]
pub fn b3World_DumpMemoryStats(worldId: b3WorldId);
}
unsafe extern "C" {
#[doc = " Dump shape bounds to box3d_bounds.txt"]
pub fn b3World_DumpShapeBounds(worldId: b3WorldId, type_: b3BodyType);
}
unsafe extern "C" {
#[doc = " This is for internal testing"]
pub fn b3World_RebuildStaticTree(worldId: b3WorldId);
}
unsafe extern "C" {
#[doc = " This is for internal testing"]
pub fn b3World_EnableSpeculative(worldId: b3WorldId, flag: bool);
}
unsafe extern "C" {
#[doc = " Dump world to a text file. Saves only awake bodies and associated static bodies.\n Meshes are saved to binary b3m files."]
pub fn b3World_DumpAwake(worldId: b3WorldId);
}
unsafe extern "C" {
#[doc = " Dump world to a text file. Meshes are saved to binary b3m files."]
pub fn b3World_Dump(worldId: b3WorldId);
}
#[repr(C)]
#[derive(Debug, Copy, Clone)]
pub struct b3Recording {
_unused: [u8; 0],
}
unsafe extern "C" {
#[doc = " Create a recording buffer with an optional initial byte capacity.\n Pass 0 to use the default (64 KiB). The buffer grows on demand.\n @return a new recording, owned by the caller"]
pub fn b3CreateRecording(byteCapacity: ::std::os::raw::c_int) -> *mut b3Recording;
}
unsafe extern "C" {
#[doc = " Destroy a recording and free its buffer.\n @param recording may be NULL"]
pub fn b3DestroyRecording(recording: *mut b3Recording);
}
unsafe extern "C" {
#[doc = " Get a pointer to the raw recording bytes.\n Valid until the recording buffer is modified or destroyed.\n @param recording the recording handle\n @return pointer to the byte buffer, or NULL if no bytes have been written"]
pub fn b3Recording_GetData(recording: *const b3Recording) -> *const u8;
}
unsafe extern "C" {
#[doc = " Get the number of bytes currently in the recording buffer.\n @param recording the recording handle"]
pub fn b3Recording_GetSize(recording: *const b3Recording) -> ::std::os::raw::c_int;
}
unsafe extern "C" {
#[doc = " Begin recording world mutations into the provided buffer.\n The buffer is reset on each call so a single b3Recording can be reused for multiple sessions.\n @param worldId the world to record\n @param recording the recording handle to write into"]
pub fn b3World_StartRecording(worldId: b3WorldId, recording: *mut b3Recording);
}
unsafe extern "C" {
#[doc = " End the current recording session. Writes the trailing geometry registry and\n backpatches the header. The buffer remains valid until the recording is destroyed.\n @param worldId the world currently being recorded"]
pub fn b3World_StopRecording(worldId: b3WorldId);
}
unsafe extern "C" {
#[doc = " Save the recording buffer to a file. Returns true on success.\n @param recording the recording to save\n @param path file path to write"]
pub fn b3SaveRecordingToFile(
recording: *const b3Recording,
path: *const ::std::os::raw::c_char,
) -> bool;
}
unsafe extern "C" {
#[doc = " Load a recording from a file. Returns NULL on failure (file not found, wrong magic).\n The caller owns the returned recording and must destroy it with b3DestroyRecording.\n @param path file path to read"]
pub fn b3LoadRecordingFromFile(path: *const ::std::os::raw::c_char) -> *mut b3Recording;
}
unsafe extern "C" {
#[doc = " Replay a recording from memory and verify it reproduces the same world-state hashes.\n Stands up a fresh world, restores the seed snapshot, replays every op, and checks each embedded\n StateHash record. Returns true if replay completed without id mismatches or hash divergences.\n @param data pointer to recording bytes\n @param size byte count of the recording\n @param workerCount reserved for future multithreaded replay; pass 1 for now"]
pub fn b3ValidateReplay(
data: *const ::std::os::raw::c_void,
size: ::std::os::raw::c_int,
workerCount: ::std::os::raw::c_int,
) -> bool;
}
#[repr(C)]
#[derive(Debug, Copy, Clone)]
pub struct b3RecPlayer {
_unused: [u8; 0],
}
#[doc = " Summary of a recording, read once at open so a viewer can frame and label it."]
#[repr(C)]
#[derive(Debug, Copy, Clone)]
pub struct b3RecPlayerInfo {
pub frameCount: ::std::os::raw::c_int,
pub workerCount: ::std::os::raw::c_int,
pub timeStep: f32,
pub subStepCount: ::std::os::raw::c_int,
pub lengthScale: f32,
pub bounds: b3AABB,
}
unsafe extern "C" {
#[doc = " Create a player over a recording. Owns a private copy of the bytes.\n @param data pointer to recording bytes\n @param size byte count of the recording\n @param workerCount worker count for the replay world; pass 1 to match a serial recording.\n Replaying at a different count re-partitions the constraint graph, so the StateHash check\n becomes a cross-thread determinism test. Adjustable later with b3RecPlayer_SetWorkerCount.\n @return a new player, or NULL on bad header or deserialization failure"]
pub fn b3RecPlayer_Create(
data: *const ::std::os::raw::c_void,
size: ::std::os::raw::c_int,
workerCount: ::std::os::raw::c_int,
) -> *mut b3RecPlayer;
}
unsafe extern "C" {
#[doc = " Destroy the player and free all memory. Restores the previous global length scale."]
pub fn b3RecPlayer_Destroy(player: *mut b3RecPlayer);
}
unsafe extern "C" {
#[doc = " Advance one frame: dispatch ops until the next Step completes.\n @return true when a frame was stepped, false at end-of-recording"]
pub fn b3RecPlayer_StepFrame(player: *mut b3RecPlayer) -> bool;
}
unsafe extern "C" {
#[doc = " Rewind to frame 0 (in-place restore so the world id stays stable)."]
pub fn b3RecPlayer_Restart(player: *mut b3RecPlayer);
}
unsafe extern "C" {
#[doc = " Seek to a specific frame. Forward seek steps op-by-op; backward seek restores\n the nearest keyframe then re-steps the remaining gap."]
pub fn b3RecPlayer_SeekFrame(player: *mut b3RecPlayer, targetFrame: ::std::os::raw::c_int);
}
unsafe extern "C" {
#[doc = " @return the world currently driven by this player"]
pub fn b3RecPlayer_GetWorldId(player: *const b3RecPlayer) -> b3WorldId;
}
unsafe extern "C" {
#[doc = " @return the last fully-stepped frame index (0 before any step)"]
pub fn b3RecPlayer_GetFrame(player: *const b3RecPlayer) -> ::std::os::raw::c_int;
}
unsafe extern "C" {
#[doc = " @return total number of recorded frames"]
pub fn b3RecPlayer_GetFrameCount(player: *const b3RecPlayer) -> ::std::os::raw::c_int;
}
unsafe extern "C" {
#[doc = " @return true when the op stream is exhausted"]
pub fn b3RecPlayer_IsAtEnd(player: *const b3RecPlayer) -> bool;
}
unsafe extern "C" {
#[doc = " @return true when any StateHash mismatch has been detected"]
pub fn b3RecPlayer_HasDiverged(player: *const b3RecPlayer) -> bool;
}
unsafe extern "C" {
#[doc = " @return a summary of the recording read at open: frame count, recorded tuning, and bounds"]
pub fn b3RecPlayer_GetInfo(player: *const b3RecPlayer) -> b3RecPlayerInfo;
}
unsafe extern "C" {
#[doc = " @return the first frame at which replay diverged, or -1 if it has not diverged"]
pub fn b3RecPlayer_GetDivergeFrame(player: *const b3RecPlayer) -> ::std::os::raw::c_int;
}
unsafe extern "C" {
#[doc = " Set the worker count of the replay world. Clamped to [1, B3_MAX_WORKERS]. Applied to the live\n world at once and reused whenever the player rebuilds its world on Restart or a backward seek.\n Replaying at a different count than recorded re-partitions the constraint graph, so the StateHash\n check becomes a cross-thread determinism test."]
pub fn b3RecPlayer_SetWorkerCount(player: *mut b3RecPlayer, count: ::std::os::raw::c_int);
}
unsafe extern "C" {
#[doc = " Tune the keyframe ring used to speed up backward seeking. A keyframe is a periodic snapshot the\n player restores from instead of replaying from the start, trading memory for seek speed.\n @param player the recording player\n @param budgetBytes memory cap for the kept snapshots; the spacing widens to stay under it\n @param minIntervalFrames finest spacing between keyframes, in frames\n A zero budget or a non-positive interval keeps that value. Clears the existing ring, so call\n b3RecPlayer_Restart afterward to repopulate it under the new policy."]
pub fn b3RecPlayer_SetKeyframePolicy(
player: *mut b3RecPlayer,
budgetBytes: usize,
minIntervalFrames: ::std::os::raw::c_int,
);
}
unsafe extern "C" {
#[doc = " @return the keyframe memory budget in bytes"]
pub fn b3RecPlayer_GetKeyframeBudget(player: *const b3RecPlayer) -> usize;
}
unsafe extern "C" {
#[doc = " @return the finest keyframe spacing in frames"]
pub fn b3RecPlayer_GetKeyframeMinInterval(player: *const b3RecPlayer) -> ::std::os::raw::c_int;
}
unsafe extern "C" {
#[doc = " @return the current keyframe spacing in frames; starts at the min interval and doubles as the\n ring evicts to stay under budget, so it reflects the effective backward-seek granularity now"]
pub fn b3RecPlayer_GetKeyframeInterval(player: *const b3RecPlayer) -> ::std::os::raw::c_int;
}
unsafe extern "C" {
#[doc = " @return the memory currently held by keyframe snapshots, in bytes"]
pub fn b3RecPlayer_GetKeyframeBytes(player: *const b3RecPlayer) -> usize;
}
unsafe extern "C" {
#[doc = " @return the number of bodies tracked in creation order (including holes for destroyed bodies)"]
pub fn b3RecPlayer_GetBodyCount(player: *const b3RecPlayer) -> ::std::os::raw::c_int;
}
unsafe extern "C" {
#[doc = " Resolve a creation ordinal to the live body id at the current frame.\n @return the body id, or a null id if that ordinal is out of range or its body is destroyed"]
pub fn b3RecPlayer_GetBodyId(
player: *const b3RecPlayer,
index: ::std::os::raw::c_int,
) -> b3BodyId;
}
unsafe extern "C" {
#[doc = " Wire host debug-shape callbacks into the player's replay world so a renderer can build\n per-shape draw resources (the 3D sample needs this or the replay world draws nothing).\n Rebuilds the current world under the new callbacks and rewinds to frame 0, so call it\n once right after b3RecPlayer_Create and re-read the world id afterward. The callbacks\n persist across Restart and backward seeks, which recreate the world internally.\n @param player the player to configure\n @param createDebugShape called when a replayed shape is added; returns a user draw handle\n @param destroyDebugShape called when a replayed shape is removed; may be NULL\n @param context user context passed to both callbacks"]
pub fn b3RecPlayer_SetDebugShapeCallbacks(
player: *mut b3RecPlayer,
createDebugShape: b3CreateDebugShapeCallback,
destroyDebugShape: b3DestroyDebugShapeCallback,
context: *mut ::std::os::raw::c_void,
);
}
unsafe extern "C" {
#[doc = " Draw the spatial queries recorded during the most recently replayed frame, layered on top of the\n world. Call after b3World_Draw. NULL draw function pointers are skipped.\n @param player a valid player handle\n @param draw debug draw callbacks\n @param queryIndex index of the frame query to draw, or -1 to draw all of them\n @param selectedIndex index of the query to emphasize (reserved color plus a label), or -1 for none"]
pub fn b3RecPlayer_DrawFrameQueries(
player: *mut b3RecPlayer,
draw: *mut b3DebugDraw,
queryIndex: ::std::os::raw::c_int,
selectedIndex: ::std::os::raw::c_int,
);
}
pub const b3RecQueryType_b3_recQueryOverlapAABB: b3RecQueryType = 0;
pub const b3RecQueryType_b3_recQueryOverlapShape: b3RecQueryType = 1;
pub const b3RecQueryType_b3_recQueryCastRay: b3RecQueryType = 2;
pub const b3RecQueryType_b3_recQueryCastShape: b3RecQueryType = 3;
pub const b3RecQueryType_b3_recQueryCastRayClosest: b3RecQueryType = 4;
pub const b3RecQueryType_b3_recQueryCastMover: b3RecQueryType = 5;
pub const b3RecQueryType_b3_recQueryCollideMover: b3RecQueryType = 6;
#[doc = " The kind of a recorded spatial query, matching the public query and cast functions."]
pub type b3RecQueryType = ::std::os::raw::c_int;
#[doc = " A spatial query recorded during a replayed frame, exposed for inspection."]
#[repr(C)]
#[derive(Debug, Copy, Clone)]
pub struct b3RecQueryInfo {
pub type_: b3RecQueryType,
pub filter: b3QueryFilter,
pub aabb: b3AABB,
pub origin: b3Pos,
pub translation: b3Vec3,
pub hitCount: ::std::os::raw::c_int,
pub key: u64,
pub id: u64,
pub name: *const ::std::os::raw::c_char,
}
#[doc = " One result of a recorded spatial query."]
#[repr(C)]
#[derive(Debug, Copy, Clone)]
pub struct b3RecQueryHit {
pub shape: b3ShapeId,
pub point: b3Pos,
pub normal: b3Vec3,
pub fraction: f32,
}
unsafe extern "C" {
#[doc = " @return the number of spatial queries recorded for the most recently replayed frame"]
pub fn b3RecPlayer_GetFrameQueryCount(player: *const b3RecPlayer) -> ::std::os::raw::c_int;
}
unsafe extern "C" {
#[doc = " Get a recorded query from the most recently replayed frame by index."]
pub fn b3RecPlayer_GetFrameQuery(
player: *const b3RecPlayer,
index: ::std::os::raw::c_int,
) -> b3RecQueryInfo;
}
unsafe extern "C" {
#[doc = " Get one result of a recorded query from the most recently replayed frame."]
pub fn b3RecPlayer_GetFrameQueryHit(
player: *const b3RecPlayer,
queryIndex: ::std::os::raw::c_int,
hitIndex: ::std::os::raw::c_int,
) -> b3RecQueryHit;
}
unsafe extern "C" {
#[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 b3BodyDef bodyDef = b3DefaultBodyDef();\n b3BodyId myBodyId = b3CreateBody(myWorldId, &bodyDef);\n @endcode\n @warning This function is locked during callbacks."]
pub fn b3CreateBody(worldId: b3WorldId, def: *const b3BodyDef) -> b3BodyId;
}
unsafe extern "C" {
#[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."]
pub fn b3DestroyBody(bodyId: b3BodyId);
}
unsafe extern "C" {
#[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."]
pub fn b3Body_IsValid(id: b3BodyId) -> bool;
}
unsafe extern "C" {
#[doc = " Get the body type: static, kinematic, or dynamic"]
pub fn b3Body_GetType(bodyId: b3BodyId) -> b3BodyType;
}
unsafe extern "C" {
#[doc = " Change the body type. This is an expensive operation. This automatically updates the mass\n properties regardless of the automatic mass setting."]
pub fn b3Body_SetType(bodyId: b3BodyId, type_: b3BodyType);
}
unsafe extern "C" {
#[doc = " Set the body name. Up to B3_BODY_NAME_LENGTH characters including null termination."]
pub fn b3Body_SetName(bodyId: b3BodyId, name: *const ::std::os::raw::c_char);
}
unsafe extern "C" {
#[doc = " Get the body name."]
pub fn b3Body_GetName(bodyId: b3BodyId) -> *const ::std::os::raw::c_char;
}
unsafe extern "C" {
#[doc = " Set the user data for a body"]
pub fn b3Body_SetUserData(bodyId: b3BodyId, userData: *mut ::std::os::raw::c_void);
}
unsafe extern "C" {
#[doc = " Get the user data stored in a body"]
pub fn b3Body_GetUserData(bodyId: b3BodyId) -> *mut ::std::os::raw::c_void;
}
unsafe extern "C" {
#[doc = " Get the world position of a body. This is the location of the body origin."]
pub fn b3Body_GetPosition(bodyId: b3BodyId) -> b3Pos;
}
unsafe extern "C" {
#[doc = " Get the world rotation of a body as a quaternion"]
pub fn b3Body_GetRotation(bodyId: b3BodyId) -> b3Quat;
}
unsafe extern "C" {
#[doc = " Get the world transform of a body."]
pub fn b3Body_GetTransform(bodyId: b3BodyId) -> b3WorldTransform;
}
unsafe extern "C" {
#[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 the intended transform.\n @see b3BodyDef::position and b3BodyDef::rotation"]
pub fn b3Body_SetTransform(bodyId: b3BodyId, position: b3Pos, rotation: b3Quat);
}
unsafe extern "C" {
#[doc = " Get a local point on a body given a world point"]
pub fn b3Body_GetLocalPoint(bodyId: b3BodyId, worldPoint: b3Pos) -> b3Vec3;
}
unsafe extern "C" {
#[doc = " Get a world point on a body given a local point"]
pub fn b3Body_GetWorldPoint(bodyId: b3BodyId, localPoint: b3Vec3) -> b3Pos;
}
unsafe extern "C" {
#[doc = " Get a local vector on a body given a world vector"]
pub fn b3Body_GetLocalVector(bodyId: b3BodyId, worldVector: b3Vec3) -> b3Vec3;
}
unsafe extern "C" {
#[doc = " Get a world vector on a body given a local vector"]
pub fn b3Body_GetWorldVector(bodyId: b3BodyId, localVector: b3Vec3) -> b3Vec3;
}
unsafe extern "C" {
#[doc = " Get the linear velocity of a body's center of mass. Usually in meters per second."]
pub fn b3Body_GetLinearVelocity(bodyId: b3BodyId) -> b3Vec3;
}
unsafe extern "C" {
#[doc = " Get the angular velocity of a body in radians per second"]
pub fn b3Body_GetAngularVelocity(bodyId: b3BodyId) -> b3Vec3;
}
unsafe extern "C" {
#[doc = " Set the linear velocity of a body. Usually in meters per second."]
pub fn b3Body_SetLinearVelocity(bodyId: b3BodyId, linearVelocity: b3Vec3);
}
unsafe extern "C" {
#[doc = " Set the angular velocity of a body in radians per second"]
pub fn b3Body_SetAngularVelocity(bodyId: b3BodyId, angularVelocity: b3Vec3);
}
unsafe extern "C" {
#[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 optionally wake the body if asleep, but only if the movement is significant."]
pub fn b3Body_SetTargetTransform(
bodyId: b3BodyId,
target: b3WorldTransform,
timeStep: f32,
wake: bool,
);
}
unsafe extern "C" {
#[doc = " Get the linear velocity of a local point attached to a body. Usually in meters per second."]
pub fn b3Body_GetLocalPointVelocity(bodyId: b3BodyId, localPoint: b3Vec3) -> b3Vec3;
}
unsafe extern "C" {
#[doc = " Get the linear velocity of a world point attached to a body. Usually in meters per second."]
pub fn b3Body_GetWorldPointVelocity(bodyId: b3BodyId, worldPoint: b3Pos) -> b3Vec3;
}
unsafe extern "C" {
#[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"]
pub fn b3Body_ApplyForce(bodyId: b3BodyId, force: b3Vec3, point: b3Pos, wake: bool);
}
unsafe extern "C" {
#[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"]
pub fn b3Body_ApplyForceToCenter(bodyId: b3BodyId, force: b3Vec3, wake: bool);
}
unsafe extern "C" {
#[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 the world torque vector, usually in N*m.\n @param wake also wake up the body"]
pub fn b3Body_ApplyTorque(bodyId: b3BodyId, torque: b3Vec3, wake: bool);
}
unsafe extern "C" {
#[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."]
pub fn b3Body_ApplyLinearImpulse(bodyId: b3BodyId, impulse: b3Vec3, point: b3Pos, wake: bool);
}
unsafe extern "C" {
#[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."]
pub fn b3Body_ApplyLinearImpulseToCenter(bodyId: b3BodyId, impulse: b3Vec3, wake: bool);
}
unsafe extern "C" {
#[doc = " Apply an angular impulse in world space. 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 world angular impulse vector, 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."]
pub fn b3Body_ApplyAngularImpulse(bodyId: b3BodyId, impulse: b3Vec3, wake: bool);
}
unsafe extern "C" {
#[doc = " Get the mass of the body, usually in kilograms"]
pub fn b3Body_GetMass(bodyId: b3BodyId) -> f32;
}
unsafe extern "C" {
#[doc = " Get the rotational inertia of the body in local space, usually in kg*m^2"]
pub fn b3Body_GetLocalRotationalInertia(bodyId: b3BodyId) -> b3Matrix3;
}
unsafe extern "C" {
#[doc = " Get the inverse mass of the body, usually in 1/kilograms"]
pub fn b3Body_GetInverseMass(bodyId: b3BodyId) -> f32;
}
unsafe extern "C" {
#[doc = " Get the inverse rotational inertia of the body in world space, usually in 1/kg*m^2"]
pub fn b3Body_GetWorldInverseRotationalInertia(bodyId: b3BodyId) -> b3Matrix3;
}
unsafe extern "C" {
#[doc = " Get the center of mass position of the body in local space"]
pub fn b3Body_GetLocalCenterOfMass(bodyId: b3BodyId) -> b3Vec3;
}
unsafe extern "C" {
#[doc = " Get the center of mass position of the body in world space"]
pub fn b3Body_GetWorldCenterOfMass(bodyId: b3BodyId) -> b3Pos;
}
unsafe extern "C" {
#[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."]
pub fn b3Body_SetMassData(bodyId: b3BodyId, massData: b3MassData);
}
unsafe extern "C" {
#[doc = " Get the mass data for a body"]
pub fn b3Body_GetMassData(bodyId: b3BodyId) -> b3MassData;
}
unsafe extern "C" {
#[doc = " This updates 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."]
pub fn b3Body_ApplyMassFromShapes(bodyId: b3BodyId);
}
unsafe extern "C" {
#[doc = " Adjust the linear damping. Normally this is set in b3BodyDef before creation."]
pub fn b3Body_SetLinearDamping(bodyId: b3BodyId, linearDamping: f32);
}
unsafe extern "C" {
#[doc = " Get the current linear damping."]
pub fn b3Body_GetLinearDamping(bodyId: b3BodyId) -> f32;
}
unsafe extern "C" {
#[doc = " Adjust the angular damping. Normally this is set in b3BodyDef before creation."]
pub fn b3Body_SetAngularDamping(bodyId: b3BodyId, angularDamping: f32);
}
unsafe extern "C" {
#[doc = " Get the current angular damping."]
pub fn b3Body_GetAngularDamping(bodyId: b3BodyId) -> f32;
}
unsafe extern "C" {
#[doc = " Adjust the gravity scale. Normally this is set in b3BodyDef before creation.\n @see b3BodyDef::gravityScale"]
pub fn b3Body_SetGravityScale(bodyId: b3BodyId, gravityScale: f32);
}
unsafe extern "C" {
#[doc = " Get the current gravity scale"]
pub fn b3Body_GetGravityScale(bodyId: b3BodyId) -> f32;
}
unsafe extern "C" {
#[doc = " @return true if this body is awake"]
pub fn b3Body_IsAwake(bodyId: b3BodyId) -> bool;
}
unsafe extern "C" {
#[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."]
pub fn b3Body_SetAwake(bodyId: b3BodyId, awake: bool);
}
unsafe extern "C" {
#[doc = " Enable or disable sleeping for this body. If sleeping is disabled the body will wake."]
pub fn b3Body_EnableSleep(bodyId: b3BodyId, enableSleep: bool);
}
unsafe extern "C" {
#[doc = " Returns true if sleeping is enabled for this body"]
pub fn b3Body_IsSleepEnabled(bodyId: b3BodyId) -> bool;
}
unsafe extern "C" {
#[doc = " Set the sleep threshold, usually in meters per second"]
pub fn b3Body_SetSleepThreshold(bodyId: b3BodyId, sleepThreshold: f32);
}
unsafe extern "C" {
#[doc = " Get the sleep threshold, usually in meters per second."]
pub fn b3Body_GetSleepThreshold(bodyId: b3BodyId) -> f32;
}
unsafe extern "C" {
#[doc = " Returns true if this body is enabled"]
pub fn b3Body_IsEnabled(bodyId: b3BodyId) -> bool;
}
unsafe extern "C" {
#[doc = " Disable a body by removing it completely from the simulation. This is expensive."]
pub fn b3Body_Disable(bodyId: b3BodyId);
}
unsafe extern "C" {
#[doc = " Enable a body by adding it to the simulation. This is expensive."]
pub fn b3Body_Enable(bodyId: b3BodyId);
}
unsafe extern "C" {
#[doc = " Set the motion locks on this body."]
pub fn b3Body_SetMotionLocks(bodyId: b3BodyId, locks: b3MotionLocks);
}
unsafe extern "C" {
#[doc = " Get the motion locks for this body."]
pub fn b3Body_GetMotionLocks(bodyId: b3BodyId) -> b3MotionLocks;
}
unsafe extern "C" {
#[doc = " Set this body to be a bullet. A bullet does continuous collision detection\n against dynamic bodies (but not other bullets)."]
pub fn b3Body_SetBullet(bodyId: b3BodyId, flag: bool);
}
unsafe extern "C" {
#[doc = " Is this body a bullet?"]
pub fn b3Body_IsBullet(bodyId: b3BodyId) -> bool;
}
unsafe extern "C" {
#[doc = " Enable or disable contact recycling for this body. Contact recycling is a performance optimization\n that reuses contact manifolds when bodies move slightly. Disabling it can avoid ghost collisions\n on characters at the cost of higher per-step work. Existing contacts retain their prior setting;\n only contacts created after this call see the new value.\n @see b3BodyDef::enableContactRecycling"]
pub fn b3Body_EnableContactRecycling(bodyId: b3BodyId, flag: bool);
}
unsafe extern "C" {
#[doc = " Is contact recycling enabled on this body?"]
pub fn b3Body_IsContactRecyclingEnabled(bodyId: b3BodyId) -> bool;
}
unsafe extern "C" {
#[doc = " Enable/disable hit events on all shapes\n @see b3ShapeDef::enableHitEvents"]
pub fn b3Body_EnableHitEvents(bodyId: b3BodyId, enableHitEvents: bool);
}
unsafe extern "C" {
#[doc = " Get the world that owns this body"]
pub fn b3Body_GetWorld(bodyId: b3BodyId) -> b3WorldId;
}
unsafe extern "C" {
#[doc = " Get the number of shapes on this body"]
pub fn b3Body_GetShapeCount(bodyId: b3BodyId) -> ::std::os::raw::c_int;
}
unsafe extern "C" {
#[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"]
pub fn b3Body_GetShapes(
bodyId: b3BodyId,
shapeArray: *mut b3ShapeId,
capacity: ::std::os::raw::c_int,
) -> ::std::os::raw::c_int;
}
unsafe extern "C" {
#[doc = " Get the number of joints on this body"]
pub fn b3Body_GetJointCount(bodyId: b3BodyId) -> ::std::os::raw::c_int;
}
unsafe extern "C" {
#[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"]
pub fn b3Body_GetJoints(
bodyId: b3BodyId,
jointArray: *mut b3JointId,
capacity: ::std::os::raw::c_int,
) -> ::std::os::raw::c_int;
}
unsafe extern "C" {
#[doc = " Get the maximum capacity required for retrieving all the touching contacts on a body"]
pub fn b3Body_GetContactCapacity(bodyId: b3BodyId) -> ::std::os::raw::c_int;
}
unsafe extern "C" {
#[doc = " Get the touching contact data for a body"]
pub fn b3Body_GetContactData(
bodyId: b3BodyId,
contactData: *mut b3ContactData,
capacity: ::std::os::raw::c_int,
) -> ::std::os::raw::c_int;
}
unsafe extern "C" {
#[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."]
pub fn b3Body_ComputeAABB(bodyId: b3BodyId) -> b3AABB;
}
unsafe extern "C" {
#[doc = " Get the closest point on a body to a world target."]
pub fn b3Body_GetClosestPoint(bodyId: b3BodyId, result: *mut b3Vec3, target: b3Vec3) -> f32;
}
unsafe extern "C" {
#[doc = " Cast a ray at a specific body using a specified body transform."]
pub fn b3Body_CastRay(
bodyId: b3BodyId,
origin: b3Pos,
translation: b3Vec3,
filter: b3QueryFilter,
maxFraction: f32,
bodyTransform: b3WorldTransform,
) -> b3BodyCastResult;
}
unsafe extern "C" {
#[doc = " Cast a shape at a specific body using a specified body transform."]
pub fn b3Body_CastShape(
bodyId: b3BodyId,
origin: b3Pos,
proxy: *const b3ShapeProxy,
translation: b3Vec3,
filter: b3QueryFilter,
maxFraction: f32,
canEncroach: bool,
bodyTransform: b3WorldTransform,
) -> b3BodyCastResult;
}
unsafe extern "C" {
#[doc = " Overlap a shape with a specific body using a specified body transform."]
pub fn b3Body_OverlapShape(
bodyId: b3BodyId,
origin: b3Pos,
proxy: *const b3ShapeProxy,
filter: b3QueryFilter,
bodyTransform: b3WorldTransform,
) -> bool;
}
unsafe extern "C" {
#[doc = " Collide a character mover with a specific body using a specified body transform."]
pub fn b3Body_CollideMover(
bodyId: b3BodyId,
bodyPlanes: *mut b3BodyPlaneResult,
planeCapacity: ::std::os::raw::c_int,
origin: b3Pos,
mover: *const b3Capsule,
filter: b3QueryFilter,
bodyTransform: b3WorldTransform,
) -> ::std::os::raw::c_int;
}
unsafe extern "C" {
#[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"]
pub fn b3CreateSphereShape(
bodyId: b3BodyId,
def: *const b3ShapeDef,
sphere: *const b3Sphere,
) -> b3ShapeId;
}
unsafe extern "C" {
#[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"]
pub fn b3CreateCapsuleShape(
bodyId: b3BodyId,
def: *const b3ShapeDef,
capsule: *const b3Capsule,
) -> b3ShapeId;
}
unsafe extern "C" {
#[doc = " Create a convex hull shape and attach it to a body. The shape definition is fully cloned. Contacts are not created\n until the next time step.\n @return the shape id for accessing the shape"]
pub fn b3CreateHullShape(
bodyId: b3BodyId,
def: *const b3ShapeDef,
hull: *const b3HullData,
) -> b3ShapeId;
}
unsafe extern "C" {
#[doc = " Create a convex hull shape and attach it to a body. The hull is cloned then transformed with scale applied first.\n Use this for non-uniform or mirrored scale or a baked local transform. The baked result is shared through the\n world hull database. The shape definition and geometry are fully cloned. Contacts are not created until the next time step.\n @return the shape id for accessing the shape"]
pub fn b3CreateTransformedHullShape(
bodyId: b3BodyId,
def: *const b3ShapeDef,
hull: *const b3HullData,
transform: b3Transform,
scale: b3Vec3,
) -> b3ShapeId;
}
unsafe extern "C" {
#[doc = " Create a mesh hull shape and attach it to a body. The shape definition is fully cloned but the mesh is not.\n Contacts are not created until the next time step.\n Mesh collision only creates contacts on static bodies.\n @warning this holds reference to the input mesh data which must remain valid for the lifetime of this shape\n @return the shape id for accessing the shape"]
pub fn b3CreateMeshShape(
bodyId: b3BodyId,
def: *const b3ShapeDef,
mesh: *const b3MeshData,
scale: b3Vec3,
) -> b3ShapeId;
}
unsafe extern "C" {
#[doc = " Create a height-field shape and attach it to a body. The shape definition is fully cloned but the height field is not.\n Contacts are not created until the next time step.\n Height field is only allowed on static bodies.\n @warning this holds reference to the input height field which must remain valid for the lifetime of this shape\n @return the shape id for accessing the shape"]
pub fn b3CreateHeightFieldShape(
bodyId: b3BodyId,
def: *const b3ShapeDef,
heightField: *const b3HeightFieldData,
) -> b3ShapeId;
}
unsafe extern "C" {
#[doc = " Compound shapes are only allowed on static bodies."]
pub fn b3CreateCompoundShape(
bodyId: b3BodyId,
def: *mut b3ShapeDef,
compound: *const b3CompoundData,
) -> b3ShapeId;
}
unsafe extern "C" {
#[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 b3Body_ApplyMassFromShapes"]
pub fn b3DestroyShape(shapeId: b3ShapeId, updateBodyMass: bool);
}
unsafe extern "C" {
#[doc = " Shape identifier validation. Provides validation for up to 64K allocations."]
pub fn b3Shape_IsValid(id: b3ShapeId) -> bool;
}
unsafe extern "C" {
#[doc = " Get the type of a shape"]
pub fn b3Shape_GetType(shapeId: b3ShapeId) -> b3ShapeType;
}
unsafe extern "C" {
#[doc = " Get the id of the body that a shape is attached to"]
pub fn b3Shape_GetBody(shapeId: b3ShapeId) -> b3BodyId;
}
unsafe extern "C" {
#[doc = " Get the world that owns this shape"]
pub fn b3Shape_GetWorld(shapeId: b3ShapeId) -> b3WorldId;
}
unsafe extern "C" {
#[doc = " Returns true if the shape is a sensor"]
pub fn b3Shape_IsSensor(shapeId: b3ShapeId) -> bool;
}
unsafe extern "C" {
#[doc = " Set the user data for a shape"]
pub fn b3Shape_SetUserData(shapeId: b3ShapeId, userData: *mut ::std::os::raw::c_void);
}
unsafe extern "C" {
#[doc = " Get the user data for a shape. This is useful when you get a shape id\n from an event or query."]
pub fn b3Shape_GetUserData(shapeId: b3ShapeId) -> *mut ::std::os::raw::c_void;
}
unsafe extern "C" {
#[doc = " Set the mass density of a shape, usually in kg/m^3.\n This will optionally update the mass properties on the parent body.\n @see b3ShapeDef::density, b3Body_ApplyMassFromShapes"]
pub fn b3Shape_SetDensity(shapeId: b3ShapeId, density: f32, updateBodyMass: bool);
}
unsafe extern "C" {
#[doc = " Get the density of a shape, usually in kg/m^3"]
pub fn b3Shape_GetDensity(shapeId: b3ShapeId) -> f32;
}
unsafe extern "C" {
#[doc = " Set the friction on a shape"]
pub fn b3Shape_SetFriction(shapeId: b3ShapeId, friction: f32);
}
unsafe extern "C" {
#[doc = " Get the friction of a shape"]
pub fn b3Shape_GetFriction(shapeId: b3ShapeId) -> f32;
}
unsafe extern "C" {
#[doc = " Set the shape restitution (bounciness)"]
pub fn b3Shape_SetRestitution(shapeId: b3ShapeId, restitution: f32);
}
unsafe extern "C" {
#[doc = " Get the shape restitution"]
pub fn b3Shape_GetRestitution(shapeId: b3ShapeId) -> f32;
}
unsafe extern "C" {
#[doc = " Set the shape base surface material. Does not change per triangle materials."]
pub fn b3Shape_SetSurfaceMaterial(shapeId: b3ShapeId, surfaceMaterial: b3SurfaceMaterial);
}
unsafe extern "C" {
#[doc = " Get the base shape surface material."]
pub fn b3Shape_GetSurfaceMaterial(shapeId: b3ShapeId) -> b3SurfaceMaterial;
}
unsafe extern "C" {
#[doc = " Get the number of mesh surface materials."]
pub fn b3Shape_GetMeshMaterialCount(shapeId: b3ShapeId) -> ::std::os::raw::c_int;
}
unsafe extern "C" {
#[doc = " Set a surface material for a mesh shape."]
pub fn b3Shape_SetMeshMaterial(
shapeId: b3ShapeId,
surfaceMaterial: b3SurfaceMaterial,
index: ::std::os::raw::c_int,
);
}
unsafe extern "C" {
#[doc = " Get a surface material for a mesh shape"]
pub fn b3Shape_GetMeshSurfaceMaterial(
shapeId: b3ShapeId,
index: ::std::os::raw::c_int,
) -> b3SurfaceMaterial;
}
unsafe extern "C" {
#[doc = " Get the shape filter"]
pub fn b3Shape_GetFilter(shapeId: b3ShapeId) -> b3Filter;
}
unsafe extern "C" {
#[doc = " Set the current filter. This is almost as expensive as recreating the shape.\n @see b3ShapeDef::filter\n @param shapeId the shape\n @param filter the new filter\n @param invokeContacts if true then the shape will have all contacts recomputed the next time step (expensive)"]
pub fn b3Shape_SetFilter(shapeId: b3ShapeId, filter: b3Filter, invokeContacts: bool);
}
unsafe extern "C" {
#[doc = " Enable sensor events for this shape. Only applies to kinematic and dynamic bodies. Ignored for sensors.\n @see b3ShapeDef::isSensor"]
pub fn b3Shape_EnableSensorEvents(shapeId: b3ShapeId, flag: bool);
}
unsafe extern "C" {
#[doc = " Returns true if sensor events are enabled"]
pub fn b3Shape_AreSensorEventsEnabled(shapeId: b3ShapeId) -> bool;
}
unsafe extern "C" {
#[doc = " Enable contact events for this shape. Only applies to kinematic and dynamic bodies. Ignored for sensors.\n @see b3ShapeDef::enableContactEvents"]
pub fn b3Shape_EnableContactEvents(shapeId: b3ShapeId, flag: bool);
}
unsafe extern "C" {
#[doc = " Returns true if contact events are enabled"]
pub fn b3Shape_AreContactEventsEnabled(shapeId: b3ShapeId) -> bool;
}
unsafe extern "C" {
#[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 b3PreSolveFcn"]
pub fn b3Shape_EnablePreSolveEvents(shapeId: b3ShapeId, flag: bool);
}
unsafe extern "C" {
#[doc = " Returns true if pre-solve events are enabled"]
pub fn b3Shape_ArePreSolveEventsEnabled(shapeId: b3ShapeId) -> bool;
}
unsafe extern "C" {
#[doc = " Enable contact hit events for this shape. Ignored for sensors.\n @see b3WorldDef.hitEventThreshold"]
pub fn b3Shape_EnableHitEvents(shapeId: b3ShapeId, flag: bool);
}
unsafe extern "C" {
#[doc = " Returns true if hit events are enabled"]
pub fn b3Shape_AreHitEventsEnabled(shapeId: b3ShapeId) -> bool;
}
unsafe extern "C" {
#[doc = " Ray cast a shape directly. The ray runs from origin to origin + translation and the hit point\n comes back as a world position, so the cast stays precise far from the world origin."]
pub fn b3Shape_RayCast(
shapeId: b3ShapeId,
origin: b3Pos,
translation: b3Vec3,
) -> b3WorldCastOutput;
}
unsafe extern "C" {
#[doc = " Get a copy of the shape's sphere. Asserts the type is correct."]
pub fn b3Shape_GetSphere(shapeId: b3ShapeId) -> b3Sphere;
}
unsafe extern "C" {
#[doc = " Get a copy of the shape's capsule. Asserts the type is correct."]
pub fn b3Shape_GetCapsule(shapeId: b3ShapeId) -> b3Capsule;
}
unsafe extern "C" {
#[doc = " Get the shape's convex hull. Asserts the type is correct."]
pub fn b3Shape_GetHull(shapeId: b3ShapeId) -> *const b3HullData;
}
unsafe extern "C" {
#[doc = " Get the shape's mesh. Asserts the type is correct."]
pub fn b3Shape_GetMesh(shapeId: b3ShapeId) -> b3Mesh;
}
unsafe extern "C" {
#[doc = " Get the shape's height field. Asserts the type is correct."]
pub fn b3Shape_GetHeightField(shapeId: b3ShapeId) -> *const b3HeightFieldData;
}
unsafe extern "C" {
#[doc = " Allows you to change a shape to be a sphere or update the current sphere.\n This does not modify the mass properties.\n @see b3Body_ApplyMassFromShapes"]
pub fn b3Shape_SetSphere(shapeId: b3ShapeId, sphere: *const b3Sphere);
}
unsafe extern "C" {
#[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 b3Body_ApplyMassFromShapes"]
pub fn b3Shape_SetCapsule(shapeId: b3ShapeId, capsule: *const b3Capsule);
}
unsafe extern "C" {
#[doc = " Allows you to change a shape to be a hull or update the current hull.\n This does not modify the mass properties.\n @see b3Body_ApplyMassFromShapes"]
pub fn b3Shape_SetHull(shapeId: b3ShapeId, hull: *const b3HullData);
}
unsafe extern "C" {
#[doc = " Allows you to change a shape to be a mesh or update the current mesh.\n This does not modify the mass properties.\n @see b3Body_ApplyMassFromShapes"]
pub fn b3Shape_SetMesh(shapeId: b3ShapeId, meshData: *const b3MeshData, scale: b3Vec3);
}
unsafe extern "C" {
#[doc = " Get the maximum capacity required for retrieving all the touching contacts on a shape"]
pub fn b3Shape_GetContactCapacity(shapeId: b3ShapeId) -> ::std::os::raw::c_int;
}
unsafe extern "C" {
#[doc = " Get the touching contact data for a shape. The provided shapeId will be either shapeIdA or shapeIdB on the contact data.\n @note Box3D 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"]
pub fn b3Shape_GetContactData(
shapeId: b3ShapeId,
contactData: *mut b3ContactData,
capacity: ::std::os::raw::c_int,
) -> ::std::os::raw::c_int;
}
unsafe extern "C" {
#[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 b3Shape_GetSensorOverlaps"]
pub fn b3Shape_GetSensorCapacity(shapeId: b3ShapeId) -> ::std::os::raw::c_int;
}
unsafe extern "C" {
#[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 b3Shape_IsValid to confirm each overlap"]
pub fn b3Shape_GetSensorData(
shapeId: b3ShapeId,
visitorIds: *mut b3ShapeId,
capacity: ::std::os::raw::c_int,
) -> ::std::os::raw::c_int;
}
unsafe extern "C" {
#[doc = " Get the current world AABB"]
pub fn b3Shape_GetAABB(shapeId: b3ShapeId) -> b3AABB;
}
unsafe extern "C" {
#[doc = " Compute the mass data for a shape"]
pub fn b3Shape_ComputeMassData(shapeId: b3ShapeId) -> b3MassData;
}
unsafe extern "C" {
#[doc = " Get the closest point on a shape to a target point. Target and result are in world space."]
pub fn b3Shape_GetClosestPoint(shapeId: b3ShapeId, target: b3Vec3) -> b3Vec3;
}
unsafe extern "C" {
#[doc = " Apply a wind force to the body for this shape using the density of air. This considers\n the projected area of the shape in the wind direction. This also considers\n the relative velocity of the shape.\n @param shapeId the shape id\n @param wind the wind velocity in world space\n @param drag the drag coefficient, the force that opposes the relative velocity\n @param lift the lift coefficient, the force that is perpendicular to the relative velocity\n @param maxSpeed the maximum relative speed. Speed cap is necessary for stability. Typically 10m/s or less.\n @param wake should this wake the body"]
pub fn b3Shape_ApplyWind(
shapeId: b3ShapeId,
wind: b3Vec3,
drag: f32,
lift: f32,
maxSpeed: f32,
wake: bool,
);
}
unsafe extern "C" {
#[doc = " Destroy a joint"]
pub fn b3DestroyJoint(jointId: b3JointId, wakeAttached: bool);
}
unsafe extern "C" {
#[doc = " Joint identifier validation. Provides validation for up to 64K allocations."]
pub fn b3Joint_IsValid(id: b3JointId) -> bool;
}
unsafe extern "C" {
#[doc = " Get the joint type"]
pub fn b3Joint_GetType(jointId: b3JointId) -> b3JointType;
}
unsafe extern "C" {
#[doc = " Get body A id on a joint"]
pub fn b3Joint_GetBodyA(jointId: b3JointId) -> b3BodyId;
}
unsafe extern "C" {
#[doc = " Get body B id on a joint"]
pub fn b3Joint_GetBodyB(jointId: b3JointId) -> b3BodyId;
}
unsafe extern "C" {
#[doc = " Get the world that owns this joint"]
pub fn b3Joint_GetWorld(jointId: b3JointId) -> b3WorldId;
}
unsafe extern "C" {
#[doc = " Set the local frame on bodyA"]
pub fn b3Joint_SetLocalFrameA(jointId: b3JointId, localFrame: b3Transform);
}
unsafe extern "C" {
#[doc = " Get the local frame on bodyA"]
pub fn b3Joint_GetLocalFrameA(jointId: b3JointId) -> b3Transform;
}
unsafe extern "C" {
#[doc = " Set the local frame on bodyB"]
pub fn b3Joint_SetLocalFrameB(jointId: b3JointId, localFrame: b3Transform);
}
unsafe extern "C" {
#[doc = " Get the local frame on bodyB"]
pub fn b3Joint_GetLocalFrameB(jointId: b3JointId) -> b3Transform;
}
unsafe extern "C" {
#[doc = " Toggle collision between connected bodies"]
pub fn b3Joint_SetCollideConnected(jointId: b3JointId, shouldCollide: bool);
}
unsafe extern "C" {
#[doc = " Is collision allowed between connected bodies?"]
pub fn b3Joint_GetCollideConnected(jointId: b3JointId) -> bool;
}
unsafe extern "C" {
#[doc = " Set the user data on a joint"]
pub fn b3Joint_SetUserData(jointId: b3JointId, userData: *mut ::std::os::raw::c_void);
}
unsafe extern "C" {
#[doc = " Get the user data on a joint"]
pub fn b3Joint_GetUserData(jointId: b3JointId) -> *mut ::std::os::raw::c_void;
}
unsafe extern "C" {
#[doc = " Wake the bodies connect to this joint"]
pub fn b3Joint_WakeBodies(jointId: b3JointId);
}
unsafe extern "C" {
#[doc = " Get the current constraint force for this joint"]
pub fn b3Joint_GetConstraintForce(jointId: b3JointId) -> b3Vec3;
}
unsafe extern "C" {
#[doc = " Get the current constraint torque for this joint"]
pub fn b3Joint_GetConstraintTorque(jointId: b3JointId) -> b3Vec3;
}
unsafe extern "C" {
#[doc = " Get the current linear separation error for this joint. Does not consider admissible movement. Usually in meters."]
pub fn b3Joint_GetLinearSeparation(jointId: b3JointId) -> f32;
}
unsafe extern "C" {
#[doc = " Get the current angular separation error for this joint. Does not consider admissible movement. Usually in radians."]
pub fn b3Joint_GetAngularSeparation(jointId: b3JointId) -> f32;
}
unsafe extern "C" {
#[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)"]
pub fn b3Joint_SetConstraintTuning(jointId: b3JointId, hertz: f32, dampingRatio: f32);
}
unsafe extern "C" {
#[doc = " Get the joint constraint tuning. Advanced feature."]
pub fn b3Joint_GetConstraintTuning(jointId: b3JointId, hertz: *mut f32, dampingRatio: *mut f32);
}
unsafe extern "C" {
#[doc = " Set the force threshold for joint events (Newtons)"]
pub fn b3Joint_SetForceThreshold(jointId: b3JointId, threshold: f32);
}
unsafe extern "C" {
#[doc = " Get the force threshold for joint events (Newtons)"]
pub fn b3Joint_GetForceThreshold(jointId: b3JointId) -> f32;
}
unsafe extern "C" {
#[doc = " Set the torque threshold for joint events (N-m)"]
pub fn b3Joint_SetTorqueThreshold(jointId: b3JointId, threshold: f32);
}
unsafe extern "C" {
#[doc = " Get the torque threshold for joint events (N-m)"]
pub fn b3Joint_GetTorqueThreshold(jointId: b3JointId) -> f32;
}
unsafe extern "C" {
#[doc = " Create a parallel joint\n @see b3ParallelJointDef for details"]
pub fn b3CreateParallelJoint(worldId: b3WorldId, def: *const b3ParallelJointDef) -> b3JointId;
}
unsafe extern "C" {
#[doc = " Set the spring stiffness in Hertz"]
pub fn b3ParallelJoint_SetSpringHertz(jointId: b3JointId, hertz: f32);
}
unsafe extern "C" {
#[doc = " Set the spring damping ratio, non-dimensional"]
pub fn b3ParallelJoint_SetSpringDampingRatio(jointId: b3JointId, dampingRatio: f32);
}
unsafe extern "C" {
#[doc = " Get the spring Hertz"]
pub fn b3ParallelJoint_GetSpringHertz(jointId: b3JointId) -> f32;
}
unsafe extern "C" {
#[doc = " Get the spring damping ratio"]
pub fn b3ParallelJoint_GetSpringDampingRatio(jointId: b3JointId) -> f32;
}
unsafe extern "C" {
#[doc = " Set the maximum spring torque, usually in newton-meters"]
pub fn b3ParallelJoint_SetMaxTorque(jointId: b3JointId, force: f32);
}
unsafe extern "C" {
#[doc = " Get the maximum spring torque, usually in newton-meters"]
pub fn b3ParallelJoint_GetMaxTorque(jointId: b3JointId) -> f32;
}
unsafe extern "C" {
#[doc = " Create a distance joint\n @see b3DistanceJointDef for details"]
pub fn b3CreateDistanceJoint(worldId: b3WorldId, def: *const b3DistanceJointDef) -> b3JointId;
}
unsafe extern "C" {
#[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"]
pub fn b3DistanceJoint_SetLength(jointId: b3JointId, length: f32);
}
unsafe extern "C" {
#[doc = " Get the rest length of a distance joint"]
pub fn b3DistanceJoint_GetLength(jointId: b3JointId) -> f32;
}
unsafe extern "C" {
#[doc = " Enable/disable the distance joint spring. When disabled the distance joint is rigid."]
pub fn b3DistanceJoint_EnableSpring(jointId: b3JointId, enableSpring: bool);
}
unsafe extern "C" {
#[doc = " Is the distance joint spring enabled?"]
pub fn b3DistanceJoint_IsSpringEnabled(jointId: b3JointId) -> bool;
}
unsafe extern "C" {
#[doc = " Set the force range for the spring."]
pub fn b3DistanceJoint_SetSpringForceRange(
jointId: b3JointId,
lowerForce: f32,
upperForce: f32,
);
}
unsafe extern "C" {
#[doc = " Get the force range for the spring."]
pub fn b3DistanceJoint_GetSpringForceRange(
jointId: b3JointId,
lowerForce: *mut f32,
upperForce: *mut f32,
);
}
unsafe extern "C" {
#[doc = " Set the spring stiffness in Hertz"]
pub fn b3DistanceJoint_SetSpringHertz(jointId: b3JointId, hertz: f32);
}
unsafe extern "C" {
#[doc = " Set the spring damping ratio, non-dimensional"]
pub fn b3DistanceJoint_SetSpringDampingRatio(jointId: b3JointId, dampingRatio: f32);
}
unsafe extern "C" {
#[doc = " Get the spring Hertz"]
pub fn b3DistanceJoint_GetSpringHertz(jointId: b3JointId) -> f32;
}
unsafe extern "C" {
#[doc = " Get the spring damping ratio"]
pub fn b3DistanceJoint_GetSpringDampingRatio(jointId: b3JointId) -> f32;
}
unsafe extern "C" {
#[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."]
pub fn b3DistanceJoint_EnableLimit(jointId: b3JointId, enableLimit: bool);
}
unsafe extern "C" {
#[doc = " Is the distance joint limit enabled?"]
pub fn b3DistanceJoint_IsLimitEnabled(jointId: b3JointId) -> bool;
}
unsafe extern "C" {
#[doc = " Set the minimum and maximum length parameters of a distance joint"]
pub fn b3DistanceJoint_SetLengthRange(jointId: b3JointId, minLength: f32, maxLength: f32);
}
unsafe extern "C" {
#[doc = " Get the distance joint minimum length"]
pub fn b3DistanceJoint_GetMinLength(jointId: b3JointId) -> f32;
}
unsafe extern "C" {
#[doc = " Get the distance joint maximum length"]
pub fn b3DistanceJoint_GetMaxLength(jointId: b3JointId) -> f32;
}
unsafe extern "C" {
#[doc = " Get the current length of a distance joint"]
pub fn b3DistanceJoint_GetCurrentLength(jointId: b3JointId) -> f32;
}
unsafe extern "C" {
#[doc = " Enable/disable the distance joint motor"]
pub fn b3DistanceJoint_EnableMotor(jointId: b3JointId, enableMotor: bool);
}
unsafe extern "C" {
#[doc = " Is the distance joint motor enabled?"]
pub fn b3DistanceJoint_IsMotorEnabled(jointId: b3JointId) -> bool;
}
unsafe extern "C" {
#[doc = " Set the distance joint motor speed, usually in meters per second"]
pub fn b3DistanceJoint_SetMotorSpeed(jointId: b3JointId, motorSpeed: f32);
}
unsafe extern "C" {
#[doc = " Get the distance joint motor speed, usually in meters per second"]
pub fn b3DistanceJoint_GetMotorSpeed(jointId: b3JointId) -> f32;
}
unsafe extern "C" {
#[doc = " Set the distance joint maximum motor force, usually in newtons"]
pub fn b3DistanceJoint_SetMaxMotorForce(jointId: b3JointId, force: f32);
}
unsafe extern "C" {
#[doc = " Get the distance joint maximum motor force, usually in newtons"]
pub fn b3DistanceJoint_GetMaxMotorForce(jointId: b3JointId) -> f32;
}
unsafe extern "C" {
#[doc = " Get the distance joint current motor force, usually in newtons"]
pub fn b3DistanceJoint_GetMotorForce(jointId: b3JointId) -> f32;
}
unsafe extern "C" {
#[doc = " Create a motor joint\n @see b3MotorJointDef for details"]
pub fn b3CreateMotorJoint(worldId: b3WorldId, def: *const b3MotorJointDef) -> b3JointId;
}
unsafe extern "C" {
#[doc = " Set the desired relative linear velocity in meters per second"]
pub fn b3MotorJoint_SetLinearVelocity(jointId: b3JointId, velocity: b3Vec3);
}
unsafe extern "C" {
#[doc = " Get the desired relative linear velocity in meters per second"]
pub fn b3MotorJoint_GetLinearVelocity(jointId: b3JointId) -> b3Vec3;
}
unsafe extern "C" {
#[doc = " Set the desired relative angular velocity in radians per second"]
pub fn b3MotorJoint_SetAngularVelocity(jointId: b3JointId, velocity: b3Vec3);
}
unsafe extern "C" {
#[doc = " Get the desired relative angular velocity in radians per second"]
pub fn b3MotorJoint_GetAngularVelocity(jointId: b3JointId) -> b3Vec3;
}
unsafe extern "C" {
#[doc = " Set the motor joint maximum force, usually in newtons"]
pub fn b3MotorJoint_SetMaxVelocityForce(jointId: b3JointId, maxForce: f32);
}
unsafe extern "C" {
#[doc = " Get the motor joint maximum force, usually in newtons"]
pub fn b3MotorJoint_GetMaxVelocityForce(jointId: b3JointId) -> f32;
}
unsafe extern "C" {
#[doc = " Set the motor joint maximum torque, usually in newton-meters"]
pub fn b3MotorJoint_SetMaxVelocityTorque(jointId: b3JointId, maxTorque: f32);
}
unsafe extern "C" {
#[doc = " Get the motor joint maximum torque, usually in newton-meters"]
pub fn b3MotorJoint_GetMaxVelocityTorque(jointId: b3JointId) -> f32;
}
unsafe extern "C" {
#[doc = " Set the spring linear hertz stiffness"]
pub fn b3MotorJoint_SetLinearHertz(jointId: b3JointId, hertz: f32);
}
unsafe extern "C" {
#[doc = " Get the spring linear hertz stiffness"]
pub fn b3MotorJoint_GetLinearHertz(jointId: b3JointId) -> f32;
}
unsafe extern "C" {
#[doc = " Set the spring linear damping ratio. Use 1.0 for critical damping."]
pub fn b3MotorJoint_SetLinearDampingRatio(jointId: b3JointId, damping: f32);
}
unsafe extern "C" {
#[doc = " Get the spring linear damping ratio."]
pub fn b3MotorJoint_GetLinearDampingRatio(jointId: b3JointId) -> f32;
}
unsafe extern "C" {
#[doc = " Set the spring angular hertz stiffness"]
pub fn b3MotorJoint_SetAngularHertz(jointId: b3JointId, hertz: f32);
}
unsafe extern "C" {
#[doc = " Get the spring angular hertz stiffness"]
pub fn b3MotorJoint_GetAngularHertz(jointId: b3JointId) -> f32;
}
unsafe extern "C" {
#[doc = " Set the spring angular damping ratio. Use 1.0 for critical damping."]
pub fn b3MotorJoint_SetAngularDampingRatio(jointId: b3JointId, damping: f32);
}
unsafe extern "C" {
#[doc = " Get the spring angular damping ratio."]
pub fn b3MotorJoint_GetAngularDampingRatio(jointId: b3JointId) -> f32;
}
unsafe extern "C" {
#[doc = " Set the maximum spring force in newtons."]
pub fn b3MotorJoint_SetMaxSpringForce(jointId: b3JointId, maxForce: f32);
}
unsafe extern "C" {
#[doc = " Get the maximum spring force in newtons."]
pub fn b3MotorJoint_GetMaxSpringForce(jointId: b3JointId) -> f32;
}
unsafe extern "C" {
#[doc = " Set the maximum spring torque in newtons * meters"]
pub fn b3MotorJoint_SetMaxSpringTorque(jointId: b3JointId, maxTorque: f32);
}
unsafe extern "C" {
#[doc = " Get the maximum spring torque in newtons * meters"]
pub fn b3MotorJoint_GetMaxSpringTorque(jointId: b3JointId) -> f32;
}
unsafe extern "C" {
#[doc = " Create a filter joint.\n @see b3FilterJointDef for details"]
pub fn b3CreateFilterJoint(worldId: b3WorldId, def: *const b3FilterJointDef) -> b3JointId;
}
unsafe extern "C" {
#[doc = " Create a prismatic (slider) joint.\n @see b3PrismaticJointDef for details"]
pub fn b3CreatePrismaticJoint(worldId: b3WorldId, def: *const b3PrismaticJointDef)
-> b3JointId;
}
unsafe extern "C" {
#[doc = " Enable/disable the joint spring."]
pub fn b3PrismaticJoint_EnableSpring(jointId: b3JointId, enableSpring: bool);
}
unsafe extern "C" {
#[doc = " Is the prismatic joint spring enabled or not?"]
pub fn b3PrismaticJoint_IsSpringEnabled(jointId: b3JointId) -> bool;
}
unsafe extern "C" {
#[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."]
pub fn b3PrismaticJoint_SetSpringHertz(jointId: b3JointId, hertz: f32);
}
unsafe extern "C" {
#[doc = " Get the prismatic joint stiffness in Hertz"]
pub fn b3PrismaticJoint_GetSpringHertz(jointId: b3JointId) -> f32;
}
unsafe extern "C" {
#[doc = " Set the prismatic joint damping ratio (non-dimensional)"]
pub fn b3PrismaticJoint_SetSpringDampingRatio(jointId: b3JointId, dampingRatio: f32);
}
unsafe extern "C" {
#[doc = " Get the prismatic spring damping ratio (non-dimensional)"]
pub fn b3PrismaticJoint_GetSpringDampingRatio(jointId: b3JointId) -> f32;
}
unsafe extern "C" {
#[doc = " Set the prismatic joint target translation. Usually in meters."]
pub fn b3PrismaticJoint_SetTargetTranslation(jointId: b3JointId, targetTranslation: f32);
}
unsafe extern "C" {
#[doc = " Get the prismatic joint target translation. Usually in meters."]
pub fn b3PrismaticJoint_GetTargetTranslation(jointId: b3JointId) -> f32;
}
unsafe extern "C" {
#[doc = " Enable/disable a prismatic joint limit"]
pub fn b3PrismaticJoint_EnableLimit(jointId: b3JointId, enableLimit: bool);
}
unsafe extern "C" {
#[doc = " Is the prismatic joint limit enabled?"]
pub fn b3PrismaticJoint_IsLimitEnabled(jointId: b3JointId) -> bool;
}
unsafe extern "C" {
#[doc = " Get the prismatic joint lower limit"]
pub fn b3PrismaticJoint_GetLowerLimit(jointId: b3JointId) -> f32;
}
unsafe extern "C" {
#[doc = " Get the prismatic joint upper limit"]
pub fn b3PrismaticJoint_GetUpperLimit(jointId: b3JointId) -> f32;
}
unsafe extern "C" {
#[doc = " Set the prismatic joint limits"]
pub fn b3PrismaticJoint_SetLimits(jointId: b3JointId, lower: f32, upper: f32);
}
unsafe extern "C" {
#[doc = " Enable/disable a prismatic joint motor"]
pub fn b3PrismaticJoint_EnableMotor(jointId: b3JointId, enableMotor: bool);
}
unsafe extern "C" {
#[doc = " Is the prismatic joint motor enabled?"]
pub fn b3PrismaticJoint_IsMotorEnabled(jointId: b3JointId) -> bool;
}
unsafe extern "C" {
#[doc = " Set the prismatic joint motor speed, usually in meters per second"]
pub fn b3PrismaticJoint_SetMotorSpeed(jointId: b3JointId, motorSpeed: f32);
}
unsafe extern "C" {
#[doc = " Get the prismatic joint motor speed, usually in meters per second"]
pub fn b3PrismaticJoint_GetMotorSpeed(jointId: b3JointId) -> f32;
}
unsafe extern "C" {
#[doc = " Set the prismatic joint maximum motor force, usually in newtons"]
pub fn b3PrismaticJoint_SetMaxMotorForce(jointId: b3JointId, force: f32);
}
unsafe extern "C" {
#[doc = " Get the prismatic joint maximum motor force, usually in newtons"]
pub fn b3PrismaticJoint_GetMaxMotorForce(jointId: b3JointId) -> f32;
}
unsafe extern "C" {
#[doc = " Get the prismatic joint current motor force, usually in newtons"]
pub fn b3PrismaticJoint_GetMotorForce(jointId: b3JointId) -> f32;
}
unsafe extern "C" {
#[doc = " Get the current joint translation, usually in meters."]
pub fn b3PrismaticJoint_GetTranslation(jointId: b3JointId) -> f32;
}
unsafe extern "C" {
#[doc = " Get the current joint translation speed, usually in meters per second."]
pub fn b3PrismaticJoint_GetSpeed(jointId: b3JointId) -> f32;
}
unsafe extern "C" {
#[doc = " Create a revolute joint\n @see b3RevoluteJointDef for details"]
pub fn b3CreateRevoluteJoint(worldId: b3WorldId, def: *const b3RevoluteJointDef) -> b3JointId;
}
unsafe extern "C" {
#[doc = " Enable/disable the revolute joint spring"]
pub fn b3RevoluteJoint_EnableSpring(jointId: b3JointId, enableSpring: bool);
}
unsafe extern "C" {
#[doc = " Is the revolute angular spring enabled?"]
pub fn b3RevoluteJoint_IsSpringEnabled(jointId: b3JointId) -> bool;
}
unsafe extern "C" {
#[doc = " Set the revolute joint spring stiffness in Hertz"]
pub fn b3RevoluteJoint_SetSpringHertz(jointId: b3JointId, hertz: f32);
}
unsafe extern "C" {
#[doc = " Get the revolute joint spring stiffness in Hertz"]
pub fn b3RevoluteJoint_GetSpringHertz(jointId: b3JointId) -> f32;
}
unsafe extern "C" {
#[doc = " Set the revolute joint spring damping ratio, non-dimensional"]
pub fn b3RevoluteJoint_SetSpringDampingRatio(jointId: b3JointId, dampingRatio: f32);
}
unsafe extern "C" {
#[doc = " Get the revolute joint spring damping ratio, non-dimensional"]
pub fn b3RevoluteJoint_GetSpringDampingRatio(jointId: b3JointId) -> f32;
}
unsafe extern "C" {
#[doc = " Set the revolute joint target angle in radians"]
pub fn b3RevoluteJoint_SetTargetAngle(jointId: b3JointId, targetRadians: f32);
}
unsafe extern "C" {
#[doc = " Get the revolute joint target angle in radians"]
pub fn b3RevoluteJoint_GetTargetAngle(jointId: b3JointId) -> f32;
}
unsafe extern "C" {
#[doc = " Get the revolute joint current angle in radians relative to the reference angle\n @see b3RevoluteJointDef::referenceAngle"]
pub fn b3RevoluteJoint_GetAngle(jointId: b3JointId) -> f32;
}
unsafe extern "C" {
#[doc = " Enable/disable the revolute joint limit"]
pub fn b3RevoluteJoint_EnableLimit(jointId: b3JointId, enableLimit: bool);
}
unsafe extern "C" {
#[doc = " Is the revolute joint limit enabled?"]
pub fn b3RevoluteJoint_IsLimitEnabled(jointId: b3JointId) -> bool;
}
unsafe extern "C" {
#[doc = " Get the revolute joint lower limit in radians"]
pub fn b3RevoluteJoint_GetLowerLimit(jointId: b3JointId) -> f32;
}
unsafe extern "C" {
#[doc = " Get the revolute joint upper limit in radians"]
pub fn b3RevoluteJoint_GetUpperLimit(jointId: b3JointId) -> f32;
}
unsafe extern "C" {
#[doc = " Set the revolute joint limits in radians"]
pub fn b3RevoluteJoint_SetLimits(
jointId: b3JointId,
lowerLimitRadians: f32,
upperLimitRadians: f32,
);
}
unsafe extern "C" {
#[doc = " Enable/disable a revolute joint motor"]
pub fn b3RevoluteJoint_EnableMotor(jointId: b3JointId, enableMotor: bool);
}
unsafe extern "C" {
#[doc = " Is the revolute joint motor enabled?"]
pub fn b3RevoluteJoint_IsMotorEnabled(jointId: b3JointId) -> bool;
}
unsafe extern "C" {
#[doc = " Set the revolute joint motor speed in radians per second"]
pub fn b3RevoluteJoint_SetMotorSpeed(jointId: b3JointId, motorSpeed: f32);
}
unsafe extern "C" {
#[doc = " Get the revolute joint motor speed in radians per second"]
pub fn b3RevoluteJoint_GetMotorSpeed(jointId: b3JointId) -> f32;
}
unsafe extern "C" {
#[doc = " Get the revolute joint current motor torque, usually in newton-meters"]
pub fn b3RevoluteJoint_GetMotorTorque(jointId: b3JointId) -> f32;
}
unsafe extern "C" {
#[doc = " Set the revolute joint maximum motor torque, usually in newton-meters"]
pub fn b3RevoluteJoint_SetMaxMotorTorque(jointId: b3JointId, torque: f32);
}
unsafe extern "C" {
#[doc = " Get the revolute joint maximum motor torque, usually in newton-meters"]
pub fn b3RevoluteJoint_GetMaxMotorTorque(jointId: b3JointId) -> f32;
}
unsafe extern "C" {
#[doc = " Create a spherical joint\n @see b3SphericalJointDef for details"]
pub fn b3CreateSphericalJoint(worldId: b3WorldId, def: *const b3SphericalJointDef)
-> b3JointId;
}
unsafe extern "C" {
#[doc = " Enable/disable the spherical joint cone limit"]
pub fn b3SphericalJoint_EnableConeLimit(jointId: b3JointId, enableLimit: bool);
}
unsafe extern "C" {
#[doc = " Is the spherical joint cone limit enabled?"]
pub fn b3SphericalJoint_IsConeLimitEnabled(jointId: b3JointId) -> bool;
}
unsafe extern "C" {
#[doc = " Get the spherical joint cone limit in radians"]
pub fn b3SphericalJoint_GetConeLimit(jointId: b3JointId) -> f32;
}
unsafe extern "C" {
#[doc = " Set the spherical joint limits in radians"]
pub fn b3SphericalJoint_SetConeLimit(jointId: b3JointId, angleRadians: f32);
}
unsafe extern "C" {
#[doc = " Get the spherical joint current cone angle in radians."]
pub fn b3SphericalJoint_GetConeAngle(jointId: b3JointId) -> f32;
}
unsafe extern "C" {
#[doc = " Enable/disable the spherical joint limit"]
pub fn b3SphericalJoint_EnableTwistLimit(jointId: b3JointId, enableLimit: bool);
}
unsafe extern "C" {
#[doc = " Is the spherical joint limit enabled?"]
pub fn b3SphericalJoint_IsTwistLimitEnabled(jointId: b3JointId) -> bool;
}
unsafe extern "C" {
#[doc = " Get the spherical joint lower limit in radians"]
pub fn b3SphericalJoint_GetLowerTwistLimit(jointId: b3JointId) -> f32;
}
unsafe extern "C" {
#[doc = " Get the spherical joint upper limit in radians"]
pub fn b3SphericalJoint_GetUpperTwistLimit(jointId: b3JointId) -> f32;
}
unsafe extern "C" {
#[doc = " Set the spherical joint limits in radians"]
pub fn b3SphericalJoint_SetTwistLimits(
jointId: b3JointId,
lowerLimitRadians: f32,
upperLimitRadians: f32,
);
}
unsafe extern "C" {
#[doc = " Get the spherical joint current twist angle in radians."]
pub fn b3SphericalJoint_GetTwistAngle(jointId: b3JointId) -> f32;
}
unsafe extern "C" {
#[doc = " Enable/disable the spherical joint spring"]
pub fn b3SphericalJoint_EnableSpring(jointId: b3JointId, enableSpring: bool);
}
unsafe extern "C" {
#[doc = " Is the spherical angular spring enabled?"]
pub fn b3SphericalJoint_IsSpringEnabled(jointId: b3JointId) -> bool;
}
unsafe extern "C" {
#[doc = " Set the spherical joint spring stiffness in Hertz"]
pub fn b3SphericalJoint_SetSpringHertz(jointId: b3JointId, hertz: f32);
}
unsafe extern "C" {
#[doc = " Get the spherical joint spring stiffness in Hertz"]
pub fn b3SphericalJoint_GetSpringHertz(jointId: b3JointId) -> f32;
}
unsafe extern "C" {
#[doc = " Set the spherical joint spring damping ratio, non-dimensional"]
pub fn b3SphericalJoint_SetSpringDampingRatio(jointId: b3JointId, dampingRatio: f32);
}
unsafe extern "C" {
#[doc = " Get the spherical joint spring damping ratio, non-dimensional"]
pub fn b3SphericalJoint_GetSpringDampingRatio(jointId: b3JointId) -> f32;
}
unsafe extern "C" {
#[doc = " Set the spherical joint spring target rotation"]
pub fn b3SphericalJoint_SetTargetRotation(jointId: b3JointId, targetRotation: b3Quat);
}
unsafe extern "C" {
#[doc = " Get the spherical joint spring target rotation"]
pub fn b3SphericalJoint_GetTargetRotation(jointId: b3JointId) -> b3Quat;
}
unsafe extern "C" {
#[doc = " Enable/disable a spherical joint motor"]
pub fn b3SphericalJoint_EnableMotor(jointId: b3JointId, enableMotor: bool);
}
unsafe extern "C" {
#[doc = " Is the spherical joint motor enabled?"]
pub fn b3SphericalJoint_IsMotorEnabled(jointId: b3JointId) -> bool;
}
unsafe extern "C" {
#[doc = " Set the spherical joint motor velocity in radians per second"]
pub fn b3SphericalJoint_SetMotorVelocity(jointId: b3JointId, motorVelocity: b3Vec3);
}
unsafe extern "C" {
#[doc = " Get the spherical joint motor velocity in radians per second"]
pub fn b3SphericalJoint_GetMotorVelocity(jointId: b3JointId) -> b3Vec3;
}
unsafe extern "C" {
#[doc = " Get the spherical joint current motor torque, usually in newton-meters"]
pub fn b3SphericalJoint_GetMotorTorque(jointId: b3JointId) -> b3Vec3;
}
unsafe extern "C" {
#[doc = " Set the spherical joint maximum motor torque, usually in newton-meters"]
pub fn b3SphericalJoint_SetMaxMotorTorque(jointId: b3JointId, torque: f32);
}
unsafe extern "C" {
#[doc = " Get the spherical joint maximum motor torque, usually in newton-meters"]
pub fn b3SphericalJoint_GetMaxMotorTorque(jointId: b3JointId) -> f32;
}
unsafe extern "C" {
#[doc = " Create a weld joint\n @see b3WeldJointDef for details"]
pub fn b3CreateWeldJoint(worldId: b3WorldId, def: *const b3WeldJointDef) -> b3JointId;
}
unsafe extern "C" {
#[doc = " Set the weld joint linear stiffness in Hertz. 0 is rigid."]
pub fn b3WeldJoint_SetLinearHertz(jointId: b3JointId, hertz: f32);
}
unsafe extern "C" {
#[doc = " Get the weld joint linear stiffness in Hertz"]
pub fn b3WeldJoint_GetLinearHertz(jointId: b3JointId) -> f32;
}
unsafe extern "C" {
#[doc = " Set the weld joint linear damping ratio (non-dimensional)"]
pub fn b3WeldJoint_SetLinearDampingRatio(jointId: b3JointId, dampingRatio: f32);
}
unsafe extern "C" {
#[doc = " Get the weld joint linear damping ratio (non-dimensional)"]
pub fn b3WeldJoint_GetLinearDampingRatio(jointId: b3JointId) -> f32;
}
unsafe extern "C" {
#[doc = " Set the weld joint angular stiffness in Hertz. 0 is rigid."]
pub fn b3WeldJoint_SetAngularHertz(jointId: b3JointId, hertz: f32);
}
unsafe extern "C" {
#[doc = " Get the weld joint angular stiffness in Hertz"]
pub fn b3WeldJoint_GetAngularHertz(jointId: b3JointId) -> f32;
}
unsafe extern "C" {
#[doc = " Set weld joint angular damping ratio, non-dimensional"]
pub fn b3WeldJoint_SetAngularDampingRatio(jointId: b3JointId, dampingRatio: f32);
}
unsafe extern "C" {
#[doc = " Get the weld joint angular damping ratio, non-dimensional"]
pub fn b3WeldJoint_GetAngularDampingRatio(jointId: b3JointId) -> f32;
}
unsafe extern "C" {
#[doc = " Create a wheel joint.\n @see b3WheelJointDef for details."]
pub fn b3CreateWheelJoint(worldId: b3WorldId, def: *const b3WheelJointDef) -> b3JointId;
}
unsafe extern "C" {
#[doc = " Enable/disable the wheel joint spring."]
pub fn b3WheelJoint_EnableSuspension(jointId: b3JointId, flag: bool);
}
unsafe extern "C" {
#[doc = " Is the wheel joint spring enabled?"]
pub fn b3WheelJoint_IsSuspensionEnabled(jointId: b3JointId) -> bool;
}
unsafe extern "C" {
#[doc = " Set the wheel joint stiffness in Hertz."]
pub fn b3WheelJoint_SetSuspensionHertz(jointId: b3JointId, hertz: f32);
}
unsafe extern "C" {
#[doc = " Get the wheel joint stiffness in Hertz."]
pub fn b3WheelJoint_GetSuspensionHertz(jointId: b3JointId) -> f32;
}
unsafe extern "C" {
#[doc = " Set the wheel joint damping ratio, non-dimensional."]
pub fn b3WheelJoint_SetSuspensionDampingRatio(jointId: b3JointId, dampingRatio: f32);
}
unsafe extern "C" {
#[doc = " Get the wheel joint damping ratio, non-dimensional."]
pub fn b3WheelJoint_GetSuspensionDampingRatio(jointId: b3JointId) -> f32;
}
unsafe extern "C" {
#[doc = " Enable/disable the wheel joint limit."]
pub fn b3WheelJoint_EnableSuspensionLimit(jointId: b3JointId, flag: bool);
}
unsafe extern "C" {
#[doc = " Is the wheel joint limit enabled?"]
pub fn b3WheelJoint_IsSuspensionLimitEnabled(jointId: b3JointId) -> bool;
}
unsafe extern "C" {
#[doc = " Get the wheel joint lower limit."]
pub fn b3WheelJoint_GetLowerSuspensionLimit(jointId: b3JointId) -> f32;
}
unsafe extern "C" {
#[doc = " Get the wheel joint upper limit."]
pub fn b3WheelJoint_GetUpperSuspensionLimit(jointId: b3JointId) -> f32;
}
unsafe extern "C" {
#[doc = " Set the wheel joint limits."]
pub fn b3WheelJoint_SetSuspensionLimits(jointId: b3JointId, lower: f32, upper: f32);
}
unsafe extern "C" {
#[doc = " Enable/disable the wheel joint motor."]
pub fn b3WheelJoint_EnableSpinMotor(jointId: b3JointId, flag: bool);
}
unsafe extern "C" {
#[doc = " Is the wheel joint motor enabled?"]
pub fn b3WheelJoint_IsSpinMotorEnabled(jointId: b3JointId) -> bool;
}
unsafe extern "C" {
#[doc = " Set the wheel joint motor speed in radians per second."]
pub fn b3WheelJoint_SetSpinMotorSpeed(jointId: b3JointId, speed: f32);
}
unsafe extern "C" {
#[doc = " Get the wheel joint motor speed in radians per second."]
pub fn b3WheelJoint_GetSpinMotorSpeed(jointId: b3JointId) -> f32;
}
unsafe extern "C" {
#[doc = " Set the wheel joint maximum motor torque, usually in newton-meters."]
pub fn b3WheelJoint_SetMaxSpinTorque(jointId: b3JointId, torque: f32);
}
unsafe extern "C" {
#[doc = " Get the wheel joint maximum motor torque, usually in newton-meters."]
pub fn b3WheelJoint_GetMaxSpinTorque(jointId: b3JointId) -> f32;
}
unsafe extern "C" {
#[doc = " Get the current spin speed in radians per second."]
pub fn b3WheelJoint_GetSpinSpeed(jointId: b3JointId) -> f32;
}
unsafe extern "C" {
#[doc = " Get the wheel joint current motor torque, usually in newton-meters."]
pub fn b3WheelJoint_GetSpinTorque(jointId: b3JointId) -> f32;
}
unsafe extern "C" {
#[doc = " Enable/disable wheel steering. Steering allows the wheel to rotate about the suspension axis."]
pub fn b3WheelJoint_EnableSteering(jointId: b3JointId, flag: bool);
}
unsafe extern "C" {
#[doc = " Can the wheel steer?"]
pub fn b3WheelJoint_IsSteeringEnabled(jointId: b3JointId) -> bool;
}
unsafe extern "C" {
#[doc = " Set the wheel joint steering stiffness in Hertz."]
pub fn b3WheelJoint_SetSteeringHertz(jointId: b3JointId, hertz: f32);
}
unsafe extern "C" {
#[doc = " Get the wheel joint steering stiffness in Hertz."]
pub fn b3WheelJoint_GetSteeringHertz(jointId: b3JointId) -> f32;
}
unsafe extern "C" {
#[doc = " Set the wheel joint steering damping ratio, non-dimensional."]
pub fn b3WheelJoint_SetSteeringDampingRatio(jointId: b3JointId, dampingRatio: f32);
}
unsafe extern "C" {
#[doc = " Get the wheel joint steering damping ratio, non-dimensional."]
pub fn b3WheelJoint_GetSteeringDampingRatio(jointId: b3JointId) -> f32;
}
unsafe extern "C" {
#[doc = " Set the wheel joint maximum steering torque in N*m."]
pub fn b3WheelJoint_SetMaxSteeringTorque(jointId: b3JointId, torque: f32);
}
unsafe extern "C" {
#[doc = " Get the wheel joint maximum steering torque in N*m."]
pub fn b3WheelJoint_GetMaxSteeringTorque(jointId: b3JointId) -> f32;
}
unsafe extern "C" {
#[doc = " Enable/disable the wheel joint steering limit."]
pub fn b3WheelJoint_EnableSteeringLimit(jointId: b3JointId, flag: bool);
}
unsafe extern "C" {
#[doc = " Is the wheel joint steering limit enabled?"]
pub fn b3WheelJoint_IsSteeringLimitEnabled(jointId: b3JointId) -> bool;
}
unsafe extern "C" {
#[doc = " Get the wheel joint lower steering limit in radians."]
pub fn b3WheelJoint_GetLowerSteeringLimit(jointId: b3JointId) -> f32;
}
unsafe extern "C" {
#[doc = " Get the wheel joint upper steering limit in radians."]
pub fn b3WheelJoint_GetUpperSteeringLimit(jointId: b3JointId) -> f32;
}
unsafe extern "C" {
#[doc = " Set the wheel joint steering limits in radians."]
pub fn b3WheelJoint_SetSteeringLimits(jointId: b3JointId, lowerRadians: f32, upperRadians: f32);
}
unsafe extern "C" {
#[doc = " Set the wheel joint target steering angle in radians."]
pub fn b3WheelJoint_SetTargetSteeringAngle(jointId: b3JointId, radians: f32);
}
unsafe extern "C" {
#[doc = " Get the wheel joint target steering angle in radians."]
pub fn b3WheelJoint_GetTargetSteeringAngle(jointId: b3JointId) -> f32;
}
unsafe extern "C" {
#[doc = " Get the current steering angle in radians."]
pub fn b3WheelJoint_GetSteeringAngle(jointId: b3JointId) -> f32;
}
unsafe extern "C" {
#[doc = " Get the current steering torque in N*m."]
pub fn b3WheelJoint_GetSteeringTorque(jointId: b3JointId) -> f32;
}
unsafe extern "C" {
#[doc = " Contact identifier validation. Provides validation for up to 2^32 allocations."]
pub fn b3Contact_IsValid(id: b3ContactId) -> bool;
}
unsafe extern "C" {
#[doc = " Get the manifolds for a contact. The manifold may have no points if the contact is not touching."]
pub fn b3Contact_GetData(contactId: b3ContactId) -> b3ContactData;
}