top | item 37327129

(no title)

klavinski | 2 years ago

Good work, Altanis! After exactness, speed is certainly a priority. For my engine, I settled on Rapier, which also offers excellent performance (and determinism!). Do you think you could compare it with Kinetics?

Can you provide a high-level view of how you achieve that speed? I have also heard of eXtended Position-Based Dynamics as one of the latest improvements in physics engine. Do you have a perspective on that?

discuss

order

altanis|2 years ago

I will bench Rapier against Kinetics in a few minutes and upload results to GitHub. I'm sure it's much faster though, it uses Rust

As for the speed the engine provides, not much. I just optimized my spatial hashgrid. It used to iterate over every entity, found the cell it was in, and checked the objects in that cell. I replaced it by iterating over each cell, and checking the entities in the cell. Performance went up significantly (iirc 1k squares took around 6-7 mspt, now its 0.4mspt)

The engine actually uses position based dynamics (the penetration depth changes position), as for extended position dynamics, I looked into it but "softness" isn't a field in the entity object, so I decided to not implement it (extended pbd iirc just fixes softness)