简体   繁体   English

为什么还要使用运动机构? Box2D的

[英]Why even use kinematic bodies? box2d

Why should you even use kinematic bodies instead of dynamic bodies with no gravity? 为什么还要使用运动物体代替没有重力的动态物体? I mean a dynamic body can also collide with static bodies and have some other adjustable parameters that kinematic bodies do not have, right. 我的意思是,动态物体还可以与静态物体碰撞,并且具有运动物体没有的其他一些可调参数,对。 Therefore, I would really love to hear why you would want to do this and if it even can be lead to some advantages. 因此,我真的很想听听您为什么要这样做,甚至可以带来一些好处。

Your time is much appreciated! 感谢您的宝贵时间!

It's a matter of what you want b2World::Step to do to the body. b2World::Step您想要b2World::Step对身体做的事情。 Basically this method's body related post-conditions are as follows: 基本上,此方法与身体相关的后置条件如下:

  • Static bodies are unmoved. 静态物体不动。
  • Kinetic bodies are moved based on their previous velocities. 动体根据其先前的速度移动。
  • Dynamic bodies are moved based on their previous velocities, gravity, applied forces, applied impulses, masses, damping, and the restitution and friction values of their fixtures when they experience collisions. 动体会根据其先前的速度,重力,所施加的力,所施加的脉冲,质量,阻尼以及遇到碰撞时其固定装置的恢复和摩擦值进行移动。

So kinematic bodies can be useful when the only thing that you want to have happen to the body is to have it moved based on a velocity you'd given it. 因此,当您要发生在身体上的唯一事情是根据给定的速度移动身体时,运动身体可能会很有用。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM