# Native three.js rapier physical body

**URL:** <https://discourse.threejs.org/t/native-three-js-rapier-physical-body/72458>\
**Category:** Questions\
**Tags:** rapier\
**Created:** [October 5, 2024, 8:43pm UTC](https://discourse.threejs.org/t/native-three-js-rapier-physical-body/72458 "2024-10-05T20:43:35Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![asdrubal](https://yyz1.discourse-cdn.com/flex035/user_avatar/discourse.threejs.org/asdrubal/32/42795_2.png) [@asdrubal](https://discourse.threejs.org/u/asdrubal)\
**Post date:** [October 5, 2024, 8:43pm UTC](https://discourse.threejs.org/t/native-three-js-rapier-physical-body/72458/1 "2024-10-05T20:43:35Z")

</div>

I was looking at the rapier example

[https://threejs.org/examples/?q=rapi#physics\_rapier\_instancing](https://threejs.org/examples/?q=rapi#physics_rapier_instancing)

And I tried using:

```js
import { RapierPhysics } from "three/addons/physics/RapierPhysics.js";

const physics = await RapierPhysics();

physics.addScene(scene);

```

works fine, affect all meshes with mass:

```js
mesh.userData = {
    physics: {
        mass: 1
    }
}

```

But when I tried to get the physical body of any affected mesh, I couldn’t find it ☹

So, I’m asking:

1. How to move a mesh with this native rapier?
2. Shoud I use `@dimforge/rapier3d` instead?

---

<div class="post-metadata">

**Author:** ![Fennec](https://yyz1.discourse-cdn.com/flex035/user_avatar/discourse.threejs.org/fennec/32/59265_2.png) [@Fennec](https://discourse.threejs.org/u/Fennec)\
**Post date:** [October 6, 2024, 3:49am UTC](https://discourse.threejs.org/t/native-three-js-rapier-physical-body/72458/2 "2024-10-06T03:49:05Z")

</div>

This seems to be relatively new and undocumented (for now).  
([three.js/examples/jsm/physics/RapierPhysics.js at 37d6f280a5cd642e801469bb048f52300d31258e · mrdoob/three.js · GitHub](https://github.com/mrdoob/three.js/blob/37d6f280a5cd642e801469bb048f52300d31258e/examples/jsm/physics/RapierPhysics.js))

> <https://github.com/mrdoob/three.js/blob/37d6f280a5cd642e801469bb048f52300d31258e/examples/jsm/physics/RapierPhysics.js#L231>

From the source code, only four methods are exposed. The `world` variable is private, with no external access and limited access to Rapier’s API.

If you need more control over the engine, I suppose you’ll have to go with option `2` and use `@dimforge/rapier3d`, at least for the time being.
