> Learn all about the powerful physics capabilities of Babylon.js.

Source: https://doc.babylonjs.com/features/featuresDeepDive/physics

# Support for Physics Engines

Physics engines are third-party external programs that can be plugged into Babylon.js. Depending on their features, they emulate "real-life" interactions between objects, which can be meshes, solid particles from the solid particle system, or some cameras. One feature of a physics engine is the addition of gravity to a scene.

There are 2 physics architectures in Babylon.js.

- a Version 2 (V2 for short) with support for modern Physics Engines.

  > [🚀 You can find the V2 API documented here.](https://doc.babylonjs.com/features/featuresDeepDive/physics/usingPhysicsEngine)  

- Version 1 (V1 for short), which is a pre-6.0 Legacy API.

  > [⚠️ The documentation for V1 has been moved to the Legacy section.](https://doc.babylonjs.com/legacy/physics)

#### We strongly recommend using V2 over V1. [A migration guide is here](https://doc.babylonjs.com/features/featuresDeepDive/physics/migrate).

## Physics V2

There are plugins for 1 physics engine:

1. Havok - a powerful engine used in AAA games.

It needs to be enabled before use.

This architecture allows finer-grained control over your physics scene by distinguishing between collision shapes and physical bodies.
A typical use case is to have one collision shape used by numerous bodies.
This allows a lower memory footprint and more efficient memory addressing.
A special effort has been put into better performance for a huge number of bodies. This is also the case for the collision callback mechanism.

A broad overview of the Physics V2 advancements is available on this [Medium article](https://medium.com/@babylonjs/physics-v2-overview-ed36039ce1e7).

## Physics V1

There are plugins for 3 physics engines:

1. Cannon.js - a wonderful physics engine written entirely in JavaScript.
2. Oimo.js - a JS port of the lightweight Oimo physics engine.
3. Ammo.js - a JS port of the bullet physics engine.

All need to be enabled before use.

Interactions between objects are achieved by impostors, simple objects that are attached to complex objects in a scene. The impostor can be assigned physical attributes such as mass, friction, a coefficient of restitution, impulse, and linear and angular velocity.

Two imposters can be connected using joints such as a hinge or ball and socket.

Ammo also allows the creation of soft bodies.

## Pages in this section

- [Using A Physics Engine](https://doc.babylonjs.com/features/featuresDeepDive/physics/usingPhysicsEngine.md): Learn how to use one of the available physics engines in Babylon.js.
- [Physics V2 core concepts](https://doc.babylonjs.com/features/featuresDeepDive/physics/rigidBodies.md): All the concepts and objects designed for Physics V2 plugins
- [Physics V2 Shapes](https://doc.babylonjs.com/features/featuresDeepDive/physics/shapes.md): Describing Shapes
- [Forces](https://doc.babylonjs.com/features/featuresDeepDive/physics/forces.md): Learn all about applying physical forces in Babylon.js.
- [Physics Compounds](https://doc.babylonjs.com/features/featuresDeepDive/physics/compounds.md): Learn how to use compounds to model complex objects with simple primitives.
- [Aggregates](https://doc.babylonjs.com/features/featuresDeepDive/physics/aggregates.md): How to use Physics Aggregate for fast and easy physics scene creation.
- [Collision Events](https://doc.babylonjs.com/features/featuresDeepDive/physics/collisionEvents.md): Learn how to access collision events in Babylon.js.
- [Constraints](https://doc.babylonjs.com/features/featuresDeepDive/physics/constraints.md): Learn all about using Constraints with Babylon.js.
- [Raycast](https://doc.babylonjs.com/features/featuresDeepDive/physics/raycast.md): How to use Physics for fast raycasting.
- [Migrate from Physics V1](https://doc.babylonjs.com/features/featuresDeepDive/physics/migrate.md): A guide on best practices to port a Physics V1 scene to V2
- [Performance Tips](https://doc.babylonjs.com/features/featuresDeepDive/physics/perfTips.md): A guide on best practices to achieve maximum performance with the Physics V2 API
- [Ragdolls](https://doc.babylonjs.com/features/featuresDeepDive/physics/ragdolls.md): A guide on ragdoll creation with the Physics V2 API
- [Shape cast](https://doc.babylonjs.com/features/featuresDeepDive/physics/shapeCast.md): A guide on shape casting with the Physics V2 API
- [Physics prestep](https://doc.babylonjs.com/features/featuresDeepDive/physics/prestep.md): How to use prestep to apply changes from scene to physics world
- [Physics character controller](https://doc.babylonjs.com/features/featuresDeepDive/physics/characterController.md): How to use the character controller
- [Using Havok and the Havok Plugin](https://doc.babylonjs.com/features/featuresDeepDive/physics/havokPlugin.md): Learn how to use the Havok plugin offered by Babylon.js.
