Home

Awesome

Jolt Physics Hooks for React-Three-Fiber

Version Downloads

npm install r3f-jolt

You can find a very basic usage example here.

Physics

A component for setting up the Jolt Physics environment and managing physics simulation.

Props

Usage

Wrap your scene with the Physics component to enable physics simulation.

useJolt

A hook for accessing Jolt Physics context.

Returns

An object containing references to Jolt Physics entities.

useBox

A hook for creating a static or dynamic box-shaped physics body.

Parameters

Returns

[ref, api]

useCapsule

A hook for creating a static or dynamic capsule-shaped physics body.

Parameters

Returns

[ref, api]

useCharacter

A hook for creating a physics-enabled character.

Parameters

Returns

[api]

useCompound

A hook for creating a compound physics body composed of multiple shapes.

Parameters

Returns

[ref, api]

useConvex

A hook for creating a physics-enabled convex shape.

Parameters

Returns

[ref, api]

useCylinder

A hook for creating a static or dynamic cylinder-shaped physics body.

Parameters

Returns

[ref, api]

useSphere

A hook for creating a static or dynamic sphere-shaped physics body.

Parameters

Returns

[ref, api]

useTaperedCapsule

A hook for creating a static or dynamic tapered capsule-shaped physics body.

Parameters

Returns

[ref, api]

useTrimesh

A hook for creating a physics-enabled trimesh.

Parameters

Returns

[ref, api]

useClosestHitRaycaster

A hook for casting a ray and detecting the closest hit collision.

Parameters

Returns

[api]

useCar

A hook to create a physics-enabled car.

Parameters

Returns