Skip to main content

Module geometry

Module geometry 

Source
Expand description

Structures related to geometry: colliders, shapes, etc.

Structs§

ActiveCollisionTypes
Controls which combinations of body types can collide with each other.
Array2
A column-major 2D array.
AxisMask
The status of the cell of an heightfield.
BroadPhaseBvh
The broad-phase collision detector that quickly filters out distant object pairs.
Bvh
A Bounding Volume Hierarchy (BVH) for spatial queries and collision detection.
Collider
The collision shape attached to a rigid body that defines what it can collide with.
ColliderBuilder
A builder for creating colliders with custom shapes and properties.
ColliderChanges
Flags describing how the collider has been modified by the user.
ColliderFlags
A set of flags for controlling collision/intersection filtering, modification, and events.
ColliderHandle
The unique identifier of a collider added to a collider set.
ColliderMaterial
The constraints solver-related properties of this collider (friction, restitution, etc.)
ColliderPair
A pair of collider handles.
ColliderParent
Information about the rigid-body this collider is attached to.
ColliderPosition
The position of a collider.
ColliderSet
The collection that stores all colliders (collision shapes) in your physics world.
CollisionEventFlags
Flags providing more information regarding a collision event.
CompositeShapeRef
A helper struct that implements scene queries on any composite shapes.
Compound
A compound shape with an aabb bounding volume.
ContactData
A single contact between two collider.
ContactForceEvent
Event occurring when the sum of the magnitudes of the contact forces between two colliders exceed a threshold.
ContactManifoldData
A contact manifold between two colliders.
ContactPair
All contact information between two colliding colliders.
ConvexPolygon
A 2D convex polygon.
Group
A bit mask identifying groups for interaction.
HalfSpace
A half-space delimited by an infinite plane.
InteractionGraph
A graph where nodes are collision objects and edges are contact or proximity algorithms.
InteractionGroups
Collision filtering system that controls which colliders can interact with each other.
IntersectionPair
The description of all the contacts between a pair of colliders.
NarrowPhase
The narrow-phase collision detector that computes precise contact points between colliders.
OctantPattern
Indicates the local shape of a voxel on each octant.
PackedFeatureId
A memory-efficient feature ID where the type and index are packed into a single u32.
PolygonalFeature
A polygonal feature representing the local polygonal approximation of a vertex, or face, of a convex shape.
Polyline
A polyline shape formed by connected line segments.
PolylineFlags
Controls how a Polyline is loaded.
RoundShape
A shape with rounded borders.
SegmentPseudoNormals
The pseudo-normals of a polyline segment, approximating the outward normal cones of its features.
SharedShape
A reference-counted, shareable geometric shape.
SolverContactGeneric
A contact seen by the constraints solver for computing forces.
SolverFlags
Flags affecting the behavior of the constraints solver for a given contact manifold.
TopoFace
A face of a triangle-mesh’s half-edge topology.
TopoHalfEdge
A half-edge of a triangle-mesh’s half-edge topology.
TopoVertex
A vertex of a triangle-mesh’s half-edge topology.
TrackedContact
A single contact point between two shapes.
TriMesh
A triangle mesh.
TriMeshConnectedComponents
The connected-components of a triangle mesh.
TriMeshFlags
Controls how a TriMesh should be loaded.
TriMeshTopology
The half-edge topology information of a triangle mesh.
TrianglePseudoNormals
The pseudo-normals of a triangle providing approximations of its feature’s normal cones.
VoxelData
Information associated to a voxel.
VoxelState
A description of the local neighborhood of a voxel.
Voxels
A shape made of axis-aligned, uniformly sized cubes (aka. voxels).
VoxelsChunkRef
A reference to a chunk of voxels within a Voxels shape.

Enums§

