物理模拟
中级 程序员
Warning
Bullet Physics is being phased out. We no longer plan to support or expand its features as our focus shifts to Bepu Physics. We recommend transitioning to Bepu Physics for access to the latest updates and ongoing improvements.
Stride 的物理由 Simulation 类控制。 你可以通过修改 PhysicsSettings 中的标志来改变 Stride 初始化模拟的方式,这些标志可在 GameSettings 资源属性中访问。
Note
你的场景必须至少有一个碰撞体,Stride 才能初始化 Simulation 实例。

CollisionsOnly初始化的 Simulation 只开启碰撞检测,没有其他物理功能。对象不会对物理力做出反应。ContinuousCollisionDetection初始化的 Simulation 带有连续碰撞检测(CCD)。CCD 防止快速移动的实体(如子弹)错误地穿过其他实体。
Note
SoftBodySupport、MultiThreaded 和 UseHardwareWhenPossible 标志目前已禁用。
在运行时,你可以更改一些 Simulation 参数:
Gravity— 全局重力,单位为每秒平方的世界单位FixedTimeStep— 模拟时间步长的长度,以秒为单位MaxSubSteps— 引擎每次更新采用的固定时间步长的最大数量