Structs§
- Chain
Shape - Internal chain shape. (b2ChainShape)
- Shape
- Internal shape. (b2Shape)
- Shape
Extent - (b2ShapeExtent)
Functions§
- chain_
get_ segment_ count - Get the number of segments on this chain. (b2Chain_GetSegmentCount)
- chain_
get_ segments - Get the segment shape ids for a chain, up to
capacity. (b2Chain_GetSegments — returns a Vec instead of filling a caller array) - chain_
get_ surface_ material - Get a chain surface material by segment index. (b2Chain_GetSurfaceMaterial)
- chain_
get_ surface_ material_ count - Get the number of chain surface materials: 1 (shared) or the segment count. (b2Chain_GetSurfaceMaterialCount)
- chain_
is_ valid - Chain id validity. (b2Chain_IsValid — the world-registry check collapses to the index/generation check in the registry-less port)
- chain_
set_ surface_ material - Set a chain surface material, propagating it to the affected segment shape(s). (b2Chain_SetSurfaceMaterial)
- collide_
mover - (b2CollideMover)
- compute_
shape_ aabb - (b2ComputeShapeAABB)
- compute_
shape_ extent - (b2ComputeShapeExtent)
- compute_
shape_ mass - (b2ComputeShapeMass)
- create_
capsule_ shape - (b2CreateCapsuleShape)
- create_
chain - Create a chain shape: a sequence of chain segments attached to a body. The def must have at least 4 points. (b2CreateChain)
- create_
chain_ segment_ shape - (b2CreateChainSegmentShape)
- create_
circle_ shape - (b2CreateCircleShape)
- create_
polygon_ shape - (b2CreatePolygonShape)
- create_
segment_ shape - (b2CreateSegmentShape)
- create_
shape_ proxy - (b2CreateShapeProxy)
- destroy_
chain - Destroy a chain shape and all its segments. (b2DestroyChain + b2FreeChainData)
- destroy_
shape - Destroy a shape by id, optionally updating the body mass. (b2DestroyShape)
- destroy_
shape_ proxy - (b2DestroyShapeProxy)
- get_
chain_ index - Validate a ChainId and return the raw chain index. (static b2GetChainShape
— C returns a pointer; Rust returns the index into
world.chain_shapes) - get_
shape_ centroid - (b2GetShapeCentroid)
- get_
shape_ index - Validate a ShapeId and return the raw shape index. (b2GetShape — C returns
a pointer; Rust returns the index into
world.shapes) - get_
shape_ perimeter - (b2GetShapePerimeter)
- get_
shape_ projected_ perimeter - This projects the shape perimeter onto an infinite line. (b2GetShapeProjectedPerimeter)
- make_
shape_ distance_ proxy - (b2MakeShapeDistanceProxy)
- ray_
cast_ shape - (b2RayCastShape)
- shape_
apply_ wind - Apply wind to a shape, applying drag and lift forces to the owning body. (b2Shape_ApplyWind)
- shape_
are_ contact_ events_ enabled - Returns true if contact events are enabled. (b2Shape_AreContactEventsEnabled)
- shape_
are_ hit_ events_ enabled - Returns true if hit events are enabled. (b2Shape_AreHitEventsEnabled)
- shape_
are_ pre_ solve_ events_ enabled - Returns true if pre-solve events are enabled. (b2Shape_ArePreSolveEventsEnabled)
- shape_
are_ sensor_ events_ enabled - Returns true if sensor events are enabled. (b2Shape_AreSensorEventsEnabled)
- shape_
cast_ shape - (b2ShapeCastShape)
- shape_
compute_ mass_ data - Compute the mass data for a shape. (b2Shape_ComputeMassData)
- shape_
enable_ contact_ events - Enable contact events for this shape. (b2Shape_EnableContactEvents)
- shape_
enable_ hit_ events - Enable contact hit events for this shape. (b2Shape_EnableHitEvents)
- shape_
enable_ pre_ solve_ events - Enable pre-solve contact events for this shape. Only applies to dynamic bodies. These are expensive and must be carefully handled due to multithreading. (b2Shape_EnablePreSolveEvents)
- shape_
enable_ sensor_ events - Enable sensor events for this shape. (b2Shape_EnableSensorEvents)
- shape_
get_ aabb - Get the current world AABB. This is the axis-aligned bounding box in world coordinates. (b2Shape_GetAABB)
- shape_
get_ body - Get the id of the body that a shape is attached to. (b2Shape_GetBody)
- shape_
get_ capsule - Get a copy of the shape’s capsule. Asserts the type is correct. (b2Shape_GetCapsule)
- shape_
get_ chain_ segment - Get a copy of the shape’s chain segment. These come from chain shapes. Asserts the type is correct. (b2Shape_GetChainSegment)
- shape_
get_ circle - Get a copy of the shape’s circle. Asserts the type is correct. (b2Shape_GetCircle)
- shape_
get_ closest_ point - Get the closest point on a shape to a target point. Target and result are in world space. (b2Shape_GetClosestPoint)
- shape_
get_ contact_ capacity - Get the maximum capacity required for retrieving all the touching contacts on a shape. (b2Shape_GetContactCapacity)
- shape_
get_ contact_ data - Get the touching contact data for a shape. (b2Shape_GetContactData — returns a Vec instead of filling a caller array)
- shape_
get_ density - Get the density of a shape, usually in kg/m^2. (b2Shape_GetDensity)
- shape_
get_ filter - Get the shape filter. (b2Shape_GetFilter)
- shape_
get_ friction - Get the friction of a shape. (b2Shape_GetFriction)
- shape_
get_ parent_ chain - Get the parent chain id if the shape type is a chain segment, otherwise returns the null chain id. (b2Shape_GetParentChain)
- shape_
get_ polygon - Get a copy of the shape’s convex polygon. Asserts the type is correct. (b2Shape_GetPolygon)
- shape_
get_ restitution - Get the shape restitution. (b2Shape_GetRestitution)
- shape_
get_ segment - Get a copy of the shape’s line segment. Asserts the type is correct. (b2Shape_GetSegment)
- shape_
get_ sensor_ capacity - Get the maximum capacity required for retrieving all the overlapped shapes on a sensor shape. Returns 0 if the shape is not a sensor. (b2Shape_GetSensorCapacity)
- shape_
get_ sensor_ data - Get the overlapped shapes for a sensor shape. Overlaps may contain
destroyed shapes, so use
shape_is_validto confirm each overlap. (b2Shape_GetSensorData — returns a Vec instead of filling a caller array) - shape_
get_ surface_ material - Get the shape’s surface material. (b2Shape_GetSurfaceMaterial)
- shape_
get_ type - Get the type of a shape. (b2Shape_GetType)
- shape_
get_ user_ data - Get the user data for a shape. (b2Shape_GetUserData)
- shape_
get_ user_ material - Get the shape’s user material identifier. (b2Shape_GetUserMaterial)
- shape_
is_ sensor - Returns true if the shape is a sensor. (b2Shape_IsSensor)
- shape_
is_ valid - Shape id validity. (b2Shape_IsValid — the world-registry check collapses to the index/generation check in the registry-less port)
- shape_
ray_ cast - Ray cast a shape directly. (b2Shape_RayCast)
- shape_
set_ capsule - Allows you to change a shape to be a capsule or update the current capsule. (b2Shape_SetCapsule)
- shape_
set_ chain_ segment - Allows you to change a shape to be a stand-alone chain segment or update the current one. Cannot be used on a segment owned by a chain shape. (b2Shape_SetChainSegment)
- shape_
set_ circle - Allows you to change a shape to be a circle or update the current circle. (b2Shape_SetCircle)
- shape_
set_ density - Set the mass density of a shape, usually in kg/m^2. (b2Shape_SetDensity)
- shape_
set_ filter - Set the current filter. This is almost as expensive as recreating the shape. Sensor overlaps are not updated until the next time step. (b2Shape_SetFilter)
- shape_
set_ friction - Set the friction on a shape. (b2Shape_SetFriction)
- shape_
set_ polygon - Allows you to change a shape to be a polygon or update the current polygon. (b2Shape_SetPolygon)
- shape_
set_ restitution - Set the shape restitution. (b2Shape_SetRestitution)
- shape_
set_ segment - Allows you to change a shape to be a segment or update the current segment. (b2Shape_SetSegment)
- shape_
set_ surface_ material - Set the shape’s surface material. (b2Shape_SetSurfaceMaterial)
- shape_
set_ user_ data - Set the user data for a shape. (b2Shape_SetUserData)
- shape_
set_ user_ material - Set the shape’s user material identifier. (b2Shape_SetUserMaterial)
- shape_
test_ point - Test a point for overlap with a shape. (b2Shape_TestPoint)
- should_
query_ collide - (static inline b2ShouldQueryCollide)
- should_
shapes_ collide - (static inline b2ShouldShapesCollide)