Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
有什么方法可以在碰撞后以相同的速度在 AndEngine 中的 Box2d 中反映物理体。假设如果一个球以速度 X 撞到墙壁并反射,那么反射后的速度必须再次为 X。那可能吗?如果是这样,请告诉我该怎么做。
你要找的是第二个参数
PhysicsFactory.createFixtureDef(pDensity, pElasticity, pFriction)
如果您将恢复系数(弹性)设置为 1,则身体应该是完全有弹性的,因此在它从墙上反弹后具有相同的速度。那是理论上的。在实践中,由于计算精度有限,身体仍然会失去一点动量。