Interface PhysicsProps

Hierarchy

  • PhysicsProps

Properties

allowedLinearError?: number

Amount of penetration the engine wont attempt to correct

Default Value

0.001

children: ReactNode

Set the base automatic colliders for this physics world All Meshes inside RigidBodies will generate a collider based on this value, if not overridden.

contactNaturalFrequency?: number

Directly affects the erp (Error Reduction Parameter) which is the proportion (0 to 1) of the positional error to be corrected at each time step. The higher this value is, the more the physics engine will try to correct errors.

This prop is currently undocumented in the Rapier documentation.

See

https://github.com/dimforge/rapier/pull/651 where this change was made to Rapier

Default Value

30

debug?: boolean

Enable debug rendering of the physics world.

Default Value

false

gravity?: Vector3Tuple

Set the gravity of the physics world

Default Value

[0, -9.81, 0]

interpolate?: boolean

Interpolate the world transform using the frame delta times. Has no effect if timeStep is set to "vary".

Default Value

true

lengthUnit?: number

The approximate size of most dynamic objects in the scene.

This value is used internally to estimate some length-based tolerance. This value can be understood as the number of units-per-meter in your physical world compared to a human-sized world in meter.

Default Value

1

maxCcdSubsteps?: number

Maximum number of substeps performed by the solver

Default Value

1

minIslandSize?: number

Minimum number of dynamic bodies in each active island

Default Value

128

numAdditionalFrictionIterations?: number

Number of addition friction resolution iteration run during the last solver sub-step. The greater this value is, the most realistic friction will be. However a greater number of iterations is more computationally intensive.

Default Value

4

numInternalPgsIterations?: number

Number of internal Project Gauss Seidel (PGS) iterations run at each solver iteration. Increasing this parameter will improve stability of the simulation. It will have a lesser effect than increasing numSolverIterations but is also less computationally expensive.

Default Value

1

numSolverIterations?: number

The number of solver iterations run by the constraints solver for calculating forces. The greater this value is, the most rigid and realistic the physics simulation will be. However a greater number of iterations is more computationally intensive.

Default Value

4

paused?: boolean

Pause the physics simulation

Default Value

false

predictionDistance?: number

The maximal distance separating two objects that will generate predictive contacts

Default Value

0.002

timeStep?: number | "vary"

Set the timestep for the simulation. Setting this to a number (eg. 1/60) will run the simulation at that framerate. Alternatively, you can set this to "vary", which will cause the simulation to always synchronize with the current frame delta times.

Default Value

1/60

updateLoop?: "follow" | "independent"

Set the update loop strategy for the physics world.

If set to "follow", the physics world will be stepped in a useFrame callback, managed by @react-three/fiber. You can use updatePriority prop to manage the scheduling.

If set to "independent", the physics world will be stepped in a separate loop, not tied to the render loop. This is useful when using the "demand" frameloop strategy for the @react-three/fiber <Canvas />.

See

https://docs.pmnd.rs/react-three-fiber/advanced/scaling-performance#on-demand-rendering

Default Value

"follow"

updatePriority?: number

The update priority at which the physics simulation should run. Only used when updateLoop is set to "follow".

See

https://docs.pmnd.rs/react-three-fiber/api/hooks#taking-over-the-render-loop

Default Value

undefined

Generated using TypeDoc