Crate box2d_sys

Source

Structs§

__fsid_t
b2AABB
Axis-aligned bounding box
b2BodyDef
A body definition holds all the data needed to construct a rigid body. You can safely re-use body definitions. Shapes are added to a body after construction. Body definitions are temporary objects used to bundle creation parameters. Must be initialized using b2DefaultBodyDef(). @ingroup body
b2BodyEvents
Body events are buffered in the Box2D world and are available as event arrays after the time step is complete. Note: this data becomes invalid if bodies are destroyed
b2BodyId
Body id references a body instance. This should be treated as an opaque handle.
b2BodyMoveEvent
Body move events triggered when a body moves. Triggered when a body moves due to simulation. Not reported for bodies moved by the user. This also has a flag to indicate that the body went to sleep so the application can also sleep that actor/entity/object associated with the body. On the other hand if the flag does not indicate the body went to sleep then the application can treat the actor/entity/object associated with the body as awake. This is an efficient way for an application to update game object transforms rather than calling functions such as b2Body_GetTransform() because this data is delivered as a contiguous array and it is only populated with bodies that have moved. @note If sleeping is disabled all dynamic and kinematic bodies will trigger move events.
b2Capsule
A solid capsule can be viewed as two semicircles connected by a rectangle.
b2CastOutput
Low level ray-cast or shape-cast output data
b2ChainDef
Used to create a chain of line segments. This is designed to eliminate ghost collisions with some limitations.
b2ChainId
Chain id references a chain instances. This should be treated as an opaque handle.
b2ChainSegment
A line segment with one-sided collision. Only collides on the right side. Several of these are generated for a chain shape. ghost1 -> point1 -> point2 -> ghost2
b2Circle
A solid circle
b2ContactBeginTouchEvent
A begin touch event is generated when two shapes begin touching.
b2ContactData
The contact data for two shapes. By convention the manifold normal points from shape A to shape B. @see b2Shape_GetContactData() and b2Body_GetContactData()
b2ContactEndTouchEvent
An end touch event is generated when two shapes stop touching.
b2ContactEvents
Contact events are buffered in the Box2D world and are available as event arrays after the time step is complete. Note: these may become invalid if bodies and/or shapes are destroyed
b2ContactHitEvent
A hit touch event is generated when two shapes collide with a speed faster than the hit speed threshold.
b2CosSin
Cosine and sine pair This uses a custom implementation designed for cross platform determinism
b2Counters
Counters that give details of the simulation size.
b2DebugDraw
This struct holds callbacks you can implement to draw a Box2D world. This structure should be zero initialized. @ingroup world
b2DistanceCache
Used to warm start b2Distance. Set count to zero on first call or use zero initialization.
b2DistanceInput
Input for b2ShapeDistance
b2DistanceJointDef
Distance joint definition
b2DistanceOutput
Output for b2ShapeDistance
b2DistanceProxy
A distance proxy is used by the GJK algorithm. It encapsulates any shape.
b2DynamicTree
The dynamic tree structure. This should be considered private data. It is placed here for performance reasons.
b2Filter
This is used to filter collision on shapes. It affects shape-vs-shape collision and shape-versus-query collision (such as b2World_CastRay). @ingroup shape
b2Hull
A convex hull. Used to create convex polygons. @warning Do not modify these values directly, instead use b2ComputeHull()
b2JointId
Joint id references a joint instance. This should be treated as an opaque handle.
b2Manifold
A contact manifold describes the contact points between colliding shapes
b2ManifoldPoint
A manifold point is a contact point belonging to a contact manifold. It holds details related to the geometry and dynamics of the contact points.
b2MassData
This holds the mass data computed for a shape.
b2Mat22
A 2-by-2 Matrix
b2MotorJointDef
A motor joint is used to control the relative motion between two bodies
b2MouseJointDef
A mouse joint is used to make a point on a body track a specified world point.
b2Polygon
A solid convex polygon. It is assumed that the interior of the polygon is to the left of each edge. Polygons have a maximum number of vertices equal to b2_maxPolygonVertices. In most cases you should not need many vertices for a convex polygon. @warning DO NOT fill this out manually, instead use a helper function like b2MakePolygon or b2MakeBox.
b2PrismaticJointDef
Prismatic joint definition
b2Profile
! @cond Profiling data. Times are in milliseconds.
b2QueryFilter
The query filter is used to filter collisions between queries and shapes. For example, you may want a ray-cast representing a projectile to hit players and the static environment but not debris. @ingroup shape
b2RayCastInput
Low level ray-cast input data
b2RayResult
Result from b2World_RayCastClosest @ingroup world
b2RevoluteJointDef
Revolute joint definition
b2Rot
2D rotation This is similar to using a complex number for rotation
b2Segment
A line segment with two-sided collision.
b2SegmentDistanceResult
Result of computing the distance between two line segments
b2SensorBeginTouchEvent
A begin touch event is generated when a shape starts to overlap a sensor shape.
b2SensorEndTouchEvent
An end touch event is generated when a shape stops overlapping a sensor shape.
b2SensorEvents
Sensor events are buffered in the Box2D world and are available as begin/end overlap event arrays after the time step is complete. Note: these may become invalid if bodies and/or shapes are destroyed
b2ShapeCastInput
Low level shape cast input in generic form. This allows casting an arbitrary point cloud wrap with a radius. For example, a circle is a single point with a non-zero radius. A capsule is two points with a non-zero radius. A box is four points with a zero radius.
b2ShapeCastPairInput
Input parameters for b2ShapeCast
b2ShapeDef
Used to create a shape. This is a temporary object used to bundle shape creation parameters. You may use the same shape definition to create multiple shapes. Must be initialized using b2DefaultShapeDef(). @ingroup shape
b2ShapeId
Shape id references a shape instance. This should be treated as an opaque handle.
b2Simplex
Simplex from the GJK algorithm
b2SimplexVertex
Simplex vertex for debugging the GJK algorithm
b2Sweep
This describes the motion of a body/shape for TOI computation. Shapes are defined with respect to the body origin, which may not coincide with the center of mass. However, to support dynamics we must interpolate the center of mass position.
b2TOIInput
Input parameters for b2TimeOfImpact
b2TOIOutput
Output parameters for b2TimeOfImpact.
b2Timer
! @cond
b2Transform
A 2D rigid transform
b2TreeNode
A node in the dynamic tree. This is private data placed here for performance reasons.
b2Vec2
2D vector This can be used to represent a point or free vector
b2Version
Version numbering scheme. See https://semver.org/
b2WeldJointDef
Weld joint definition
b2WheelJointDef
Wheel joint definition
b2WorldDef
World definition used to create a simulation world. Must be initialized using b2DefaultWorldDef(). @ingroup world
b2WorldId
World id references a world instance. This should be treated as an opaque handle.

Constants§

