dimforge / rapier.rs

Official website for the Rapier physics engine.
https://rapier.rs
20 stars 49 forks source link

Fix error in the Javascript 2D example #20

Closed grimko closed 3 years ago

grimko commented 3 years ago

The example code for Rapier2D in the JS section cannot work.

This line:

console.log("Rigid-body position: ", position.x, position.y, position.z);

Has to be changed to:

console.log("Rigid-body position: ", position.x, position.y);

Because position.z does not exist in the 2D coordinates system.

sebcrozet commented 3 years ago

Well spotted. Thanks!