Skip to content

Physics

Mikulas Florek edited this page Mar 28, 2021 · 11 revisions

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

Contact

When two rigid bodies collide, contact event is generated and sent to script - function onContact(entity, x, y, z) is called.

Collision filters

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:

Collision matrix

Also layers can be added, removed or renamed here.

Layers can be assigned to objects in the property grid:

Layer

Vehicles

https://www.youtube.com/watch?v=zJTbv7pBKtk&feature=youtu.be&ab_channel=LumixEngine

Clone this wiki locally