Skip to main content

Crate oxijolt

Crate oxijolt 

Source
Expand description

Safe Rust API for Jolt Physics 5.6 over the joltc raw layer in oxijolt-sys.

A PhysicsWorld owns a Jolt physics system with its collision layers (CollisionLayers), its job system and temp allocator. Bodies are created from a Shape and BodySettings and named by a BodyId; one shape may serve many bodies in many worlds.

use oxijolt::prelude::math::*;
use oxijolt::prelude::*;

let mut world = PhysicsWorld::new(WorldSettings::default())?;

let floor_shape = Shape::new_box(Vec3::new(100.0, 1.0, 100.0))?;
let floor = BodySettings::new_static().position(RVec3::new(0.0, -1.0, 0.0));
world.create_body(&floor_shape, &floor)?;

let ball_shape = Shape::new_sphere(0.5)?;
let ball = world.create_body(
    &ball_shape,
    &BodySettings::new_dynamic().position(RVec3::new(0.0, 2.0, 0.0)),
)?;

for _ in 0..60 {
    let report = world.step(1.0 / 60.0)?;
    assert!(report.is_complete());
}
assert!(world.body(ball)?.position().y < 2.0);

§What a world holds

The guide builds a game scene with terrain, queries, a character, a vehicle and a ragdoll.

§Contract

  • Errors. A call that returns Err was refused and changed nothing, unless its documentation says otherwise. A step that ran but dropped work returns Ok, and its StepReport says what was dropped. Code that calls several areas can return error::Result; ? converts every area error into error::Error.
  • Magnitudes. Positions, extents, velocities, masses and the other inputs limits bounds are checked against it before they reach Jolt. Some inputs, such as damping and ray directions, are only checked to be finite. Some bounds are derived from Jolt’s arithmetic (limits doc), some are only tested at the bound, and some cases no bound excludes (coverage).
  • Threads. Changing a world, PhysicsWorld::step included, takes &mut PhysicsWorld; reading it takes &PhysicsWorld. PhysicsWorld is Send and Sync: many threads may read one world while nobody steps it, and different worlds may step on different threads at the same time. A world runs Jolt’s jobs on Jolt’s thread pool (WorldSettings::worker_threads) or on the caller’s pool through a JobSystem (job system guide).
  • Determinism. The order of calls, including the order of body creation and removal, is part of the state. The tests check bit-identical results with 1 and 4 worker threads and with caller job systems on one machine; results agree across platforms and compilers only with the cross-platform-deterministic feature (determinism).

§Global state

oxijolt calls JPH_Init once per process and never calls JPH_Shutdown. It installs joltc’s process-global procs once and owns them: the object-layer, body and shape filters, the contact, body activation and soft body contact listeners (the first time a world records events), the debug renderer (with debug-renderer, which also serializes debug drawing) and Jolt’s assertion handler (before JPH_Init). Code that also uses oxijolt-sys directly must leave them alone; see the notes on the raw API in oxijolt-sys.

With the asserts feature, which compiles Jolt with its debug assertions, a failed assertion prints its expression, message, file and line to stderr and aborts the process. The only exception is the physics-update-error assertion, whose condition PhysicsWorld::step returns in its StepReport.

§Features

Every feature adds to the API except double-precision, which changes Real in every signature: only the final application enables it, and libraries built on oxijolt forward it. bindgen is a build switch outside the semver promise.

  • double-precision: world positions (Real, RVec3) use f64.
  • cross-platform-deterministic: Jolt’s cross-platform deterministic floating point settings.
  • debug-renderer: collider wireframes as line data, see above.
  • asserts: Jolt’s debug assertions, reported as above.
  • bindgen: generates the raw bindings with libclang at build time.
  • glam032: From conversions both ways between Vec3, Quat, RVec3 and glam 0.32’s Vec3, Quat and vector of Real (DVec3 in double precision).
  • mint: From conversions both ways between Vec3, Quat, RVec3 and mint’s Vector3<f32>, Quaternion<f32> and Vector3<Real>.

The conversions copy the fields: a value converted there and back has the same bits, and nothing is normalized or checked until a call takes the value.