BroadPhasePairEvent
An event emitted by the broad-phase.
BvhBuildStrategy
The strategy for one-time build of the BVH tree.
BvhOptimizationStrategy
Selection of strategies to maintain through time the broad-phase BVH in shape that remains efficient for collision-detection and scene queries.
ColliderEnabled
Enum indicating whether or not a collider is enabled.
ColliderMassProps
The mass-properties of a collider.
ColliderType
The type of collider.
CollisionEvent
Events triggered when two colliders start or stop touching.
FeatureId
An identifier of a geometric feature (vertex, edge, or face) of a shape.
InteractionTestMode
Specifies which method should be used to test interactions.
MeshConverter
Determines how meshes (generally when loaded from a file) are converted into Rapier colliders.
MeshConverterError
Error that can be generated by the MeshConverter.
SegmentPointLocation
Describes where a point is located on a segment.
ShapeType
Enum representing the type of a shape.
TopologyError
Errors that occur when computing or validating triangle mesh topology.
TriMeshBuilderError
Errors that occur when creating a triangle mesh.
TriangleOrientation
Orientation of a triangle.
TrianglePointLocation
Description of the location of a point on a triangle.
TypedShape
Enum representing the shape with its actual type
VoxelType
Categorization of a voxel based on its neighbors.

Constants§

NEW_CONTACT_BIT
Bit set in SolverContactGeneric::contact_id when the contact did not exist during the previous timestep.

Traits§

BoundingVolume
Trait of bounding volumes.
CompositeShape
Trait implemented by shapes composed of multiple simpler shapes.
PointQuery
Trait for shapes that support point projection and containment queries.
PointQueryWithLocation
Returns shape-specific info in addition to generic projection information
PolygonalFeatureMap
Trait implemented by convex shapes with features with polyhedral approximations.
RayCast
Traits of objects which can be transformed and tested for intersection with a ray.
Shape
Trait implemented by shapes usable by Rapier.
SupportMap
Trait for convex shapes representable by a support mapping function.
TypedCompositeShape

Functions§

is_bouncy
Scalar variant of is_bouncy_simd.
is_bouncy_simd
Should a contact be treated as bouncy? (SIMD lanes; 1.0 = bouncy.) Restitution is per-manifold (ContactManifoldData::restitution); is_new is decoded from bit 31 (NEW_CONTACT_BIT) of SolverContactGeneric::contact_id.

Type Aliases§

Aabb
An axis-aligned bounding box.
Ball
A ball shape.
Capsule
A capsule shape.
ColliderGraphIndex
Index of a node of the interaction graph.
ColliderShape
The shape of a collider.
Contact
A contact between two colliders.
ContactId
The storage type of SolverContactGeneric::contact_id: one Real-sized slot per lane, so that a lane of the AoSoA struct keeps the same layout as a scalar contact. At f32 a slot is exactly the u32 id; at f64 the high 32 bits are unused padding.
ContactManifold
A contact manifold between two colliders.
Cuboid
A cuboid shape.
DefaultBroadPhase
The default broad-phase implementation recommended for general-purpose usage.
HeightField
A heightfield shape.
HeightFieldCellStatus
Indicates if a cell of a heightfield is removed or not. Set this to false for a removed cell.
ModifiedColliders
A set of modified colliders
PointProjection
The projection of a point on a collider.
Ray
A ray that can be cast against colliders.
RayIntersection
The intersection between a ray and a collider.
RigidBodyGraphIndex
Index of a node of the interaction graph.
RoundConvexPolygon
A convex polygon dilated by a sphere (so it has round corners).
RoundCuboid
A cuboid dilated by a sphere (so it has round corners).
RoundTriangle
A triangle dilated by a sphere (so it has round corners).
Segment
A segment shape.
ShapeCastHit
The result of a shape-cast between two shapes.
SimdSolverContact
A group of SIMD_WIDTH solver contacts stored in SoA fashion for SIMD optimizations.
SolverContact
A single solver contact.
SolverContacts
The container of a manifold’s solver contacts. In 2D a manifold has at most 2 active contacts, so they are stored inline: the solver’s contact gathers read one contiguous manifold instead of chasing a heap allocation per manifold (a dependent cache miss on every SIMD lane of every constraint, every step).
TemporaryInteractionIndex
Temporary index to and edge of the interaction graph.
Triangle
A triangle shape.