C++17 Core Headers (include/joltsim/)¶
All native JoltSim headers live under include/joltsim/ in namespace joltsim:
1. include/joltsim/types.hpp¶
Defines all solver/scene descriptors, enums, and binary-packed sensor structs:
SolverConfig: velocity/position iterations, Baumgarte, slop, speculative distance, capacities (max_bodies,max_body_pairs,max_contact_constraints,max_contacts).ContactEvent(alignas(64), 64 bytes) &RayHit(alignas(32), 32 bytes).ShapeType,JointType,MotorMode,SoftBendType,RuntimeConstraintType.MotorConfig,ShapeDesc,BodyDesc,JointDesc,SiteDesc,ArticulationDesc,SoftBodyDesc.SceneBodyMeta,SceneJointMeta,SceneSoftBodyMeta,RuntimeConstraintDesc,ClosestPointResult.
2. include/joltsim/aligned_buffer.hpp¶
template <typename T, std::size_t Alignment = 64> class AlignedBuffer: move-only RAII buffer allocatingkAlignment-aligned storage via::operator new[](..., std::align_val_t, std::nothrow)and zeroing memory onallocate(count).
3. include/joltsim/jolt_context.hpp¶
Broadphase/object layer constants (
Layers::NON_MOVING = 0,Layers::MOVING = 1,BroadPhaseLayers::NON_MOVING,BroadPhaseLayers::MOVING).BPLayerInterfaceImpl,ObjectVsBroadPhaseLayerFilterImpl,ObjectLayerPairFilterImpl.void ensure_jolt_initialized(): thread-safe one-time Jolt allocator, factory, and type registration.
4. include/joltsim/articulation.hpp¶
ArticulationJointRuntime: stores JoltRef<SixDOFConstraint>,MotorConfig, limits,zero_offset, continuous angle unwrapping state (last_raw_angle,unwrapped_angle), flat buffer offsets (qpos_offset,qvel_offset,ctrl_offset), and mimic joint parameters.ArticulationRuntime: ownslink_body_ids, initial transforms,joints,GroupFilterTable, and implementsapply_controls(...),read_state(...), andreset(...).
5. include/joltsim/sensors.hpp¶
ContactPairOverride: stores(friction, restitution)overrides keyed by canonical(min(b1, b2), max(b1, b2))body-index pairs.WorldStepListener(JPH::PhysicsStepListener): callsArticulationRuntime::apply_controlsbefore each physics substep.WorldContactListener(JPH::ContactListener): recordsContactEvententries into lock-free/atomic buffer slots (up tomax_contacts) and appliesContactPairOverridematerials inOnContactAddedandOnContactPersisted.
6. include/joltsim/ik.hpp¶
solve_dls_ik(...): damped least-squares inverse kinematics solver over an articulation chain.compute_jacobian(...): computes(6, nv)spatial Jacobian[J_lin; J_ang]atlocal_point.compute_mass_matrix(...): computes(nv, nv)joint-space inertia matrix \(M(q)\).compute_inverse_dynamics(...): full RNEA computing \(\tau = M(q)\ddot{q} + C(q,\dot{q})\dot{q} + g(q)\) via topological BFS FK, forward velocity/acceleration propagation, and backward wrench recursion.
7. include/joltsim/world.hpp¶
class World: wraps aJPH::PhysicsSystem,TempAllocatorImplWithMallocFallback, andJobSystemThreadPool(or single-threaded). Exposes body/articulation/soft-body/site/constraint creation,step/step_with, dynamics/material/filter mutation,save_state/load_state,save_keyframe/load_keyframe,set_mocap_pose,get_aabb,raycast_batch, proximity queries, FT/IMU sensors, and rawfloat*buffer accessors.
8. include/joltsim/vec_world.hpp¶
class VecWorld: ownsnum_envsWorldinstances + persistentstd::threadpool (worker_loop), contiguous(N, D)AlignedBufferstate arrays,step,raycast_batch,reset_all,reset_envs,save_state,load_state,save_keyframe,load_keyframe,set_mocap_pose,set_contact_pair_properties,get_aabb, andget_site_pose.