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.

debug?: boolean

Enable debug rendering of the physics world.

Default Value

false

erp?: number

The Error Reduction Parameter in between 0 and 1, is the proportion of the positional error to be corrected at each time step.

Default Value

0.8

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

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