Skip to content

Introduction

Most of the game needs physics to simulate collisions, forces, gravity, and more. These concepts can't be applied directly to your objects for performance reasons, so you need a physics engine to handle them.

This is often a complex and time-consuming task, as you'll need to understand the underlying physics engine to synchronize your rendering with the physics simulation.

Fibbo provides a simple and easy-to-use API that abstracts the complexity of the underlying physics engine (Rapier), so you can focus on your game logic.

How to setup the physics engine

The FScene component (either in 2d or 3d) class exposes an initPhysics method that initializes the physics engine for you. This method is asynchronous, so you need to use an async function to call it.

Once the physics engine is initialized, you can start adding physics to the components in your scene.

TIP

A fair amount of the documentation was inspired by the Rapier documentation.