B2_HASH_INIT
FP_ILOGB0
FP_ILOGBNAN
FP_INFINITE
FP_NAN
FP_NORMAL
FP_SUBNORMAL
FP_ZERO
INT8_MAX
INT8_MIN
INT16_MAX
INT16_MIN
INT32_MAX
INT32_MIN
INTPTR_MAX
INTPTR_MIN
INT_FAST8_MAX
INT_FAST8_MIN
INT_FAST16_MAX
INT_FAST16_MIN
INT_FAST32_MAX
INT_FAST32_MIN
INT_LEAST8_MAX
INT_LEAST8_MIN
INT_LEAST16_MAX
INT_LEAST16_MIN
INT_LEAST32_MAX
INT_LEAST32_MIN
MATH_ERREXCEPT
MATH_ERRNO
M_1_PI
M_2_PI
M_2_SQRTPI
M_E
M_LN2
M_LN10
M_LOG2E
M_LOG10E
M_PI
M_PI_2
M_PI_4
M_SQRT2
M_SQRT1_2
PTRDIFF_MAX
PTRDIFF_MIN
SIG_ATOMIC_MAX
SIG_ATOMIC_MIN
SIZE_MAX
UINT8_MAX
UINT16_MAX
UINT32_MAX
UINTPTR_MAX
UINT_FAST8_MAX
UINT_FAST16_MAX
UINT_FAST32_MAX
UINT_LEAST8_MAX
UINT_LEAST16_MAX
UINT_LEAST32_MAX
WINT_MAX
WINT_MIN
_ATFILE_SOURCE
_BITS_LIBM_SIMD_DECL_STUBS_H
_BITS_STDINT_INTN_H
_BITS_STDINT_LEAST_H
_BITS_STDINT_UINTN_H
_BITS_TIME64_H
_BITS_TYPESIZES_H
_BITS_TYPES_H
_BITS_WCHAR_H
_DEFAULT_SOURCE
_FEATURES_H
_MATH_H
_POSIX_C_SOURCE
_POSIX_SOURCE
_STDC_PREDEF_H
_STDINT_H
_SYS_CDEFS_H
__FD_SETSIZE
__FP_LOGB0_IS_MIN
__FP_LOGBNAN_IS_MIN
__GLIBC_MINOR__
__GLIBC_USE_C2X_STRTOL
__GLIBC_USE_DEPRECATED_GETS
__GLIBC_USE_DEPRECATED_SCANF
__GLIBC_USE_IEC_60559_BFP_EXT
__GLIBC_USE_IEC_60559_BFP_EXT_C2X
__GLIBC_USE_IEC_60559_EXT
__GLIBC_USE_IEC_60559_FUNCS_EXT
__GLIBC_USE_IEC_60559_FUNCS_EXT_C2X
__GLIBC_USE_IEC_60559_TYPES_EXT
__GLIBC_USE_ISOC2X
__GLIBC_USE_LIB_EXT2
__GLIBC__
__GNU_LIBRARY__
__HAVE_DISTINCT_FLOAT16
__HAVE_DISTINCT_FLOAT32
__HAVE_DISTINCT_FLOAT64
__HAVE_DISTINCT_FLOAT32X
__HAVE_DISTINCT_FLOAT64X
__HAVE_DISTINCT_FLOAT128
__HAVE_DISTINCT_FLOAT128X
__HAVE_FLOAT16
__HAVE_FLOAT32
__HAVE_FLOAT64
__HAVE_FLOAT32X
__HAVE_FLOAT64X
__HAVE_FLOAT64X_LONG_DOUBLE
__HAVE_FLOAT128
__HAVE_FLOAT128X
__HAVE_FLOATN_NOT_TYPEDEF
__HAVE_GENERIC_SELECTION
__INO_T_MATCHES_INO64_T
__KERNEL_OLD_TIMEVAL_MATCHES_TIMEVAL64
__LDOUBLE_REDIRECTS_TO_FLOAT128_ABI
__MATH_DECLARE_LDOUBLE
__MATH_DECLARING_DOUBLE
__MATH_DECLARING_FLOATN
__OFF_T_MATCHES_OFF64_T
__RLIM_T_MATCHES_RLIM64_T
__STATFS_MATCHES_STATFS64
__STDC_IEC_559_COMPLEX__
__STDC_IEC_559__
__STDC_IEC_60559_BFP__
__STDC_IEC_60559_COMPLEX__
__STDC_ISO_10646__
__SYSCALL_WORDSIZE
__TIMESIZE
__USE_ATFILE
__USE_FORTIFY_LEVEL
__USE_ISOC11
__USE_ISOC95
__USE_ISOC99
__USE_MISC
__USE_POSIX
__USE_POSIX2
__USE_POSIX199309
__USE_POSIX199506
__USE_POSIX_IMPLICITLY
__USE_XOPEN2K
__USE_XOPEN2K8
__WORDSIZE
__WORDSIZE_TIME64_COMPAT32
__bool_true_false_are_defined
__glibc_c99_flexarr_available
b2BodyType_b2_bodyTypeCount
number of body types
b2BodyType_b2_dynamicBody
positive mass, velocity determined by forces, moved by solver
b2BodyType_b2_kinematicBody
zero mass, velocity set by user, moved by solver
b2BodyType_b2_staticBody
zero mass, zero velocity, may be manually moved
b2HexColor_b2_colorAliceBlue
b2HexColor_b2_colorAntiqueWhite
b2HexColor_b2_colorAquamarine
b2HexColor_b2_colorAzure
b2HexColor_b2_colorBeige
b2HexColor_b2_colorBisque
b2HexColor_b2_colorBlack
b2HexColor_b2_colorBlanchedAlmond
b2HexColor_b2_colorBlue
b2HexColor_b2_colorBlueViolet
b2HexColor_b2_colorBox2DBlue
b2HexColor_b2_colorBox2DGreen
b2HexColor_b2_colorBox2DRed
b2HexColor_b2_colorBox2DYellow
b2HexColor_b2_colorBrown
b2HexColor_b2_colorBurlywood
b2HexColor_b2_colorCadetBlue
b2HexColor_b2_colorChartreuse
b2HexColor_b2_colorChocolate
b2HexColor_b2_colorCoral
b2HexColor_b2_colorCornflowerBlue
b2HexColor_b2_colorCornsilk
b2HexColor_b2_colorCrimson
b2HexColor_b2_colorCyan
b2HexColor_b2_colorDarkBlue
b2HexColor_b2_colorDarkCyan
b2HexColor_b2_colorDarkGoldenrod
b2HexColor_b2_colorDarkGray
b2HexColor_b2_colorDarkGreen
b2HexColor_b2_colorDarkKhaki
b2HexColor_b2_colorDarkMagenta
b2HexColor_b2_colorDarkOliveGreen
b2HexColor_b2_colorDarkOrange
b2HexColor_b2_colorDarkOrchid
b2HexColor_b2_colorDarkRed
b2HexColor_b2_colorDarkSalmon
b2HexColor_b2_colorDarkSeaGreen
b2HexColor_b2_colorDarkSlateBlue
b2HexColor_b2_colorDarkSlateGray
b2HexColor_b2_colorDarkTurquoise
b2HexColor_b2_colorDarkViolet
b2HexColor_b2_colorDeepPink
b2HexColor_b2_colorDeepSkyBlue
b2HexColor_b2_colorDimGray
b2HexColor_b2_colorDodgerBlue
b2HexColor_b2_colorFirebrick
b2HexColor_b2_colorFloralWhite
b2HexColor_b2_colorForestGreen
b2HexColor_b2_colorGainsboro
b2HexColor_b2_colorGhostWhite
b2HexColor_b2_colorGold
b2HexColor_b2_colorGoldenrod
b2HexColor_b2_colorGray
b2HexColor_b2_colorGray1
b2HexColor_b2_colorGray2
b2HexColor_b2_colorGray3
b2HexColor_b2_colorGray4
b2HexColor_b2_colorGray5
b2HexColor_b2_colorGray6
b2HexColor_b2_colorGray7
b2HexColor_b2_colorGray8
b2HexColor_b2_colorGray9
b2HexColor_b2_colorGreen
b2HexColor_b2_colorGreenYellow
b2HexColor_b2_colorHoneydew
b2HexColor_b2_colorHotPink
b2HexColor_b2_colorIndianRed
b2HexColor_b2_colorIndigo
b2HexColor_b2_colorIvory
b2HexColor_b2_colorKhaki
b2HexColor_b2_colorLavender
b2HexColor_b2_colorLavenderBlush
b2HexColor_b2_colorLawnGreen
b2HexColor_b2_colorLemonChiffon
b2HexColor_b2_colorLightBlue
b2HexColor_b2_colorLightCoral
b2HexColor_b2_colorLightCyan
b2HexColor_b2_colorLightGoldenrod
b2HexColor_b2_colorLightGoldenrodYellow
b2HexColor_b2_colorLightGray
b2HexColor_b2_colorLightGreen
b2HexColor_b2_colorLightPink
b2HexColor_b2_colorLightSalmon
b2HexColor_b2_colorLightSeaGreen
b2HexColor_b2_colorLightSkyBlue
b2HexColor_b2_colorLightSlateBlue
b2HexColor_b2_colorLightSlateGray
b2HexColor_b2_colorLightSteelBlue
b2HexColor_b2_colorLightYellow
b2HexColor_b2_colorLimeGreen
b2HexColor_b2_colorLinen
b2HexColor_b2_colorMagenta
b2HexColor_b2_colorMaroon
b2HexColor_b2_colorMediumAquamarine
b2HexColor_b2_colorMediumBlue
b2HexColor_b2_colorMediumOrchid
b2HexColor_b2_colorMediumPurple
b2HexColor_b2_colorMediumSeaGreen
b2HexColor_b2_colorMediumSlateBlue
b2HexColor_b2_colorMediumSpringGreen
b2HexColor_b2_colorMediumTurquoise
b2HexColor_b2_colorMediumVioletRed
b2HexColor_b2_colorMidnightBlue
b2HexColor_b2_colorMintCream
b2HexColor_b2_colorMistyRose
b2HexColor_b2_colorMoccasin
b2HexColor_b2_colorNavajoWhite
b2HexColor_b2_colorNavyBlue
b2HexColor_b2_colorOldLace
b2HexColor_b2_colorOlive
b2HexColor_b2_colorOliveDrab
b2HexColor_b2_colorOrange
b2HexColor_b2_colorOrangeRed
b2HexColor_b2_colorOrchid
b2HexColor_b2_colorPaleGoldenrod
b2HexColor_b2_colorPaleGreen
b2HexColor_b2_colorPaleTurquoise
b2HexColor_b2_colorPaleVioletRed
b2HexColor_b2_colorPapayaWhip
b2HexColor_b2_colorPeachPuff
b2HexColor_b2_colorPeru
b2HexColor_b2_colorPink
b2HexColor_b2_colorPlum
b2HexColor_b2_colorPowderBlue
b2HexColor_b2_colorPurple
b2HexColor_b2_colorRebeccaPurple
b2HexColor_b2_colorRed
b2HexColor_b2_colorRosyBrown
b2HexColor_b2_colorRoyalBlue
b2HexColor_b2_colorSaddleBrown
b2HexColor_b2_colorSalmon
b2HexColor_b2_colorSandyBrown
b2HexColor_b2_colorSeaGreen
b2HexColor_b2_colorSeashell
b2HexColor_b2_colorSienna
b2HexColor_b2_colorSilver
b2HexColor_b2_colorSkyBlue
b2HexColor_b2_colorSlateBlue
b2HexColor_b2_colorSlateGray
b2HexColor_b2_colorSnow
b2HexColor_b2_colorSpringGreen
b2HexColor_b2_colorSteelBlue
b2HexColor_b2_colorTan
b2HexColor_b2_colorTeal
b2HexColor_b2_colorThistle
b2HexColor_b2_colorTomato
b2HexColor_b2_colorTurquoise
b2HexColor_b2_colorViolet
b2HexColor_b2_colorVioletRed
b2HexColor_b2_colorWheat
b2HexColor_b2_colorWhite
b2HexColor_b2_colorWhiteSmoke
b2HexColor_b2_colorYellow
b2HexColor_b2_colorYellowGreen
b2JointType_b2_distanceJoint
b2JointType_b2_motorJoint
b2JointType_b2_mouseJoint
b2JointType_b2_prismaticJoint
b2JointType_b2_revoluteJoint
b2JointType_b2_weldJoint
b2JointType_b2_wheelJoint
b2ShapeType_b2_capsuleShape
A capsule is an extruded circle
b2ShapeType_b2_chainSegmentShape
A line segment owned by a chain shape
b2ShapeType_b2_circleShape
A circle with an offset
b2ShapeType_b2_polygonShape
A convex polygon
b2ShapeType_b2_segmentShape
A line segment
b2ShapeType_b2_shapeTypeCount
The number of shape types
b2TOIState_b2_toiStateFailed
b2TOIState_b2_toiStateHit
b2TOIState_b2_toiStateOverlapped
b2TOIState_b2_toiStateSeparated
b2TOIState_b2_toiStateUnknown
b2_defaultCategoryBits
b2_maxPolygonVertices
b2_pi
false_
math_errhandling
true_