use oxijolt::{BodySettings, PhysicsWorld, Shape, WorldSettings};

let mut world = PhysicsWorld::new(WorldSettings::default())?;
let ball = world.create_body(
    &Shape::new_sphere(0.5)?,
    &BodySettings::new_dynamic()
        .rotation(glam::Quat::from_rotation_y(1.0).into())
        .linear_velocity(glam::Vec3::new(1.0, 0.0, 0.0).into()),
)?;
let velocity: glam::Vec3 = world.body(ball)?.linear_velocity().into();
assert_eq!(velocity, glam::Vec3::X);

Re-exports§

pub use error::BinaryStateError;
pub use error::BodyError;
pub use error::CharacterError;
pub use error::CollisionGroupError;
pub use error::ConstraintError;
pub use error::ContactSettingsError;
pub use error::ConvexHullError;
pub use error::MeshError;
pub use error::QueryError;
pub use error::RagdollError;
pub use error::ShapeError;
pub use error::SoftBodyError;
pub use error::StateError;
pub use error::StepError;
pub use error::ThinTrianglesError;
pub use error::VehicleError;
pub use error::WorldError;

Modules§

error
Error types. Every value Jolt only checks with debug assertions is validated before it reaches Jolt and reported through these; magnitudes follow crate::limits, which says which assertion paths are derived and which are covered by tests.
limits
The magnitudes the safe API accepts.
prelude
The types most programs use, for use oxijolt::prelude::*.

Structs§

