|
@@ -1,6 +1,6 @@
|
|
import { Clock, Vector3, Quaternion, Matrix4 } from 'three';
|
|
import { Clock, Vector3, Quaternion, Matrix4 } from 'three';
|
|
|
|
|
|
-const RAPIER_PATH = 'https://cdn.skypack.dev/@dimforge/[email protected]1.2';
|
|
|
|
|
|
+const RAPIER_PATH = 'https://cdn.skypack.dev/@dimforge/[email protected].0';
|
|
|
|
|
|
const frameRate = 60;
|
|
const frameRate = 60;
|
|
|
|
|
|
@@ -9,7 +9,7 @@ const ZERO = new Vector3();
|
|
|
|
|
|
let RAPIER = null;
|
|
let RAPIER = null;
|
|
|
|
|
|
-function getCollider( geometry ) {
|
|
|
|
|
|
+function getShape( geometry ) {
|
|
|
|
|
|
const parameters = geometry.parameters;
|
|
const parameters = geometry.parameters;
|
|
|
|
|
|
@@ -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 gravity = new Vector3( 0.0, - 9.81, 0.0 );
|
|
const world = new RAPIER.World( gravity );
|
|
const world = new RAPIER.World( gravity );
|
|
@@ -77,7 +77,7 @@ async function RapierPhysics() {
|
|
|
|
|
|
function addMesh( mesh, mass = 0, restitution = 0 ) {
|
|
function addMesh( mesh, mass = 0, restitution = 0 ) {
|
|
|
|
|
|
- const shape = getCollider( mesh.geometry );
|
|
|
|
|
|
+ const shape = getShape( mesh.geometry );
|
|
|
|
|
|
if ( shape === null ) return;
|
|
if ( shape === null ) return;
|
|
|
|
|