@threlte/rapier 3.0.0-next.10 → 3.0.0-next.12

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,6 +1,7 @@
1
+ import { isInstanceOf } from '@threlte/core';
1
2
  export const isVector3 = (v) => {
2
- return v.isVector3;
3
+ return isInstanceOf(v, 'Vector3');
3
4
  };
4
5
  export const isEuler = (v) => {
5
- return v.isEuler;
6
+ return isInstanceOf(v, 'Euler');
6
7
  };
@@ -1,4 +1,4 @@
1
- import { Collider, World, RigidBody } from '@dimforge/rapier3d-compat';
1
+ import { Collider, RigidBody, World } from '@dimforge/rapier3d-compat';
2
2
  import { type Object3D } from 'three';
3
3
  import type { AutoCollidersShapes } from '../types/types';
4
4
  /**
@@ -1,4 +1,5 @@
1
1
  import { ActiveEvents, ColliderDesc } from '@dimforge/rapier3d-compat';
2
+ import { isInstanceOf } from '@threlte/core';
2
3
  import { Quaternion, Vector3 } from 'three';
3
4
  const offset = new Vector3();
4
5
  const worldPosition = new Vector3();
@@ -33,7 +34,7 @@ export const createCollidersFromChildren = (object, collidersType, world, rigidB
33
34
  rigidBodyParentObject?.getWorldPosition(rigidBodyWorldPos);
34
35
  rigidBodyParentObject?.getWorldQuaternion(rigidBodyWorldQuatInversed).invert();
35
36
  object.traverse((child) => {
36
- if ('isMesh' in child) {
37
+ if (isInstanceOf(child, 'Mesh')) {
37
38
  const { geometry } = child;
38
39
  const worldPos = child.getWorldPosition(worldPosition);
39
40
  const translation = worldPos.sub(rigidBodyWorldPos);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@threlte/rapier",
3
- "version": "3.0.0-next.10",
3
+ "version": "3.0.0-next.12",
4
4
  "author": "Grischa Erbe <hello@legrisch.com> (https://legrisch.com)",
5
5
  "license": "MIT",
6
6
  "description": "Components and hooks to use the Rapier physics engine in Threlte",
@@ -11,7 +11,7 @@
11
11
  "@sveltejs/package": "^2.3.1",
12
12
  "@sveltejs/vite-plugin-svelte": "^3.1.0",
13
13
  "@types/node": "^20.12.7",
14
- "@types/three": "^0.166.0",
14
+ "@types/three": "^0.169.0",
15
15
  "@typescript-eslint/eslint-plugin": "^7.6.0",
16
16
  "@typescript-eslint/parser": "^7.6.0",
17
17
  "@yushijinhun/three-minifier-rollup": "^0.4.0",
@@ -26,12 +26,12 @@
26
26
  "svelte-check": "^3.6.9",
27
27
  "svelte-preprocess": "^5.1.3",
28
28
  "svelte2tsx": "^0.7.6",
29
- "three": "^0.166.1",
29
+ "three": "^0.169.0",
30
30
  "tslib": "^2.6.2",
31
31
  "type-fest": "^4.15.0",
32
32
  "typescript": "^5.4.5",
33
33
  "vite": "^5.2.8",
34
- "@threlte/core": "8.0.0-next.17"
34
+ "@threlte/core": "8.0.0-next.20"
35
35
  },
36
36
  "peerDependencies": {
37
37
  "@dimforge/rapier3d-compat": ">=0.14",