Statics§

b2Mat22_zero
b2Rot_identity
b2Transform_identity
b2Vec2_zero
@addtogroup math @{
b2_emptyDistanceCache
b2_nullBodyId
b2_nullChainId
b2_nullJointId
b2_nullShapeId
b2_nullWorldId
Use these to make your identifiers null. You may also use zero initialization to get null.
signgam

Functions§

__acos
__acosf
__acosh
__acoshf
__acoshl
__acosl
__asin
__asinf
__asinh
__asinhf
__asinhl
__asinl
__atan
__atan2
__atan2f
__atan2l
__atanf
__atanh
__atanhf
__atanhl
__atanl
__cbrt
__cbrtf
__cbrtl
__ceil
__ceilf
__ceill
__copysign
__copysignf
__copysignl
__cos
__cosf
__cosh
__coshf
__coshl
__cosl
__drem
__dremf
__dreml
__erf
__erfc
__erfcf
__erfcl
__erff
__erfl
__exp
__exp2
__exp2f
__exp2l
__expf
__expl
__expm1
__expm1f
__expm1l
__fabs
__fabsf
__fabsl
__fdim
__fdimf
__fdiml
__finite
__finitef
__finitel
__floor
__floorf
__floorl
__fma
__fmaf
__fmal
__fmax
__fmaxf
__fmaxl
__fmin
__fminf
__fminl
__fmod
__fmodf
__fmodl
__fpclassify
__fpclassifyf
__fpclassifyl
__frexp
__frexpf
__frexpl
__gamma
__gammaf
__gammal
__hypot
__hypotf
__hypotl
__ilogb
__ilogbf
__ilogbl
__iseqsig
__iseqsigf
__iseqsigl
__isinf
__isinff
__isinfl
__isnan
__isnanf
__isnanl
__issignaling
__issignalingf
__issignalingl
__j0
__j0f
__j0l
__j1
__j1f
__j1l
__jn
__jnf
__jnl
__ldexp
__ldexpf
__ldexpl
__lgamma
__lgamma_r
__lgammaf
__lgammaf_r
__lgammal
__lgammal_r
__llrint
__llrintf
__llrintl
__llround
__llroundf
__llroundl
__log
__log2
__log1p
__log1pf
__log1pl
__log2f
__log2l
__log10
__log10f
__log10l
__logb
__logbf
__logbl
__logf
__logl
__lrint
__lrintf
__lrintl
__lround
__lroundf
__lroundl
__modf
__modff
__modfl
__nan
__nanf
__nanl
__nearbyint
__nearbyintf
__nearbyintl
__nextafter
__nextafterf
__nextafterl
__nexttoward
__nexttowardf
__nexttowardl
__pow
__powf
__powl
__remainder
__remainderf
__remainderl
__remquo
__remquof
__remquol
__rint
__rintf
__rintl
__round
__roundf
__roundl
__scalb
__scalbf
__scalbl
__scalbln
__scalblnf
__scalblnl
__scalbn
__scalbnf
__scalbnl
__signbit
__signbitf
__signbitl
__significand
__significandf
__significandl
__sin
__sinf
__sinh
__sinhf
__sinhl
__sinl
__sqrt
__sqrtf
__sqrtl
__tan
__tanf
__tanh
__tanhf
__tanhl
__tanl
__tgamma
__tgammaf
__tgammal
__trunc
__truncf
__truncl
__y0
__y0f
__y0l
__y1
__y1f
__y1l
__yn
__ynf
__ynl
acos
acosf
acosh
acoshf
acoshl
acosl
asin
asinf
asinh
asinhf
asinhl
asinl
atan
atan2
atan2f
atan2l
atanf
atanh
atanhf
atanhl
atanl
b2AABB_IsValid
Is this a valid bounding box? Not Nan or infinity. Upper bound greater than or equal to lower bound.
b2Atan2
Compute an approximate arctangent in the range [-pi, pi] This is hand coded for cross platform determinism. The atan2f function in the standard library is not cross platform deterministic.
b2Body_ApplyAngularImpulse
Apply an angular impulse. The impulse is ignored if the body is not awake. This optionally wakes the body. @param bodyId The body id @param impulse the angular impulse, typically in units of kgmm/s @param wake also wake up the body @warning This should be used for one-shot impulses. If you need a steady force, use a force instead, which will work better with the sub-stepping solver.
b2Body_ApplyForce
Apply a force at a world point. If the force is not applied at the center of mass, it will generate a torque and affect the angular velocity. This optionally wakes up the body. The force is ignored if the body is not awake. @param bodyId The body id @param force The world force vector, typically in newtons (N) @param point The world position of the point of application @param wake Option to wake up the body
b2Body_ApplyForceToCenter
Apply a force to the center of mass. This optionally wakes up the body. The force is ignored if the body is not awake. @param bodyId The body id @param force the world force vector, usually in newtons (N). @param wake also wake up the body
b2Body_ApplyLinearImpulse
Apply an impulse at a point. This immediately modifies the velocity. It also modifies the angular velocity if the point of application is not at the center of mass. This optionally wakes the body. The impulse is ignored if the body is not awake. @param bodyId The body id @param impulse the world impulse vector, typically in Ns or kgm/s. @param point the world position of the point of application. @param wake also wake up the body @warning This should be used for one-shot impulses. If you need a steady force, use a force instead, which will work better with the sub-stepping solver.
b2Body_ApplyLinearImpulseToCenter
Apply an impulse to the center of mass. This immediately modifies the velocity. The impulse is ignored if the body is not awake. This optionally wakes the body. @param bodyId The body id @param impulse the world impulse vector, typically in Ns or kgm/s. @param wake also wake up the body @warning This should be used for one-shot impulses. If you need a steady force, use a force instead, which will work better with the sub-stepping solver.
b2Body_ApplyMassFromShapes
This update the mass properties to the sum of the mass properties of the shapes. This normally does not need to be called unless you called SetMassData to override the mass and you later want to reset the mass. You may also use this when automatic mass computation has been disabled. You should call this regardless of body type.
b2Body_ApplyTorque
Apply a torque. This affects the angular velocity without affecting the linear velocity. This optionally wakes the body. The torque is ignored if the body is not awake. @param bodyId The body id @param torque about the z-axis (out of the screen), typically in N*m. @param wake also wake up the body
b2Body_ComputeAABB
Get the current world AABB that contains all the attached shapes. Note that this may not encompass the body origin. If there are no shapes attached then the returned AABB is empty and centered on the body origin.
b2Body_Disable
Disable a body by removing it completely from the simulation. This is expensive.
b2Body_Enable
Enable a body by adding it to the simulation. This is expensive.
b2Body_EnableHitEvents
Enable/disable hit events on all shapes @see b2ShapeDef::enableHitEvents
b2Body_EnableSleep
Enable or disable sleeping for this body. If sleeping is disabled the body will wake.
b2Body_GetAngularDamping
Get the current angular damping.
b2Body_GetAngularVelocity
Get the angular velocity of a body in radians per second
b2Body_GetAutomaticMass
Get the automatic mass setting
b2Body_GetContactCapacity
Get the maximum capacity required for retrieving all the touching contacts on a body
b2Body_GetContactData
Get the touching contact data for a body
b2Body_GetGravityScale
Get the current gravity scale
b2Body_GetJointCount
Get the number of joints on this body
b2Body_GetJoints
Get the joint ids for all joints on this body, up to the provided capacity @returns the number of joint ids stored in the user array
b2Body_GetLinearDamping
Get the current linear damping.
b2Body_GetLinearVelocity
Get the linear velocity of a body’s center of mass. Typically in meters per second.
b2Body_GetLocalCenterOfMass
Get the center of mass position of the body in local space
b2Body_GetLocalPoint
Get a local point on a body given a world point
b2Body_GetLocalVector
Get a local vector on a body given a world vector
b2Body_GetMass
Get the mass of the body, typically in kilograms
b2Body_GetMassData
Get the mass data for a body
b2Body_GetPosition
Get the world position of a body. This is the location of the body origin.
b2Body_GetRotation
Get the world rotation of a body as a cosine/sine pair (complex number)
b2Body_GetRotationalInertia
Get the rotational inertia of the body, typically in kg*m^2
b2Body_GetShapeCount
Get the number of shapes on this body
b2Body_GetShapes
Get the shape ids for all shapes on this body, up to the provided capacity. @returns the number of shape ids stored in the user array
b2Body_GetSleepThreshold
Get the sleep threshold, typically in meters per second.
b2Body_GetTransform
Get the world transform of a body.
b2Body_GetType
Get the body type: static, kinematic, or dynamic
b2Body_GetUserData
Get the user data stored in a body
b2Body_GetWorld
Get the world that owns this body
b2Body_GetWorldCenterOfMass
Get the center of mass position of the body in world space
b2Body_GetWorldPoint
Get a world point on a body given a local point
b2Body_GetWorldVector
Get a world vector on a body given a local vector
b2Body_IsAwake
@return true if this body is awake
b2Body_IsBullet
Is this body a bullet?
b2Body_IsEnabled
Returns true if this body is enabled
b2Body_IsFixedRotation
Does this body have fixed rotation?
b2Body_IsSleepEnabled
Returns true if sleeping is enabled for this body
b2Body_IsValid
Body identifier validation. Can be used to detect orphaned ids. Provides validation for up to 64K allocations.
b2Body_SetAngularDamping
Adjust the angular damping. Normally this is set in b2BodyDef before creation.
b2Body_SetAngularVelocity
Set the angular velocity of a body in radians per second
b2Body_SetAutomaticMass
Set the automatic mass setting. Normally this is set in b2BodyDef before creation. @see b2BodyDef::automaticMass
b2Body_SetAwake
Wake a body from sleep. This wakes the entire island the body is touching. @warning Putting a body to sleep will put the entire island of bodies touching this body to sleep, which can be expensive and possibly unintuitive.
b2Body_SetBullet
Set this body to be a bullet. A bullet does continuous collision detection against dynamic bodies (but not other bullets).
b2Body_SetFixedRotation
Set this body to have fixed rotation. This causes the mass to be reset in all cases.
b2Body_SetGravityScale
Adjust the gravity scale. Normally this is set in b2BodyDef before creation. @see b2BodyDef::gravityScale
b2Body_SetLinearDamping
Adjust the linear damping. Normally this is set in b2BodyDef before creation.
b2Body_SetLinearVelocity
Set the linear velocity of a body. Typically in meters per second.
b2Body_SetMassData
Override the body’s mass properties. Normally this is computed automatically using the shape geometry and density. This information is lost if a shape is added or removed or if the body type changes.
b2Body_SetSleepThreshold
Set the sleep threshold, typically in meters per second
b2Body_SetTransform
Set the world transform of a body. This acts as a teleport and is fairly expensive. @note Generally you should create a body with then intended transform. @see b2BodyDef::position and b2BodyDef::angle
b2Body_SetType
Change the body type. This is an expensive operation. This automatically updates the mass properties regardless of the automatic mass setting.
b2Body_SetUserData
Set the user data for a body
b2Chain_GetSegmentCount
Get the number of segments on this chain
b2Chain_GetSegments
Fill a user array with chain segment shape ids up to the specified capacity. Returns the actual number of segments returned.
b2Chain_GetWorld
Get the world that owns this chain shape
b2Chain_IsValid
Chain identifier validation. Provides validation for up to 64K allocations.
b2Chain_SetFriction
Set the chain friction @see b2ChainDef::friction
b2Chain_SetRestitution
Set the chain restitution (bounciness) @see b2ChainDef::restitution
b2CollideCapsuleAndCircle
Compute the contact manifold between a capsule and circle
b2CollideCapsules
Compute the contact manifold between a capsule and circle
b2CollideChainSegmentAndCapsule
Compute the contact manifold between a chain segment and a capsule
b2CollideChainSegmentAndCircle
Compute the contact manifold between a chain segment and a circle
b2CollideChainSegmentAndPolygon
Compute the contact manifold between a chain segment and a rounded polygon
b2CollideCircles
Compute the contact manifold between two circles
b2CollidePolygonAndCapsule
Compute the contact manifold between a polygon and capsule
b2CollidePolygonAndCircle
Compute the contact manifold between a polygon and a circle
b2CollidePolygons
Compute the contact manifold between two polygons
b2CollideSegmentAndCapsule
Compute the contact manifold between an segment and a capsule
b2CollideSegmentAndCircle
Compute the contact manifold between an segment and a circle
b2CollideSegmentAndPolygon
Compute the contact manifold between an segment and a polygon
b2ComputeCapsuleAABB
Compute the bounding box of a transformed capsule
b2ComputeCapsuleMass
Compute mass properties of a capsule
b2ComputeCircleAABB
Compute the bounding box of a transformed circle
b2ComputeCircleMass
Compute mass properties of a circle
b2ComputeCosSin
Make a rotation using an angle in radians
b2ComputeHull
Compute the convex hull of a set of points. Returns an empty hull if it fails. Some failure cases:
b2ComputePolygonAABB
Compute the bounding box of a transformed polygon
b2ComputePolygonMass
Compute mass properties of a polygon
b2ComputeSegmentAABB
Compute the bounding box of a transformed line segment
b2CreateBody
Create a rigid body given a definition. No reference to the definition is retained. So you can create the definition on the stack and pass it as a pointer. @code{.c} b2BodyDef bodyDef = b2DefaultBodyDef(); b2BodyId myBodyId = b2CreateBody(myWorldId, &bodyDef); @endcode @warning This function is locked during callbacks.
b2CreateCapsuleShape
Create a capsule shape and attach it to a body. The shape definition and geometry are fully cloned. Contacts are not created until the next time step. @return the shape id for accessing the shape
b2CreateChain
Create a chain shape @see b2ChainDef for details
b2CreateCircleShape
Create a circle shape and attach it to a body. The shape definition and geometry are fully cloned. Contacts are not created until the next time step. @return the shape id for accessing the shape
b2CreateDistanceJoint
Create a distance joint @see b2DistanceJointDef for details
b2CreateMotorJoint
Create a motor joint @see b2MotorJointDef for details
b2CreateMouseJoint
Create a mouse joint @see b2MouseJointDef for details
b2CreatePolygonShape
Create a polygon shape and attach it to a body. The shape definition and geometry are fully cloned. Contacts are not created until the next time step. @return the shape id for accessing the shape
b2CreatePrismaticJoint
Create a prismatic (slider) joint. @see b2PrismaticJointDef for details
b2CreateRevoluteJoint
Create a revolute joint @see b2RevoluteJointDef for details
b2CreateSegmentShape
Create a line segment shape and attach it to a body. The shape definition and geometry are fully cloned. Contacts are not created until the next time step. @return the shape id for accessing the shape
b2CreateTimer
b2CreateWeldJoint
Create a weld joint @see b2WeldJointDef for details
b2CreateWheelJoint
Create a wheel joint @see b2WheelJointDef for details
b2CreateWorld
Create a world for rigid body simulation. A world contains bodies, shapes, and constraints. You make create up to 128 worlds. Each world is completely independent and may be simulated in parallel. @return the world id.
b2DefaultBodyDef
Use this to initialize your body definition @ingroup body
b2DefaultChainDef
Use this to initialize your chain definition @ingroup shape
b2DefaultDebugDraw
Use this to initialize your drawing interface. This allows you to implement a sub-set of the drawing functions.
b2DefaultDistanceJointDef
Use this to initialize your joint definition @ingroup distance_joint
b2DefaultFilter
Use this to initialize your filter @ingroup shape
b2DefaultMotorJointDef
Use this to initialize your joint definition @ingroup motor_joint
b2DefaultMouseJointDef
Use this to initialize your joint definition @ingroup mouse_joint
b2DefaultPrismaticJointDef
Use this to initialize your joint definition @ingroupd prismatic_joint
b2DefaultQueryFilter
Use this to initialize your query filter @ingroup shape
b2DefaultRevoluteJointDef
Use this to initialize your joint definition. @ingroup revolute_joint
b2DefaultShapeDef
Use this to initialize your shape definition @ingroup shape
b2DefaultWeldJointDef
Use this to initialize your joint definition @ingroup weld_joint
b2DefaultWheelJointDef
Use this to initialize your joint definition @ingroup wheel_joint
b2DefaultWorldDef
Use this to initialize your world definition @ingroup world
b2DestroyBody
Destroy a rigid body given an id. This destroys all shapes and joints attached to the body. Do not keep references to the associated shapes and joints.
b2DestroyChain
Destroy a chain shape
b2DestroyJoint
Destroy a joint
b2DestroyShape
Destroy a shape
b2DestroyWorld
Destroy a world
b2DistanceJoint_EnableLimit
Enable joint limit. The limit only works if the joint spring is enabled. Otherwise the joint is rigid and the limit has no effect.
b2DistanceJoint_EnableMotor
Enable/disable the distance joint motor
b2DistanceJoint_EnableSpring
Enable/disable the distance joint spring. When disabled the distance joint is rigid.
b2DistanceJoint_GetCurrentLength
Get the current length of a distance joint
b2DistanceJoint_GetLength
Get the rest length of a distance joint
b2DistanceJoint_GetMaxLength
Get the distance joint maximum length
b2DistanceJoint_GetMaxMotorForce
Get the distance joint maximum motor force, typically in newtons
b2DistanceJoint_GetMinLength
Get the distance joint minimum length
b2DistanceJoint_GetMotorForce
Get the distance joint current motor force, typically in newtons
b2DistanceJoint_GetMotorSpeed
Get the distance joint motor speed, typically in meters per second
b2DistanceJoint_GetSpringDampingRatio
Get the spring damping ratio
b2DistanceJoint_GetSpringHertz
Get the spring Hertz
b2DistanceJoint_IsLimitEnabled
Is the distance joint limit enabled?
b2DistanceJoint_IsMotorEnabled
Is the distance joint motor enabled?
b2DistanceJoint_IsSpringEnabled
Is the distance joint spring enabled?
b2DistanceJoint_SetLength
Set the rest length of a distance joint @param jointId The id for a distance joint @param length The new distance joint length
b2DistanceJoint_SetLengthRange
Set the minimum and maximum length parameters of a distance joint
b2DistanceJoint_SetMaxMotorForce
Set the distance joint maximum motor force, typically in newtons
b2DistanceJoint_SetMotorSpeed
Set the distance joint motor speed, typically in meters per second
b2DistanceJoint_SetSpringDampingRatio
Set the spring damping ratio, non-dimensional
b2DistanceJoint_SetSpringHertz
Set the spring stiffness in Hertz
b2DynamicTree_Create
Constructing the tree initializes the node pool.
b2DynamicTree_CreateProxy
Create a proxy. Provide an AABB and a userData value.
b2DynamicTree_Destroy
Destroy the tree, freeing the node pool.
b2DynamicTree_DestroyProxy
Destroy a proxy. This asserts if the id is invalid.
b2DynamicTree_EnlargeProxy
Enlarge a proxy and enlarge ancestors as necessary.
b2DynamicTree_GetAreaRatio
Get the ratio of the sum of the node areas to the root area.
b2DynamicTree_GetByteCount
Get the number of bytes used by this tree
b2DynamicTree_GetHeight
Compute the height of the binary tree in O(N) time. Should not be called often.
b2DynamicTree_GetMaxBalance
Get the maximum balance of the tree. The balance is the difference in height of the two children of a node.
b2DynamicTree_GetProxyCount
Get the number of proxies created
b2DynamicTree_MoveProxy
Move a proxy to a new AABB by removing and reinserting into the tree.
b2DynamicTree_Query
Query an AABB for overlapping proxies. The callback class is called for each proxy that overlaps the supplied AABB.
b2DynamicTree_RayCast
Ray-cast against the proxies in the tree. This relies on the callback to perform a exact ray-cast in the case were the proxy contains a shape. The callback also performs the any collision filtering. This has performance roughly equal to k * log(n), where k is the number of collisions and n is the number of proxies in the tree. Bit-wise filtering using mask bits can greatly improve performance in some scenarios. @param tree the dynamic tree to ray cast @param input the ray-cast input data. The ray extends from p1 to p1 + maxFraction * (p2 - p1) @param maskBits filter bits: bool accept = (maskBits & node->categoryBits) != 0; @param callback a callback class that is called for each proxy that is hit by the ray @param context user context that is passed to the callback
b2DynamicTree_Rebuild
Rebuild the tree while retaining subtrees that haven’t changed. Returns the number of boxes sorted.
b2DynamicTree_RebuildBottomUp
Build an optimal tree. Very expensive. For testing.
b2DynamicTree_ShapeCast
Ray-cast against the proxies in the tree. This relies on the callback to perform a exact ray-cast in the case were the proxy contains a shape. The callback also performs the any collision filtering. This has performance roughly equal to k * log(n), where k is the number of collisions and n is the number of proxies in the tree. @param tree the dynamic tree to ray cast @param input the ray-cast input data. The ray extends from p1 to p1 + maxFraction * (p2 - p1). @param maskBits filter bits: bool accept = (maskBits & node->categoryBits) != 0; @param callback a callback class that is called for each proxy that is hit by the shape @param context user context that is passed to the callback
b2DynamicTree_ShiftOrigin
Shift the world origin. Useful for large worlds. The shift formula is: position -= newOrigin @param tree the tree to shift @param newOrigin the new origin with respect to the old origin
b2DynamicTree_Validate
Validate this tree. For testing.
b2GetByteCount
@return the total bytes allocated by Box2D
b2GetLengthUnitsPerMeter
Get the current length units per meter.
b2GetMilliseconds
b2GetMillisecondsAndReset
b2GetSweepTransform
Evaluate the transform sweep at a specific time.
b2GetTicks
b2GetVersion
Get the current version of Box2D
b2Hash
b2IsValid
Is this a valid number? Not NaN or infinity.
b2IsValidRay
Validate ray cast input data (NaN, etc)
b2Joint_GetBodyA
Get body A id on a joint
b2Joint_GetBodyB
Get body B id on a joint
b2Joint_GetCollideConnected
Is collision allowed between connected bodies?
b2Joint_GetConstraintForce
Get the current constraint force for this joint
b2Joint_GetConstraintTorque
Get the current constraint torque for this joint
b2Joint_GetLocalAnchorA
Get the local anchor on bodyA
b2Joint_GetLocalAnchorB
Get the local anchor on bodyB
b2Joint_GetType
Get the joint type
b2Joint_GetUserData
Get the user data on a joint
b2Joint_GetWorld
Get the world that owns this joint
b2Joint_IsValid
Joint identifier validation. Provides validation for up to 64K allocations.
b2Joint_SetCollideConnected
Toggle collision between connected bodies
b2Joint_SetUserData
Set the user data on a joint
b2Joint_WakeBodies
Wake the bodies connect to this joint
b2MakeBox
Make a box (rectangle) polygon, bypassing the need for a convex hull. @param hx the half-width @param hy the half-height
b2MakeOffsetBox
Make an offset box, bypassing the need for a convex hull. @param hx the half-width @param hy the half-height @param center the local position of the center of the box @param rotation the local rotation of the box
b2MakeOffsetPolygon
Make an offset convex polygon from a convex hull. This will assert if the hull is not valid. @warning Do not manually fill in the hull data, it must come directly from b2ComputeHull
b2MakePolygon
Make a convex polygon from a convex hull. This will assert if the hull is not valid. @warning Do not manually fill in the hull data, it must come directly from b2ComputeHull
b2MakeProxy
Make a proxy for use in GJK and related functions.
b2MakeRoundedBox
Make a rounded box, bypassing the need for a convex hull. @param hx the half-width @param hy the half-height @param radius the radius of the rounded extension
b2MakeSquare
Make a square polygon, bypassing the need for a convex hull. @param h the half-width
b2MotorJoint_GetAngularOffset
Get the motor joint angular offset target in radians
b2MotorJoint_GetCorrectionFactor
Get the motor joint correction factor, typically in [0, 1]
b2MotorJoint_GetLinearOffset
Get the motor joint linear offset target
b2MotorJoint_GetMaxForce
Get the motor joint maximum force, typically in newtons
b2MotorJoint_GetMaxTorque
Get the motor joint maximum torque, typically in newton-meters
b2MotorJoint_SetAngularOffset
Set the motor joint angular offset target in radians
b2MotorJoint_SetCorrectionFactor
Set the motor joint correction factor, typically in [0, 1]
b2MotorJoint_SetLinearOffset
Set the motor joint linear offset target
b2MotorJoint_SetMaxForce
Set the motor joint maximum force, typically in newtons
b2MotorJoint_SetMaxTorque
Set the motor joint maximum torque, typically in newton-meters
b2MouseJoint_GetMaxForce
Get the mouse joint maximum force, typically in newtons
b2MouseJoint_GetSpringDampingRatio
Get the mouse joint damping ratio, non-dimensional
b2MouseJoint_GetSpringHertz
Get the mouse joint spring stiffness in Hertz
b2MouseJoint_GetTarget
Get the mouse joint target
b2MouseJoint_SetMaxForce
Set the mouse joint maximum force, typically in newtons
b2MouseJoint_SetSpringDampingRatio
Set the mouse joint spring damping ratio, non-dimensional
b2MouseJoint_SetSpringHertz
Set the mouse joint spring stiffness in Hertz
b2MouseJoint_SetTarget
Set the mouse joint target
b2PointInCapsule
Test a point for overlap with a capsule in local space
b2PointInCircle
Test a point for overlap with a circle in local space
b2PointInPolygon
Test a point for overlap with a convex polygon in local space
b2PrismaticJoint_EnableLimit
Enable/disable a prismatic joint limit
b2PrismaticJoint_EnableMotor
Enable/disable a prismatic joint motor
b2PrismaticJoint_EnableSpring
Enable/disable the joint spring.
b2PrismaticJoint_GetLowerLimit
Get the prismatic joint lower limit
b2PrismaticJoint_GetMaxMotorForce
Get the prismatic joint maximum motor force, typically in newtons
b2PrismaticJoint_GetMotorForce
Get the prismatic joint current motor force, typically in newtons
b2PrismaticJoint_GetMotorSpeed
Get the prismatic joint motor speed, typically in meters per second
b2PrismaticJoint_GetSpringDampingRatio
Get the prismatic spring damping ratio (non-dimensional)
b2PrismaticJoint_GetSpringHertz
Get the prismatic joint stiffness in Hertz
b2PrismaticJoint_GetUpperLimit
Get the prismatic joint upper limit
b2PrismaticJoint_IsLimitEnabled
Is the prismatic joint limit enabled?
b2PrismaticJoint_IsMotorEnabled
Is the prismatic joint motor enabled?
b2PrismaticJoint_IsSpringEnabled
Is the prismatic joint spring enabled or not?
b2PrismaticJoint_SetLimits
Set the prismatic joint limits
b2PrismaticJoint_SetMaxMotorForce
Set the prismatic joint maximum motor force, typically in newtons
b2PrismaticJoint_SetMotorSpeed
Set the prismatic joint motor speed, typically in meters per second
b2PrismaticJoint_SetSpringDampingRatio
Set the prismatic joint damping ratio (non-dimensional)
b2PrismaticJoint_SetSpringHertz
Set the prismatic joint stiffness in Hertz. This should usually be less than a quarter of the simulation rate. For example, if the simulation runs at 60Hz then the joint stiffness should be 15Hz or less.
b2RayCastCapsule
Ray cast versus capsule in shape local space. Initial overlap is treated as a miss.
b2RayCastCircle
Ray cast versus circle in shape local space. Initial overlap is treated as a miss.
b2RayCastPolygon
Ray cast versus polygon in shape local space. Initial overlap is treated as a miss.
b2RayCastSegment
Ray cast versus segment in shape local space. Optionally treat the segment as one-sided with hits from the left side being treated as a miss.
b2RevoluteJoint_EnableLimit
Enable/disable the revolute joint limit
b2RevoluteJoint_EnableMotor
Enable/disable a revolute joint motor
b2RevoluteJoint_EnableSpring
Enable/disable the revolute joint spring
b2RevoluteJoint_GetAngle
Get the revolute joint current angle in radians relative to the reference angle @see b2RevoluteJointDef::referenceAngle
b2RevoluteJoint_GetLowerLimit
Get the revolute joint lower limit in radians
b2RevoluteJoint_GetMaxMotorTorque
Get the revolute joint maximum motor torque, typically in newton-meters
b2RevoluteJoint_GetMotorSpeed
Get the revolute joint motor speed in radians per second
b2RevoluteJoint_GetMotorTorque
Get the revolute joint current motor torque, typically in newton-meters
b2RevoluteJoint_GetSpringDampingRatio
Get the revolute joint spring damping ratio, non-dimensional
b2RevoluteJoint_GetSpringHertz
Get the revolute joint spring stiffness in Hertz
b2RevoluteJoint_GetUpperLimit
Get the revolute joint upper limit in radians
b2RevoluteJoint_IsLimitEnabled
Is the revolute joint limit enabled?
b2RevoluteJoint_IsMotorEnabled
Is the revolute joint motor enabled?
b2RevoluteJoint_IsSpringEnabled
It the revolute angular spring enabled?
b2RevoluteJoint_SetLimits
Set the revolute joint limits in radians
b2RevoluteJoint_SetMaxMotorTorque
Set the revolute joint maximum motor torque, typically in newton-meters
b2RevoluteJoint_SetMotorSpeed
Set the revolute joint motor speed in radians per second
b2RevoluteJoint_SetSpringDampingRatio
Set the revolute joint spring damping ratio, non-dimensional
b2RevoluteJoint_SetSpringHertz
Set the revolute joint spring stiffness in Hertz
b2Rot_IsValid
Is this a valid rotation? Not NaN or infinity. Is normalized.
b2SegmentDistance
Compute the distance between two line segments, clamping at the end points if needed.
b2SetAllocator
This allows the user to override the allocation functions. These should be set during application startup.
b2SetAssertFcn
Override the default assert callback @param assertFcn a non-null assert callback
b2SetLengthUnitsPerMeter
Box2D bases all length units on meters, but you may need different units for your game. You can set this value to use different units. This should be done at application startup and only modified once. Default value is 1. @warning This must be modified before any calls to Box2D
b2ShapeCast
Perform a linear shape cast of shape B moving and shape A fixed. Determines the hit point, normal, and translation fraction.
b2ShapeCastCapsule
Shape cast versus a capsule. Initial overlap is treated as a miss.
b2ShapeCastCircle
Shape cast versus a circle. Initial overlap is treated as a miss.
b2ShapeCastPolygon
Shape cast versus a convex polygon. Initial overlap is treated as a miss.
b2ShapeCastSegment
Shape cast versus a line segment. Initial overlap is treated as a miss.
b2ShapeDistance
Compute the closest points between two shapes represented as point clouds. b2DistanceCache cache is input/output. On the first call set b2DistanceCache.count to zero. The underlying GJK algorithm may be debugged by passing in debug simplexes and capacity. You may pass in NULL and 0 for these.
b2Shape_AreContactEventsEnabled
Returns true if contact events are enabled
b2Shape_AreHitEventsEnabled
Returns true if hit events are enabled
b2Shape_ArePreSolveEventsEnabled
Returns true if pre-solve events are enabled
b2Shape_AreSensorEventsEnabled
Returns true if sensor events are enabled
b2Shape_EnableContactEvents
Enable contact events for this shape. Only applies to kinematic and dynamic bodies. Ignored for sensors. @see b2ShapeDef::enableContactEvents
b2Shape_EnableHitEvents
Enable contact hit events for this shape. Ignored for sensors. @see b2WorldDef.hitEventThreshold
b2Shape_EnablePreSolveEvents
Enable pre-solve contact events for this shape. Only applies to dynamic bodies. These are expensive and must be carefully handled due to multithreading. Ignored for sensors. @see b2PreSolveFcn
b2Shape_EnableSensorEvents
Enable sensor events for this shape. Only applies to kinematic and dynamic bodies. Ignored for sensors. @see b2ShapeDef::isSensor
b2Shape_GetAABB
Get the current world AABB
b2Shape_GetBody
Get the id of the body that a shape is attached to
b2Shape_GetCapsule
Get a copy of the shape’s capsule. Asserts the type is correct.
b2Shape_GetChainSegment
Get a copy of the shape’s chain segment. These come from chain shapes. Asserts the type is correct.
b2Shape_GetCircle
Get a copy of the shape’s circle. Asserts the type is correct.
b2Shape_GetClosestPoint
Get the closest point on a shape to a target point. Target and result are in world space.
b2Shape_GetContactCapacity
Get the maximum capacity required for retrieving all the touching contacts on a shape
b2Shape_GetContactData
Get the touching contact data for a shape. The provided shapeId will be either shapeIdA or shapeIdB on the contact data.
b2Shape_GetDensity
Get the density of a shape, typically in kg/m^2
b2Shape_GetFilter
Get the shape filter
b2Shape_GetFriction
Get the friction of a shape
b2Shape_GetParentChain
Get the parent chain id if the shape type is a chain segment, otherwise returns b2_nullChainId.
b2Shape_GetPolygon
Get a copy of the shape’s convex polygon. Asserts the type is correct.
b2Shape_GetRestitution
Get the shape restitution
b2Shape_GetSegment
Get a copy of the shape’s line segment. Asserts the type is correct.
b2Shape_GetType
Get the type of a shape
b2Shape_GetUserData
Get the user data for a shape. This is useful when you get a shape id from an event or query.
b2Shape_GetWorld
Get the world that owns this shape
b2Shape_IsSensor
Returns true If the shape is a sensor
b2Shape_IsValid
Shape identifier validation. Provides validation for up to 64K allocations.
b2Shape_RayCast
Ray cast a shape directly
b2Shape_SetCapsule
Allows you to change a shape to be a capsule or update the current capsule. This does not modify the mass properties. @see b2Body_ApplyMassFromShapes
b2Shape_SetCircle
Allows you to change a shape to be a circle or update the current circle. This does not modify the mass properties. @see b2Body_ApplyMassFromShapes
b2Shape_SetDensity
Set the mass density of a shape, typically in kg/m^2. This will not update the mass properties on the parent body. @see b2ShapeDef::density, b2Body_ApplyMassFromShapes
b2Shape_SetFilter
Set the current filter. This is almost as expensive as recreating the shape. @see b2ShapeDef::filter
b2Shape_SetFriction
Set the friction on a shape @see b2ShapeDef::friction
b2Shape_SetPolygon
Allows you to change a shape to be a polygon or update the current polygon. This does not modify the mass properties. @see b2Body_ApplyMassFromShapes
b2Shape_SetRestitution
Set the shape restitution (bounciness) @see b2ShapeDef::restitution
b2Shape_SetSegment
Allows you to change a shape to be a segment or update the current segment.
b2Shape_SetUserData
Set the user data for a shape
b2Shape_TestPoint
Test a point for overlap with a shape
b2SleepMilliseconds
b2TimeOfImpact
Compute the upper bound on time before two shapes penetrate. Time is represented as a fraction between [0,tMax]. This uses a swept separating axis and may miss some intermediate, non-tunneling collisions. If you change the time interval, you should call this function again.
b2TransformPolygon
Transform a polygon. This is useful for transferring a shape from one body to another.
b2ValidateHull
This determines if a hull is valid. Checks for:
b2Vec2_IsValid
Is this a valid vector? Not NaN or infinity.
b2WeldJoint_GetAngularDampingRatio
Get the weld joint angular damping ratio, non-dimensional
b2WeldJoint_GetAngularHertz
Get the weld joint angular stiffness in Hertz
b2WeldJoint_GetLinearDampingRatio
Get the weld joint linear damping ratio (non-dimensional)
b2WeldJoint_GetLinearHertz
Get the weld joint linear stiffness in Hertz
b2WeldJoint_SetAngularDampingRatio
Set weld joint angular damping ratio, non-dimensional
b2WeldJoint_SetAngularHertz
Set the weld joint angular stiffness in Hertz. 0 is rigid.
b2WeldJoint_SetLinearDampingRatio
Set the weld joint linear damping ratio (non-dimensional)
b2WeldJoint_SetLinearHertz
Set the weld joint linear stiffness in Hertz. 0 is rigid.
b2WheelJoint_EnableLimit
Enable/disable the wheel joint limit
b2WheelJoint_EnableMotor
Enable/disable the wheel joint motor
b2WheelJoint_EnableSpring
Enable/disable the wheel joint spring
b2WheelJoint_GetLowerLimit
Get the wheel joint lower limit
b2WheelJoint_GetMaxMotorTorque
Get the wheel joint maximum motor torque, typically in newton-meters
b2WheelJoint_GetMotorSpeed
Get the wheel joint motor speed in radians per second
b2WheelJoint_GetMotorTorque
Get the wheel joint current motor torque, typically in newton-meters
b2WheelJoint_GetSpringDampingRatio
Get the wheel joint damping ratio, non-dimensional
b2WheelJoint_GetSpringHertz
Get the wheel joint stiffness in Hertz
b2WheelJoint_GetUpperLimit
Get the wheel joint upper limit
b2WheelJoint_IsLimitEnabled
Is the wheel joint limit enabled?
b2WheelJoint_IsMotorEnabled
Is the wheel joint motor enabled?
b2WheelJoint_IsSpringEnabled
Is the wheel joint spring enabled?
b2WheelJoint_SetLimits
Set the wheel joint limits
b2WheelJoint_SetMaxMotorTorque
Set the wheel joint maximum motor torque, typically in newton-meters
b2WheelJoint_SetMotorSpeed
Set the wheel joint motor speed in radians per second
b2WheelJoint_SetSpringDampingRatio
Set the wheel joint damping ratio, non-dimensional
b2WheelJoint_SetSpringHertz
Set the wheel joint stiffness in Hertz
b2World_CastCapsule
Cast a capsule through the world. Similar to a cast ray except that a capsule is cast instead of a point.
b2World_CastCircle
Cast a circle through the world. Similar to a cast ray except that a circle is cast instead of a point.
b2World_CastPolygon
Cast a polygon through the world. Similar to a cast ray except that a polygon is cast instead of a point.
b2World_CastRay
Cast a ray into the world to collect shapes in the path of the ray. Your callback function controls whether you get the closest point, any point, or n-points. The ray-cast ignores shapes that contain the starting point. @param worldId The world to cast the ray against @param origin The start point of the ray @param translation The translation of the ray from the start point to the end point @param filter Contains bit flags to filter unwanted shapes from the results @param fcn A user implemented callback function @param context A user context that is passed along to the callback function @note The callback function may receive shapes in any order
b2World_CastRayClosest
Cast a ray into the world to collect the closest hit. This is a convenience function. This is less general than b2World_CastRay() and does not allow for custom filtering.
b2World_Draw
Call this to draw shapes and other debug draw data
b2World_DumpMemoryStats
Dump memory stats to box2d_memory.txt
b2World_EnableContinuous
Enable/disable continuous collision between dynamic and static bodies. Generally you should keep continuous collision enabled to prevent fast moving objects from going through static objects. The performance gain from disabling continuous collision is minor. @see b2WorldDef
b2World_EnableSleeping
Enable/disable sleep. If your application does not need sleeping, you can gain some performance by disabling sleep completely at the world level. @see b2WorldDef
b2World_EnableWarmStarting
Enable/disable constraint warm starting. Advanced feature for testing. Disabling sleeping greatly reduces stability and provides no performance gain.
b2World_Explode
Apply a radial explosion @param worldId The world id @param position The center of the explosion @param radius The radius of the explosion @param impulse The impulse of the explosion, typically in kg * m / s or N * s.
b2World_GetBodyEvents
Get the body events for the current time step. The event data is transient. Do not store a reference to this data.
b2World_GetContactEvents
Get contact events for this current time step. The event data is transient. Do not store a reference to this data.
b2World_GetCounters
Get world counters and sizes
b2World_GetGravity
Get the gravity vector
b2World_GetHitEventThreshold
Get the the hit event speed threshold. Typically in meters per second.
b2World_GetProfile
Get the current world performance profile
b2World_GetRestitutionThreshold
Get the the restitution speed threshold. Typically in meters per second.
b2World_GetSensorEvents
Get sensor events for the current time step. The event data is transient. Do not store a reference to this data.
b2World_IsContinuousEnabled
Is continuous collision enabled?
b2World_IsSleepingEnabled
Is body sleeping enabled?
b2World_IsValid
World id validation. Provides validation for up to 64K allocations.
b2World_IsWarmStartingEnabled
Is constraint warm starting enabled?
b2World_OverlapAABB
Overlap test for all shapes that potentially overlap the provided AABB
b2World_OverlapCapsule
Overlap test for all shapes that overlap the provided capsule
b2World_OverlapCircle
Overlap test for for all shapes that overlap the provided circle
b2World_OverlapPolygon
Overlap test for all shapes that overlap the provided polygon
b2World_SetContactTuning
Adjust contact tuning parameters @param worldId The world id @param hertz The contact stiffness (cycles per second) @param dampingRatio The contact bounciness with 1 being critical damping (non-dimensional) @param pushVelocity The maximum contact constraint push out velocity (meters per second) @note Advanced feature
b2World_SetCustomFilterCallback
Register the custom filter callback. This is optional.
b2World_SetGravity
Set the gravity vector for the entire world. Box2D has no concept of an up direction and this is left as a decision for the application. Typically in m/s^2. @see b2WorldDef
b2World_SetHitEventThreshold
Adjust the hit event threshold. This controls the collision velocity needed to generate a b2ContactHitEvent. Typically in meters per second. @see b2WorldDef::hitEventThreshold
b2World_SetPreSolveCallback
Register the pre-solve callback. This is optional.
b2World_SetRestitutionThreshold
Adjust the restitution threshold. It is recommended not to make this value very small because it will prevent bodies from sleeping. Typically in meters per second. @see b2WorldDef
b2World_Step
Simulate a world for one time step. This performs collision detection, integration, and constraint solution. @param worldId The world to simulate @param timeStep The amount of time to simulate, this should be a fixed number. Typically 1/60. @param subStepCount The number of sub-steps, increasing the sub-step count can increase accuracy. Typically 4.
b2Yield
cbrt
cbrtf
cbrtl
ceil
ceilf
ceill
copysign
copysignf
copysignl
cos
cosf
cosh
coshf
coshl
cosl
drem
dremf
dreml
erf
erfc
erfcf
erfcl
erff
erfl
exp
exp2
exp2f
exp2l
expf
expl
expm1
expm1f
expm1l
fabs
fabsf
fabsl
fdim
fdimf
fdiml
finite
finitef
finitel
floor
floorf
floorl
fma
fmaf
fmal
fmax
fmaxf
fmaxl
fmin
fminf
fminl
fmod
fmodf
fmodl
frexp
frexpf
frexpl
gamma
gammaf
gammal
hypot
hypotf
hypotl
ilogb
ilogbf
ilogbl
isinf
isinff
isinfl
isnan
isnanf
isnanl
j0
j0f
j0l
j1
j1f
j1l
jn
jnf
jnl
ldexp
ldexpf
ldexpl
lgamma
lgamma_r
lgammaf
lgammaf_r
lgammal
lgammal_r
llrint
llrintf
llrintl
llround
llroundf
llroundl
log
log2
log1p
log1pf
log1pl
log2f
log2l
log10
log10f
log10l
logb
logbf
logbl
logf
logl
lrint
lrintf
lrintl
lround
lroundf
lroundl
modf
modff
modfl
nan
nanf
nanl
nearbyint
nearbyintf
nearbyintl
nextafter
nextafterf
nextafterl
nexttoward
nexttowardf
nexttowardl
pow
powf
powl
remainder
remainderf
remainderl
remquo
remquof
remquol
rint
rintf
rintl
round
roundf
roundl
scalb
scalbf
scalbl
scalbln
scalblnf
scalblnl
scalbn
scalbnf
scalbnl
significand
significandf
significandl
sin
sinf
sinh
sinhf
sinhl
sinl
sqrt
sqrtf
sqrtl
tan
tanf
tanh
tanhf
tanhl
tanl
tgamma
tgammaf
tgammal
trunc
truncf
truncl
y0
y0f
y0l
y1
y1f
y1l
yn
ynf
ynl

Type Aliases§

_Float32
_Float64
_Float32x
_Float64x
__blkcnt64_t
__blkcnt_t
__blksize_t
__caddr_t
__clock_t
__clockid_t
__daddr_t
__dev_t
__fsblkcnt64_t
__fsblkcnt_t
__fsfilcnt64_t
__fsfilcnt_t
__fsword_t
__gid_t
__id_t
__ino64_t
__ino_t
__int8_t
__int16_t
__int32_t
__int64_t
__int_least8_t
__int_least16_t
__int_least32_t
__int_least64_t
__intmax_t
__intptr_t
__key_t
__loff_t
__mode_t
__nlink_t
__off64_t
__off_t
__pid_t
__quad_t
__rlim64_t
__rlim_t
__sig_atomic_t
__socklen_t
__ssize_t
__suseconds64_t
__suseconds_t
__syscall_slong_t
__syscall_ulong_t
__time_t
__timer_t
__u_char
__u_int
__u_long
__u_quad_t
__u_short
__uid_t
__uint8_t
__uint16_t
__uint32_t
__uint64_t
__uint_least8_t
__uint_least16_t
__uint_least32_t
__uint_least64_t
__uintmax_t
__useconds_t
_bindgen_ty_1
b2AllocFcn
Prototype for user allocation function @param size the allocation size in bytes @param alignment the required alignment, guaranteed to be a power of 2
b2AssertFcn
Prototype for the user assert callback. Return 0 to skip the debugger break.
b2BodyType
The body simulation type. Each body is one of these three types. The type determines how the body behaves in the simulation. @ingroup body
b2CastResultFcn
Prototype callback for ray casts. Called for each shape found in the query. You control how the ray cast proceeds by returning a float: return -1: ignore this shape and continue return 0: terminate the ray cast return fraction: clip the ray to this point return 1: don’t clip the ray and continue @param shapeId the shape hit by the ray @param point the point of initial intersection @param normal the normal vector at the point of intersection @param fraction the fraction along the ray at the point of intersection @param context the user context @return -1 to filter, 0 to terminate, fraction to clip the ray for closest hit, 1 to continue @see b2World_CastRay @ingroup world
b2CustomFilterFcn
Prototype for a contact filter callback. This is called when a contact pair is considered for collision. This allows you to perform custom logic to prevent collision between shapes. This is only called if one of the two shapes has custom filtering enabled. @see b2ShapeDef. Notes:
b2EnqueueTaskCallback
These functions can be provided to Box2D to invoke a task system. These are designed to work well with enkiTS. Returns a pointer to the user’s task object. May be nullptr. A nullptr indicates to Box2D that the work was executed serially within the callback and there is no need to call b2FinishTaskCallback. The itemCount is the number of Box2D work items that are to be partitioned among workers by the user’s task system. This is essentially a parallel-for. The minRange parameter is a suggestion of the minimum number of items to assign per worker to reduce overhead. For example, suppose the task is small and that itemCount is 16. A minRange of 8 suggests that your task system should split the work items among just two workers, even if you have more available. In general the range [startIndex, endIndex) send to b2TaskCallback should obey: endIndex - startIndex >= minRange The exception of course is when itemCount < minRange. @ingroup world
b2FinishTaskCallback
Finishes a user task object that wraps a Box2D task. @ingroup world
b2FreeFcn
Prototype for user free function @param mem the memory previously allocated through b2AllocFcn
b2HexColor
These colors are used for debug draw. See https://www.rapidtables.com/web/color/index.html
b2JointType
Joint type enumeration
b2OverlapResultFcn
Prototype callback for overlap queries. Called for each shape found in the query. @see b2World_QueryAABB @return false to terminate the query. @ingroup world
b2PreSolveFcn
Prototype for a pre-solve callback. This is called after a contact is updated. This allows you to inspect a contact before it goes to the solver. If you are careful, you can modify the contact manifold (e.g. modify the normal). Notes:
b2ShapeType
Shape type @ingroup shape
b2TOIState
Describes the TOI output
b2TaskCallback
Task interface This is prototype for a Box2D task. Your task system is expected to invoke the Box2D task with these arguments. The task spans a range of the parallel-for: [startIndex, endIndex) The worker index must correctly identify each worker in the user thread pool, expected in [0, workerCount). A worker must only exist on only one thread at a time and is analogous to the thread index. The task context is the context pointer sent from Box2D when it is enqueued. The startIndex and endIndex are expected in the range [0, itemCount) where itemCount is the argument to b2EnqueueTaskCallback below. Box2D expects startIndex < endIndex and will execute a loop like this:
b2TreeQueryCallbackFcn
This function receives proxies found in the AABB query. @return true if the query should continue
b2TreeRayCastCallbackFcn
This function receives clipped raycast input for a proxy. The function returns the new ray fraction.
b2TreeShapeCastCallbackFcn
This function receives clipped ray-cast input for a proxy. The function returns the new ray fraction.
double_t
float_t
int_fast8_t
int_fast16_t
int_fast32_t
int_fast64_t
int_least8_t
int_least16_t
int_least32_t
int_least64_t
intmax_t
uint_fast8_t
uint_fast16_t
uint_fast32_t
uint_fast64_t
uint_least8_t
uint_least16_t
uint_least32_t
uint_least64_t
uintmax_t

Unions§

b2TreeNode__bindgen_ty_1