Package-level declarations

Types

Link copied to clipboard
object Jolt

What Jolt needs set up before anything else: its allocator, the factory, and the types registered with it.

Functions

Link copied to clipboard
fun estimateCollisionResponse(body1: Body, body2: Body, manifold: ContactManifold, result: CollisionEstimationResult, combinedFriction: Float, combinedRestitution: Float, minVelocityForRestitution: Float, numIterations: Int)

This function estimates the contact impulses and body velocity changes as a result of a collision. It can be used in the ContactListener::OnContactAdded to determine the strength of the collision to e.g. play a sound or trigger a particle system. This function is accurate when two bodies collide but will not be accurate when more than 2 bodies collide at the same time as it does not know about these other collisions.

Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
fun loadJolt(): Promise<ERROR CLASS: Symbol not found for JsAny>

Loads kolt.wasm, next to the kolt.js the page includes; Jolt.init and everything else come after it resolves. Jolt runs on the calling thread here: a job system's threads are ignored.

Link copied to clipboard

Register all physics types with the factory and install their collision handlers with the CollisionDispatch class. If you have your own custom shape types you probably need to register their handlers with the CollisionDispatch before calling this function. If you implement your own default material (PhysicsMaterial::sDefault) make sure to initialize it before this function or else this function will create one for you.

Link copied to clipboard

Unregisters all types with the factory and cleans up the default material

Link copied to clipboard

This function can be used to verify the library ABI is compatible with your application. Use it in this way: assert(VerifyJoltVersionID());. Returns false if the library used is not compatible with your app.