简体   繁体   中英

How to disable physics/forces on box2d dynamic body?

I have a dynamic body that constantly changes linear velocity, I want my dynamic body to act like a kinematic body which is not affected by forces and can move in a linear way. But I need to use dynamic body because I need to detect collision.

您可以在renderact方法中的动态物体上调用setLinearVelocity方法-尽管它会受到重力的影响,但您将在每一步中覆盖它的速度,并且它的运动方式类似于运动

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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