AllowedDofs
The degrees of freedom a body may move in: translation along and rotation about the world axes (Jolt EAllowedDOFs), set at creation with BodySettings::allowed_dofs.
AnyConstraintId
A constraint id of any kind, for listing and removing constraints.
AnyVehicleId
A vehicle id of any kind, for listing and removing vehicles.
BodyId
Identifies a body in the world that created it.
BodyMut
Read and write access to one body, borrowed mutably from its world.
BodyPose
The pose of one awake body, as returned by PhysicsWorld::active_body_poses.
BodyRef
Read access to one body, borrowed from its world.
BodySettings
How to create a body. Build it from new_dynamic, new_kinematic or new_static and the setters.
BodyVelocity
The velocity of a body as a character sees it, in CharacterContactListener::adjust_body_velocity.
BroadPhaseLayer
A broad-phase layer: one of the trees the broad phase sorts bodies into.
BuoyancySettings
A fluid for BodyMut::apply_buoyancy_impulse: its surface, how strongly it lifts and how it drags. The defaults are Jolt’s suggestions (Body.h): surface through the origin with normal +Y, buoyancy 1, linear drag 0.5, angular drag 0.01, still water.
CharacterContact
A contact of a character after its last update or contact refresh (Jolt CharacterVirtual::Contact).
CharacterContactKey
What a removed character contact touched (Jolt CharacterContactListener::OnContactRemoved and OnCharacterContactRemoved).
CharacterContactSettings
How a character and what it touches push each other (Jolt CharacterContactSettings).
CharacterId
Identifies a character in the world that created it.
CharacterMut
Write access to one character, borrowed mutably from its world.
CharacterRef
Read access to one character, borrowed from its world.
CharacterSettings
How to create a character, for PhysicsWorld::create_character. Build it with new and the setters.
CharacterState
The persistent state of a character, from CharacterRef::save_state, to continue a run bit for bit with CharacterMut::restore_state.
CollidePointHit
One body whose shape contains the point of a PhysicsWorld::collide_point.
CollideShape
A shape placed at a pose, for PhysicsWorld::collide_shape.
CollideShapeHit
One obstacle a PhysicsWorld::collide_shape found.
CollisionEstimate
What Jolt estimates a new contact does to its two bodies, before the solver runs (Jolt EstimateCollisionResponse), from ContactEvent::Added when EventSettings::collision_estimates is on.
CollisionGroup
The collision group of a body (Jolt CollisionGroup): a group id and a sub group of a GroupFilterTable.
CollisionLayers
The collision layer setup of a world: object layers, the broad-phase layer of each, and the pairs of object layers that collide.
CompoundChild
One child of a compound shape, for Shape::new_compound.
CompoundSubShape
The compound child a SubShapeId leads to, from Shape::compound_sub_shape or PhysicsWorld::compound_sub_shape.
ConeConstraintSettings
A cone constraint (Jolt ConeConstraintSettings): a ball joint whose body 2 twist axis stays within a cone of half angle half_cone_angle around body 1’s; the twist about it is free.
ConstraintId
Identifies a constraint of kind K in the world that created it.
ConstraintMut
Write access to one constraint, borrowed mutably from its world.
ConstraintRef
Read access to one constraint, borrowed from its world.
ContactCandidate
A hit Jolt asks a ContactListener to accept (Jolt CollideShapeResult in OnContactValidate), before it becomes a contact.
ContactManifold
The contact between two sub-shapes in one step (Jolt ContactManifold).
ContactPoint
One contact point, as a point on each body’s surface, in world space (metres).
ContactSettings
How Jolt resolves a contact (Jolt ContactSettings), with its values for this contact.
ContactSettingsRejection
Contact settings a ContactListener returned that do not fit the contact it was called for, such as a value kept from another contact (see ContactSettings). Jolt resolved the contact with its own settings.
DebugLine
One line segment of a collider’s wireframe, in world space.
DebugLineSettings
Which colliders PhysicsWorld::debug_lines draws and how many lines it keeps.
DebugLines
A buffer of debug lines, returned by PhysicsWorld::debug_lines or refilled by PhysicsWorld::debug_lines_into.
DistanceConstraintSettings
A distance constraint (Jolt DistanceConstraintSettings): keeps the distance between a point of body 1 and a point of body 2 within a range; the bodies rotate freely.
DriverInput
What the driver asks of a wheeled vehicle or a motorcycle (Jolt WheeledVehicleController::SetDriverInput).
DroppedTriangles
The triangles Shape::new_mesh left out because they are too small or too thin for Jolt to collide with reliably (degenerate triangles among them).
EventSettings
Which events a PhysicsWorld records. The default records nothing.
ExtendedUpdateSettings
What an update does besides moving the character, for PhysicsWorld::update_character (Jolt CharacterVirtual::ExtendedUpdateSettings). The defaults are Jolt’s.
FixedConstraintSettings
A fixed constraint (Jolt FixedConstraintSettings): body 2 keeps its position and rotation relative to body 1, as if the two were welded.
GearConstraintSettings
A gear (Jolt GearConstraintSettings): body 1 turning about its hinge axis turns body 2 about its own: ω1 + ratio · ω2 = 0 for the rotation rates about the two axes, so a ratio of 2 turns gear 2 half as fast, the other way. The bodies need their own hinges, which hold them in place, and both must be dynamic (ConstraintError::NotDynamic).
GroupFilterTable
Which sub groups of a collision group collide with each other (Jolt GroupFilterTable), built with a GroupFilterTableBuilder and fixed from then on. Cloning shares the table.
GroupFilterTableBuilder
Builds a GroupFilterTable: which of its sub groups collide with each other.
HeightFieldSettings
Settings of Shape::new_height_field other than the samples. The defaults are Jolt’s (HeightFieldShapeSettings): no materials, no offset, unit scale, block size 2, 8 bits per sample and an active-edge threshold of 5 degrees.
HermitePath
A planar Hermite path (Jolt PathConstraintPathHermite) for a PathConstraintSettings: cubic Hermite segments through the points, one plane normal for all of them. Fraction i is point i; a looping path also joins the last point back to the first.
HermitePathPoint
One point of a HermitePath: a position and the curve’s tangent there, in path space. The tangent’s length is the speed of the curve parameter, not only its direction.
HingeConstraintSettings
A hinge (Jolt HingeConstraintSettings), the usual elbow or knee joint: body 2 rotates about the hinge axis by an angle in [limits_min, limits_max], measured from the pose where both normal axes coincide.
InnerBody
The optional kinematic body a character carries, so that bodies collide with it and queries find it (Jolt CharacterVirtualSettings::mInnerBodyShape).
Job
One Jolt job handed to a JobSystem.
JointTransform
The rigid transform of one skeleton joint. In a SkeletonPose it is the joint’s translation relative to the pose’s root offset and its world rotation; in a local pose (the animation pose SkeletonMapper::map takes) it is relative to the parent joint.
MappedSkeleton
One skeleton of a SkeletonMapper with its neutral pose.
MeshSettings
Settings of Shape::new_mesh_with_settings other than the geometry. The defaults are Jolt’s (MeshShapeSettings): no materials, an active-edge threshold of 5 degrees, 8 triangles per leaf, MeshBuildQuality::FavorRuntimePerformance; and convex shapes up to MeshSettings::DEFAULT_MAX_CONVEX_EXTENT.
MotorSettings
A constraint motor (Jolt MotorSettings): the spring that drives it to its target and the force and torque it may use. The defaults are Jolt’s: frequency 2 Hz, damping 1, and unlimited (∓f32::MAX) force and torque.
MotorcycleLean
A motorcycle’s lean after the last step.
MotorcycleSettings
The settings of a motorcycle (Jolt VehicleConstraintSettings with a MotorcycleControllerSettings): a wheeled vehicle of exactly two wheels, front and rear along the vehicle’s forward, with a lean controller that tilts the chassis into turns. The defaults are Jolt’s.
MutableCompound
A compound shape edited at run time: children are added, removed, moved and replaced, and to_shape publishes the current children as a new, immutable Shape.
ObjectLayer
The object layer of a body: which other bodies it can collide with.
PathConstraintSettings
A path constraint (Jolt PathConstraintSettings): body 2 slides along a HermitePath fixed to body 1, with friction, a position motor along the path and a choice of rotation constraint.
PhysicsMaterial
A surface identity for shapes: a Jolt physics material that carries a u64 of the caller’s.
PhysicsWorld
A Jolt physics system with its collision layers, its own job system and temp allocator.
PointConstraintSettings
A point constraint (Jolt PointConstraintSettings): a ball joint that keeps a point of body 1 on a point of body 2 and leaves the rotation free.
PulleyConstraintSettings
A pulley (Jolt PulleyConstraintSettings): a rope from a point on body 1 over a fixed world point and a second fixed world point to a point on body 2, so that length1 + ratio · length2 stays within the allowed PulleyLength. A ratio of 2 makes body 2 move half as far as body 1, a block and tackle.
Quat
A rotation quaternion (x, y, z, w) with w the scalar part. Jolt expects unit length.
QueryFilter
Selects the bodies and compound children a scene query considers. The default accepts everything.
RVec3
A world-space position. Its components are Real: f64 with the double-precision feature, f32 otherwise.
RackAndPinionConstraintSettings
A rack and pinion (Jolt RackAndPinionConstraintSettings): body 1, the pinion, turning about its hinge axis moves body 2, the rack, along its slider axis with rotation = ratio · translation (radians per metre). The bodies need their own hinge and slider, and both must be dynamic (ConstraintError::NotDynamic).
RagdollId
Identifies a ragdoll in the world that created it.
RagdollMut
Write access to one ragdoll, borrowed mutably from its world.
RagdollPart
One part of a ragdoll: a body for one skeleton joint and the joint to its parent part.
RagdollRef
Read access to one ragdoll, borrowed from its world.
RagdollSettings
The settings of a ragdoll (Jolt RagdollSettings): a skeleton, one body per joint and the constraints between them.
RayCast
A ray from origin along direction (Jolt RRayCast). The direction’s length is the ray’s length; hits report the fraction along it, in [0, 1].
RayCastHit
The closest hit of a PhysicsWorld::cast_ray.
SettleDetector
Counts consecutive calm updates of a ragdoll and reports when it has settled.
Shape
A collision shape that bodies are created from.
ShapeCast
A shape moved from position along direction, for PhysicsWorld::cast_shape.
ShapeCastHit
The closest hit of a PhysicsWorld::cast_shape.
SixDofConstraintSettings
A six-degree-of-freedom constraint (Jolt SixDOFConstraintSettings): each translation and rotation axis of the constraint frame is free, fixed or limited on its own. With SwingType::Pyramid the two swing ranges may be asymmetric, which suits hips.
Skeleton
A skeleton (Jolt Skeleton): named joints in a tree, parents before children, joint 0 the root. A ragdoll has one part per joint.
SkeletonJoint
One joint of a Skeleton: its name and the index of its parent joint.
SkeletonMapper
Jolt’s SkeletonMapper: maps poses between a ragdoll skeleton and a more detailed animation skeleton of the same character.
SkeletonPose
A pose of every joint of a skeleton in model space, in joint order (Jolt Ragdoll::SetPose and GetPose, and the poses of a SkeletonMapper).
SliderConstraintSettings
A slider (Jolt SliderConstraintSettings): body 2 moves along the slider axis of body 1 and keeps its rotation relative to body 1. The position along the axis is 0 where both frame points coincide.
SoftBodyContactSettings
How Jolt resolves the contacts between a soft body and another body (Jolt SoftBodyContactSettings).
SoftBodyContacts
The contacts of one soft body in one step (Jolt OnSoftBodyContactAdded).
SoftBodyDihedralBend
A dihedral bend constraint the caller adds explicitly (Jolt SoftBodySharedSettings::DihedralBend): keeps the angle between two triangles that share an edge at its rest angle.
SoftBodyEdge
An edge constraint the caller adds explicitly (Jolt SoftBodySharedSettings::Edge): keeps two vertices at their rest distance, measured when the settings are built.
SoftBodyMut
Read and write access to the vertices of one soft body, borrowed mutably from its world.
SoftBodyRef
Read access to the vertices of one soft body, borrowed from its world.
SoftBodySettings
How to create a soft body from SoftBodySharedSettings.
SoftBodySharedSettings
The particles of a soft body and the constraints between them (Jolt SoftBodySharedSettings), built and checked by SoftBodySharedSettings::builder.
SoftBodySharedSettingsBuilder
Collects the vertices, faces and constraints of SoftBodySharedSettings; made by SoftBodySharedSettings::builder.
SoftBodyValidation
A soft body’s bounding box overlapped another body’s in a step (Jolt OnSoftBodyContactValidate). It says nothing about whether a vertex touched the body. Jolt may report one pair twice in a step: once in the soft body’s own collision pass and once while the other body moves with continuous collision detection.
SoftBodyVertex
One particle of a soft body as SoftBodySharedSettings describe it.
SoftBodyVertexAttributes
How SoftBodySharedSettingsBuilder::create_constraints builds the constraints at a vertex (Jolt SoftBodySharedSettings::VertexAttributes).
SoftBodyVertexContact
One vertex of a soft body touching another body in a step.
SoftBodyVertexState
One vertex of a soft body in the world, as SoftBodyRef::vertices reads it.
SoftBodyVolume
A volume constraint the caller adds explicitly (Jolt SoftBodySharedSettings::Volume): keeps the volume of a tetrahedron at its rest volume.
StepReport
What a PhysicsWorld::step that ran reports. The world has advanced either way.
SubShapeId
Jolt’s SubShapeID: the path from a body’s root shape to the leaf shape that was hit (a compound child, a heightfield triangle).
SubShapeIdPair
The two sides of a contact: each body with the sub-shape (compound child, heightfield triangle) that touches. Jolt orders the sides so that body1 has the lower id (BodyId::to_raw).
SwingTwistConstraintSettings
A swing-twist constraint (Jolt SwingTwistConstraintSettings), the usual shoulder, neck or spine joint: body 2 twists about the twist axis within [twist_min, twist_max], and the twist axis swings away from body 1’s within a cone (or pyramid) of half angles normal (about the normal axis, twist × plane) and plane (about the plane axis).
TrackState
The state of a track after the last step.
TrackedDriverInput
What the driver asks of a tracked vehicle (Jolt TrackedVehicleController::SetDriverInput).
TrackedVehicleSettings
The settings of a tracked vehicle such as a tank (Jolt VehicleConstraintSettings with a TrackedVehicleControllerSettings).
TrackedWheelSettings
One wheel of a tracked vehicle (Jolt WheelSettings and WheelSettingsTV). The wheel turns with its track; its suspension and size work as for WheelSettings, whose methods of the same names state the rules. Positions and directions are in the chassis body’s local space, lengths in metres. The defaults are Jolt’s.
Vec3
A 3D vector of f32, used for directions, velocities, forces and extents.
VehicleAntiRollBar
An anti-roll bar between two wheels (Jolt VehicleAntiRollBar): pushes the less compressed suspension down when the other is compressed more.
VehicleDifferentialSettings
A differential: how engine torque reaches a pair of wheels (Jolt VehicleDifferentialSettings). The defaults are Jolt’s.
VehicleEngineSettings
The engine of a vehicle (Jolt VehicleEngineSettings). The defaults are Jolt’s wheeled vehicle defaults; TrackedVehicleSettings::default_engine gives the tracked ones.
VehicleId
Identifies a vehicle of kind K in the world that created it.
VehicleMut
Write access to one vehicle of kind K, borrowed mutably from its world.
VehicleRef
Read access to one vehicle of kind K, borrowed from its world.
VehicleTrackSettings
One track of a tracked vehicle (Jolt VehicleTrackSettings): the wheels it runs over and how the drivetrain turns it. The defaults are Jolt’s.
VehicleTransmissionSettings
The automatic transmission of a vehicle (Jolt VehicleTransmissionSettings in ETransmissionMode::Auto; the manual mode is not offered). The defaults are Jolt’s wheeled vehicle defaults; TrackedVehicleSettings::default_transmission gives the tracked ones.
WheelContact
Where a wheel touches the ground.
WheelSettings
One wheel of a wheeled vehicle or a motorcycle (Jolt WheelSettings and WheelSettingsWV). Positions and directions are in the chassis body’s local space, lengths in metres. The defaults are Jolt’s.
WheelState
The state of one wheel after the last step.
WheeledVehicleSettings
The settings of a wheeled vehicle (Jolt VehicleConstraintSettings with a WheeledVehicleControllerSettings).
WorldEvents
The events a world recorded, in recording order across steps; see PhysicsWorld::take_events.
WorldSettings
Settings for PhysicsWorld::new. The defaults are Jolt’s and joltc’s.
WorldState
A world’s simulation state at one moment, from PhysicsWorld::save_state, PhysicsWorld::save_state_of or PhysicsWorld::save_state_into, to go back to with PhysicsWorld::restore_state.

