Skip to content
N8n5h edited this page Mar 18, 2021 · 22 revisions

Physics

Sections

Introduction

Armory is designed to work with any physics engine. Internally, a glue code is written which binds the physics simulation. This lets you pick the most suitable physics engine depending on project needs and makes Armory future-proof.

If no rigid body is detected in the scene, Armory skips including the physics module to save space and performance. To force the physics module, set Armory Project - Modules - Physics from Auto to Enabled.

By default, Armory is configured to use a full featured Bullet physics. If lighter engine is sufficient, Oimo physics is provided. With Oimo, triangle mesh shapes are approximated using convex hulls.

To pick active physics engine, set Armory Project - Modules - Physics Engine property.

Rigid bodies

A rigid body is a type of body that can be used to simulate physical interactions between solid bodies.

Rigid body demonstration

To start using rigid body simulations in Armory, they have to be enabled for Blender first. To do so, simply select the object that will interact in the physic simulation, then go to the Physics properties tab, on the Properties editor, and click on the Rigid Body object.

Enabling rigid body demonstration

If you hit Play (default F5), the object should be immediately free falling out of view

Free falling demonstration

If this doesn't happen for whatever reason, you may want to give the troubleshoot section a look.

When you enable rigid body on an object, you will notice an array of options to configure it will appear:

Rigid body configuration

Type

There are two types of rigid bodies, Active and Passive. This options allows setting what role has a rigid body in the simulation. Active rigid bodies are affected by gravity by default (like you might have noticed earlier), whereas Passive rigid bodies are not. Active are mostly used for physics objects that must be controlled through physics interactions (e.g. a character or a car), and Passive may be used for objects that are not controlled by physics and can interact with Active rigid bodies (e.g. a platform or a wall).

Basics of moving a rigid body

RigidBody API explained

Static bodies

Creating a static body

Trigger bodies

Creating a trigger body

Raycast

Physics World

Vehicle body

Soft bodies

Creating a soft body

Cloth simulation

Creating cloth simulation

Common pitfalls / troubleshoot

Wrong scale / rotations may break simulations

Make sure your Blender objects that interact in physics simulations always have scale of (1.0, 1.0, 1.0) (rotation and location may be arbitrary) inside of Blender:

How to check scale and rotation in blender

You can always apply the scale from within Blender by selecting the object, opening the Object menu entry and then navigating to Apply and then clicking on Scale, or simply hitting the shortcut Ctrl + A and then hitting the s key or simply selecting the option from the floating menu.

location of apply rotation and scale option

Clone this wiki locally