更新时间:2023-01-23 19:04:35
应用你的冲动后:
[node.physicsBody applyAngularImpulse:theImpulse];
只需将角速度钳制到最大速度,其最大速度取决于您想要允许车轮的速度旋转:
Simply clamp the angular velocity to a maximum speed whose value depends on how fast you want to allow the wheel to spin:
const CGFloat maxAngularVelocity = 2.5;
node.physicsBody.angularVelocity = MIN(node.physicsBody.angularVelocity, maxAngularVelocity);