ccdSphereRadius approximates the object’s volume along its motion path in a single physics step, used to detect high-speed penetration. The radius should be close to the object’s minimum thickness or effective radius for reliable collision detection.
ccdThreshold defines the displacement within a single physics step that triggers CCD. It prevents unnecessary high-cost calculations. Recommended to set based on object size and velocity.
enableCCD specifies whether the physics system allows the use of Continuous Collision Detection (CCD) to reduce high-speed object penetration. Enabling it permits CCD, but actual effect depends on rigid body settings and CCD parameters.
fixedTimeStep
fixedTimeStep:number = ...
Zh
固定模拟步长用于定义物理世界中每个模拟步(Step)的时间长度(秒),保证物理计算在不同帧率下具有一致性和稳定性。步长越小,物理精度越高,但 CPU 开销增加。
En
fixedTimeStep defines the duration of a single physics simulation step (in seconds), ensuring consistent and stable physics results across different frame rates. Smaller values increase simulation accuracy at the cost of higher CPU usage.
flags
flags:number = 0
Zh
标志位,用于确定物理引擎的行为。
En
Flags that determine the behavior of the physics engine.
maxSubSteps
maxSubSteps:number = 1
Zh
单帧最大追帧步数限制一帧内最多执行的物理步数量,用于在掉帧时控制 CPU 峰值并防止物理追赶过度。数值越大,物理跟随时间越准确,但负载也越高。
En
maxSubSteps limits the maximum number of physics steps executed in a single frame. It helps control CPU spikes during frame drops. Higher values keep physics closer to real time but increase computational load.
Zh
PhysicsSettings 类用于创建物理配置信息。
En
The PhysicsSettings class is used to create physics configuration information.