@threlte/rapier 3.0.0-next.19 → 3.0.0-next.20

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.
@@ -63,7 +63,14 @@ export const createCollidersFromChildren = (object, collidersType, world, rigidB
63
63
  break;
64
64
  case 'trimesh':
65
65
  {
66
- description = ColliderDesc.trimesh(new Float32Array(geometry.attributes.position.array), new Uint32Array(geometry.index?.array ?? []));
66
+ const scaleX = scale.x;
67
+ const vertices = new Float32Array(geometry.attributes.position.array);
68
+ if (scaleX !== 1) {
69
+ for (let i = 0; i < vertices.length; i++) {
70
+ vertices[i] *= scaleX;
71
+ }
72
+ }
73
+ description = ColliderDesc.trimesh(vertices, new Uint32Array(geometry.index?.array ?? []));
67
74
  }
68
75
  break;
69
76
  case 'capsule':
@@ -78,7 +85,14 @@ export const createCollidersFromChildren = (object, collidersType, world, rigidB
78
85
  break;
79
86
  case 'convexHull':
80
87
  {
81
- description = ColliderDesc.convexHull(new Float32Array(geometry.attributes.position.array));
88
+ const scaleX = scale.x;
89
+ const vertices = new Float32Array(geometry.attributes.position.array);
90
+ if (scaleX !== 1) {
91
+ for (let i = 0; i < vertices.length; i++) {
92
+ vertices[i] *= scaleX;
93
+ }
94
+ }
95
+ description = ColliderDesc.convexHull(vertices);
82
96
  }
83
97
  break;
84
98
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@threlte/rapier",
3
- "version": "3.0.0-next.19",
3
+ "version": "3.0.0-next.20",
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",
@@ -31,7 +31,7 @@
31
31
  "type-fest": "^4.15.0",
32
32
  "typescript": "^5.6.3",
33
33
  "vite": "^5.2.8",
34
- "@threlte/core": "8.0.0-next.36"
34
+ "@threlte/core": "8.0.0-next.39"
35
35
  },
36
36
  "peerDependencies": {
37
37
  "@dimforge/rapier3d-compat": ">=0.14",