Enums§

Activation
Whether an operation wakes the body.
ActivationEvent
A body woke up or fell asleep.
BodySelection
Which bodies PhysicsWorld::save_state_of and PhysicsWorld::save_state_into save, and which bodies PhysicsWorld::restore_state_of restores.
ConeConstraint
A cone constraint (Jolt ConeConstraint): a ball joint whose twist axis stays in a cone.
ConstraintSpace
The space a constraint’s frames are given in (Jolt EConstraintSpace).
ConstraintType
The kinds of constraint a world can hold.
ContactEvent
A change of a rigid body contact in a step.
DistanceConstraint
A distance constraint (Jolt DistanceConstraint): a rod or rope between two points.
DistanceRange
The allowed distance range of a DistanceConstraintSettings.
FixedConstraint
A fixed constraint (Jolt FixedConstraint): the bodies move as one.
GearConstraint
A gear (Jolt GearConstraint): couples the rotation of two bodies.
GroundState
How a character stands, from its last update (Jolt CharacterBase::EGroundState).
HingeConstraint
A hinge (Jolt HingeConstraint).
JointReading
What a joint reads now, in its constraint space.
LongRangeAttachment
Which long range attachment (LRA) constraint ties a movable vertex to the closest kinematic vertex (Jolt SoftBodySharedSettings::ELRAType). An LRA constraint keeps the vertex within its rest distance from that kinematic vertex times a multiplier, so a hanging cloth does not stretch under its own weight. The anchors are chosen when the settings are built.
MeshBuildQuality
How Jolt builds a mesh’s bounding volume tree (Jolt MeshShapeSettings::EBuildQuality).
MotionQuality
How Jolt integrates a moving body.
MotionType
How a body moves.
MotorState
The state of a constraint motor (Jolt EMotorState).
Motorcycle
A two-wheeled motorcycle that leans into turns.
PathConstraint
A path constraint (Jolt PathConstraint): body 2 moves along a path fixed to body 1.
PathRotationConstraint
How a path constraint constrains the rotation of body 2 (Jolt EPathRotationConstraintType).
PointConstraint
A point constraint (Jolt PointConstraint): a ball joint.
PulleyConstraint
A pulley (Jolt PulleyConstraint): a rope over two fixed points.
PulleyLength
The allowed rope length of a PulleyConstraintSettings: the length is |fixed_point1 - body_point1| + ratio · |fixed_point2 - body_point2|.
RackAndPinionConstraint
A rack and pinion (Jolt RackAndPinionConstraint): couples a rotation and a translation.
RagdollJoint
The constraint that joins a ragdoll part to its parent part.
SixDofAxis
How one axis of a six-degree-of-freedom constraint may move.
SixDofConstraint
A six-degree-of-freedom constraint (Jolt SixDOFConstraint).
SixDofConstraintAxis
One axis of a six-degree-of-freedom constraint (Jolt SixDOFConstraintSettings::EAxis). Translations are along, rotations about, the axes of the constraint frame: X is the twist axis, Y and Z the swing axes.
SliderConstraint
A slider (Jolt SliderConstraint): translation along one axis.
SoftBodyBendType
Which bend constraints SoftBodySharedSettingsBuilder::create_constraints creates between two faces that share an edge (Jolt SoftBodySharedSettings::EBendType).
SoftBodyValidateResult
Whether Jolt processes the contacts between a soft body and another body.
SpringSettings
A spring (Jolt SpringSettings). A limit spring with frequency or stiffness 0 is rigid; a position motor whose spring has frequency or stiffness 0 does nothing (Jolt deactivates it). The default is rigid: frequency 0, damping 0.
SwingTwistConstraint
A swing-twist constraint (Jolt SwingTwistConstraint).
SwingType
How the two swing limits combine (Jolt ESwingType).
TrackSide
One of a tracked vehicle’s two tracks.
TrackedVehicle
A tracked vehicle such as a tank.
TranslationLocks
Which animation joints SkeletonMapper::map keeps at their neutral offset from their parent (Jolt LockTranslations). Joint constraints stretch a little under load; a lock hides that stretch in the animation pose, which then differs from the simulated bodies.
ValidateResult
What a ContactListener answers for a ContactCandidate (Jolt ValidateResult).
VehicleCollisionTester
How the wheels find the ground (Jolt’s VehicleCollisionTester kinds). Each wheel casts along its suspension from its attachment point at the start of every step.
VehicleType
The kinds of vehicle a world can hold.
WheeledVehicle
A wheeled vehicle, created with PhysicsWorld::create_wheeled_vehicle.

Traits§

CharacterContactListener
Changes how characters touch bodies and each other (Jolt CharacterContactListener); see PhysicsWorld::set_character_contact_listener.
ConstraintKind
A kind of world constraint, named by the zero-sized markers such as HingeConstraint. It selects the methods of ConstraintRef and ConstraintMut.
ConstraintSettings
Settings a world constraint is created from with PhysicsWorld::create_constraint.
ContactListener
Changes how Jolt resolves contacts while a world steps; see PhysicsWorld::set_contact_listener.
JobSystem
A thread pool that runs Jolt’s jobs for a world, set with WorldSettings::job_system, for example Rayon or a game’s own pool. Without it a world runs its jobs on Jolt’s thread pool (WorldSettings::worker_threads).
VehicleKind
A kind of vehicle, named by the markers WheeledVehicle, TrackedVehicle and Motorcycle. It selects the methods of VehicleRef and VehicleMut.

Type Aliases§

Real
Scalar type of world positions: f64 with the double-precision feature, f32 otherwise. Scalar type of world positions: f64 with the double-precision feature, f32 otherwise.