How to detect whether the “box2d” rigid body is in the rising stage, falling stage, or landing stage?
I use ‘ApplyImpulse’ to achieve the jumping of game characters. Now I need to know whether the rigid body is in the rising stage, falling stage, or landing (jumping completed) stage?
The ‘box2d c++’ version seems to have been updated to the ‘3x’ version,
And the “box2d” versions of “as3” and “openfl” are still released more than 10 years ago. Has the “as3 team or openfl team” considered synchronously updating “box2d” to the latest version? Thank you
I’ve always just developed my own physics, as needed. That’s not to say Box2D isn’t worthwhile, it’s just not something I’ve felt the need for in my projects.
I don’t want to hijack your thread with my reasons though, I was just letting you know why I hadn’t said anything yet.
That’s the kind of update that should be done by the community, on both sides. A few people can’t keep all the libraries out there updated : it’s far too much work.
Of course it is : it’s as3 or haxe code, code runs on the CPU. For example Starling uses the GPU to draw triangles in the end but everything else runs on the CPU
“A lot” or not depends on what you put in the simulation. I don’t remember Box2D, only used it once or twice a looong time ago, but there should be something defining how many steps the simulation uses. You might want to try lowering that value and see if your game still runs correctly as it will improve performance.
Echo seems to be actively maintained, I used Nape last year on an as3 job and was quite impressed by its performance (but I didn’t do any benchmark)
EDIT : oh and about your original question, again I don’t remember Box2D at all but bodies should have a velocity property : check body.velocity.y to tell if it’s going up or down