Skip to content

Commit 8416704

Browse files
committed
Examples: Improved Rapier example.
1 parent a03a74a commit 8416704

File tree

2 files changed

+5
-5
lines changed

2 files changed

+5
-5
lines changed

examples/jsm/physics/RapierPhysics.js

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import { Clock, Vector3, Quaternion, Matrix4 } from 'three';
22

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

55
const frameRate = 60;
66

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

1010
let RAPIER = null;
1111

12-
function getCollider( geometry ) {
12+
function getShape( geometry ) {
1313

1414
const parameters = geometry.parameters;
1515

@@ -43,7 +43,7 @@ async function RapierPhysics() {
4343

4444
}
4545

46-
// Docs: https://rapier.rs/docs/api/javascript/JavaScript3D/
46+
// Docs: https://rapier.rs/docs/api/javascript/JavaScript3D/
4747

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

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

80-
const shape = getCollider( mesh.geometry );
80+
const shape = getShape( mesh.geometry );
8181

8282
if ( shape === null ) return;
8383

examples/physics_rapier_instancing.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
<body>
1010

1111
<div id="info">
12-
<a href="https://threejs.org" target="_blank" rel="noopener">three.js</a> physics - rapier3d instancing
12+
<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
1313
</div>
1414

1515
<script type="importmap">

0 commit comments

Comments
 (0)