I am the only one feeling queasy at a system that treats slow-moving as non-moving?
>
) Sleeping is a technique that reduces the cost of simulating objects that are not moving to improve performance. We can tweak it by adding a SleepingThreshold resource:
fn main() {
App::new()
.add_plugins(DefaultPlugins)
.add_plugins(PhysicsPlugins::default())
// These are the default values
.insert_resource(SleepingThreshold {
linear: 0.1,
angular: 0.2
I'm currently using xpbd to work on a physics driven 2d fighting game, and as of right now, I'm really enjoying it! Until now there was only one problem where some collisions would vanish for one frame. But stuff like that can be easily worked around and even better reported and fixed.
XPBD has caught my fascination. I've done a couple trial implementations and put AABB-only XPBD in my latest game jam.
The only thing I haven't gotten to work is rotation. Everything else, the complexity just melts away. Linear algebra? Nope. Just Vec3. Matrix? Solver? You hit your head, it's 1998, just iterate over all the constraints and satisfy them. Collision margins? Skill issue. Broadphase? GJK? Don't over-think it. Throw a modern CPU at it, do the collect_pairs optimization, then realize you were actually malloc-bound and fix that, and it can handle 100 or so objects without blinking. Don't need Bullet.
The velocity fix-up step also threw me off, but having prototyped it for AABBs, I suspect I can translate it back to generic shapes. I skipped it at first and all my collisions were slightly elastic.
> ) Sleeping is a technique that reduces the cost of simulating objects that are not moving to improve performance. We can tweak it by adding a SleepingThreshold resource:
fn main() { App::new() .add_plugins(DefaultPlugins) .add_plugins(PhysicsPlugins::default()) // These are the default values .insert_resource(SleepingThreshold { linear: 0.1, angular: 0.2