aframe-rapier-physics

A-Frame Rapier Phsyics

This is a Rapier A-Frame integration implementing a physics system similar to the existing aframe-physics-system for the CANNON and Ammo drivers.

Main Features

Usage

To include the library in your project, place it after the A-Frame one, for instance:

<head>
...
   <script src="https://aframe.io/releases/1.7.1/aframe.min.js"></script>
   ...
   <script type="module" src="../aframe-rapier.js"></script>
...
</head>

Notice the type attribute set to module. This is required because Rapier must be initialized asyncronously.

See the docs for a description of the system and components.

See the examples for various usages of the system.

Motivation

Compared to existing tools for physics with A-Frame, this one has the following advantages:

Acknowledgments

As a starting point for my implementation, I have used the Rapier example from the three.js repository

For the automated computing of collision shapes from THREE objects, a lot of inspiration came from three-to-ammo.

The examples and some related components have been adapted from those in aframe-physics-system.