Skip to content

Commit

Permalink
Examples: Improved Rapier example.
Browse files Browse the repository at this point in the history
  • Loading branch information
mrdoob committed Mar 28, 2024
1 parent a03a74a commit 8416704
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
8 changes: 4 additions & 4 deletions examples/jsm/physics/RapierPhysics.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { Clock, Vector3, Quaternion, Matrix4 } from 'three';

const RAPIER_PATH = 'https://cdn.skypack.dev/@dimforge/rapier3d-compat@0.11.2';
const RAPIER_PATH = 'https://cdn.skypack.dev/@dimforge/rapier3d-compat@0.12.0';

const frameRate = 60;

Expand All @@ -9,7 +9,7 @@ const ZERO = new Vector3();

let RAPIER = null;

function getCollider( geometry ) {
function getShape( geometry ) {

const parameters = geometry.parameters;

Expand Down Expand Up @@ -43,7 +43,7 @@ async function RapierPhysics() {

}

// Docs: https://rapier.rs/docs/api/javascript/JavaScript3D/
// Docs: https://rapier.rs/docs/api/javascript/JavaScript3D/

const gravity = new Vector3( 0.0, - 9.81, 0.0 );
const world = new RAPIER.World( gravity );
Expand Down Expand Up @@ -77,7 +77,7 @@ async function RapierPhysics() {

function addMesh( mesh, mass = 0, restitution = 0 ) {

const shape = getCollider( mesh.geometry );
const shape = getShape( mesh.geometry );

if ( shape === null ) return;

Expand Down
2 changes: 1 addition & 1 deletion examples/physics_rapier_instancing.html
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
<body>

<div id="info">
<a href="https://threejs.org" target="_blank" rel="noopener">three.js</a> physics - rapier3d instancing
<a href="https://threejs.org" target="_blank" rel="noopener">three.js</a> physics - <a href="https://github.com/dimforge/rapier.js" target="_blank">rapier</a> instancing
</div>

<script type="importmap">
Expand Down

0 comments on commit 8416704

Please sign in to comment.