Posted March 08, 2024 by kindeyegames
#rapier
This is a beta test of using the Rapier library and running in a worker, both to reduce CPU usage. Features may be buggy or broken, do not use for production code.
This version only works in PREVIEW for now (if you really want to releases something you can hack the export files to fix an include path.) Now works in export also, but requires a remote fetch of the physics library for now (so requires internet connection).
Some added features
- Kinematic Character Controller
- Update Body removes current body from 3DShape and adds a new one, taking in to account any changes of the 3DShape. Use this when you set an object manually (e.g. change size, change rotation, change location), use sparingly. Not meant to be used every tick, since it deletes and creates a new body.
- SetMass and Mass property
- SetWorldScale (render to physics world scale, typically 100)
- Physics render (this is slow but helpful for debug, shows physics view of bodies), need the render addon and Enabling through an ACE.
- Set collision groups (membership and filter), see: https://rapier.rs/docs/user_guides/javascript/colliders
ISome features are not functional yet: