-
Notifications
You must be signed in to change notification settings - Fork 400
Physics
LumixEngine uses PhysX as physics engine, however it is encapsulated as a plugin, therefore any other physics engine can be used.
There are following physics component types:
- Rigid body
- Heightfield
- Character controller
- Joints
When two rigid bodies collide, contact event is generated and sent to script - function onContact(entity, x, y, z) is called.
Collisions can have different outcome for different objects. For example if we want to determine visibility, we do not want raycast to collide with glass. But normal objects (bullets, flies, ...) should collide. Physical layer is a "type" of physical objects and each object is in exactly one layer. Two objects do not collide if their layers do not collide.
Collision matrix (which layer collides with which) can be set in "Physics" window:
Also layers can be added, removed or renamed here.
Layers can be assigned to objects in the property grid:
https://www.youtube.com/watch?v=zJTbv7pBKtk&feature=youtu.be&ab_channel=LumixEngine