@threlte/rapier 3.4.0 → 3.4.2

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,4 +1,4 @@
1
- import { Euler, Object3D, Quaternion, Vector3 } from 'three';
1
+ import { Object3D, Quaternion, Vector3 } from 'three';
2
2
  /**
3
3
  * Get the world position of an object.
4
4
  * If no target is provided, a globally used
@@ -19,16 +19,6 @@ export declare const getWorldPosition: (object: Object3D, target?: Vector3) => V
19
19
  * @returns
20
20
  */
21
21
  export declare const getWorldQuaternion: (object: Object3D, target?: Quaternion) => Quaternion;
22
- /**
23
- * Get the world rotation of an object.
24
- * If no target is provided, a globally used
25
- * temporary Euler is used.
26
- *
27
- * @param object
28
- * @param target
29
- * @returns
30
- */
31
- export declare const getWorldRotation: (object: Object3D, target?: Euler) => Euler;
32
22
  /**
33
23
  * Get the world scale of an object.
34
24
  * If no target is provided, a globally used
@@ -1,7 +1,6 @@
1
- import { Euler, Object3D, Quaternion, Vector3 } from 'three';
1
+ import { Object3D, Quaternion, Vector3 } from 'three';
2
2
  const tempPosition = new Vector3();
3
3
  const tempQuaternion = new Quaternion();
4
- const tempRotation = new Euler();
5
4
  const tempScale = new Vector3();
6
5
  /**
7
6
  * Get the world position of an object.
@@ -27,21 +26,6 @@ export const getWorldPosition = (object, target) => {
27
26
  export const getWorldQuaternion = (object, target) => {
28
27
  return object.getWorldQuaternion(target ?? tempQuaternion);
29
28
  };
30
- /**
31
- * Get the world rotation of an object.
32
- * If no target is provided, a globally used
33
- * temporary Euler is used.
34
- *
35
- * @param object
36
- * @param target
37
- * @returns
38
- */
39
- export const getWorldRotation = (object, target) => {
40
- object.getWorldQuaternion(tempQuaternion);
41
- return target
42
- ? target.setFromQuaternion(tempQuaternion)
43
- : tempRotation.setFromQuaternion(tempQuaternion);
44
- };
45
29
  /**
46
30
  * Get the world scale of an object.
47
31
  * If no target is provided, a globally used
@@ -1,5 +1,4 @@
1
1
  import type { ColliderDesc } from '@dimforge/rapier3d-compat';
2
2
  import type { Vector3 } from 'three';
3
3
  import type { ColliderShapes } from '../types/types.js';
4
- export declare const scaleVertices: (vertices: ArrayLike<number>, scale: Vector3) => number[];
5
4
  export declare const scaleColliderArgs: <Shape extends ColliderShapes>(shape: Shape, args: Parameters<(typeof ColliderDesc)[Shape]>, scale: Vector3) => Parameters<(typeof ColliderDesc)[Shape]>;
@@ -1,4 +1,4 @@
1
- export const scaleVertices = (vertices, scale) => {
1
+ const scaleVertices = (vertices, scale) => {
2
2
  const scaledVerts = Array.from(vertices);
3
3
  for (let i = 0; i < vertices.length / 3; i++) {
4
4
  scaledVerts[i * 3] *= scale.x;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@threlte/rapier",
3
- "version": "3.4.0",
3
+ "version": "3.4.2",
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",
@@ -23,14 +23,13 @@
23
23
  "rimraf": "^6.0.1",
24
24
  "svelte": "5.53.6",
25
25
  "svelte-check": "^4.3.1",
26
- "svelte2tsx": "^0.7.6",
27
26
  "three": "^0.175.0",
28
27
  "tslib": "^2.6.2",
29
28
  "type-fest": "^4.15.0",
30
29
  "typescript": "5.9.2",
31
30
  "typescript-eslint": "^8.32.0",
32
31
  "vite": "^7.1.4",
33
- "@threlte/core": "8.5.0"
32
+ "@threlte/core": "8.5.8"
34
33
  },
35
34
  "peerDependencies": {
36
35
  "@dimforge/rapier3d-compat": ">=0.16",
@@ -65,7 +64,10 @@
65
64
  "types": "./dist/index.d.ts",
66
65
  "svelte": "./dist/index.js",
67
66
  "files": [
68
- "dist"
67
+ "dist",
68
+ "!dist/**/__tests__",
69
+ "!dist/**/*.test.*",
70
+ "!dist/**/*.spec.*"
69
71
  ],
70
72
  "scripts": {
71
73
  "dev": "vite dev",