@threlte/rapier 0.3.2 → 0.4.0

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.
package/dist/CHANGELOG.md CHANGED
@@ -1,5 +1,11 @@
1
1
  # @threlte/extras
2
2
 
3
+ ## 0.4.0
4
+
5
+ ### Minor Changes
6
+
7
+ - 4b4d7be: Added rapiers damping properties to the component <RigidBody>
8
+
3
9
  ## 0.3.2
4
10
 
5
11
  ### Patch Changes
@@ -16,10 +16,8 @@ export let linearVelocity = {};
16
16
  export let angularVelocity = {};
17
17
  export let gravityScale = 1;
18
18
  export let ccd = false;
19
- export let position = undefined;
20
- export let rotation = undefined;
21
- export let scale = undefined;
22
- export let lookAt = undefined;
19
+ export let angularDamping = 0;
20
+ export let linearDamping = 0;
23
21
  export let lockRotations = false;
24
22
  export let lockTranslations = false;
25
23
  export let enabledRotations = [
@@ -33,6 +31,10 @@ export let enabledTranslations = [
33
31
  true
34
32
  ];
35
33
  export let dominance = 0;
34
+ export let position = undefined;
35
+ export let rotation = undefined;
36
+ export let scale = undefined;
37
+ export let lookAt = undefined;
36
38
  const dispatcher = createEventDispatcher();
37
39
  const object = new Object3D();
38
40
  /**
@@ -107,6 +109,8 @@ $: {
107
109
  rigidBodyTemp.lockTranslations(lockTranslations, true);
108
110
  rigidBodyTemp.setEnabledRotations(...enabledRotations, true);
109
111
  rigidBodyTemp.setEnabledTranslations(...enabledTranslations, true);
112
+ rigidBodyTemp.setAngularDamping(angularDamping);
113
+ rigidBodyTemp.setLinearDamping(linearDamping);
110
114
  }
111
115
  /**
112
116
  * Add userData to the rigidBody
@@ -10,15 +10,17 @@ declare const __propDef: {
10
10
  angularVelocity?: import("@threlte/core").Rotation | undefined;
11
11
  gravityScale?: number | undefined;
12
12
  ccd?: boolean | undefined;
13
- position?: RigidBodyProperties['position'];
14
- rotation?: RigidBodyProperties['rotation'];
15
- scale?: RigidBodyProperties['scale'];
16
- lookAt?: RigidBodyProperties['lookAt'];
13
+ angularDamping?: number | undefined;
14
+ linearDamping?: number | undefined;
17
15
  lockRotations?: boolean | undefined;
18
16
  lockTranslations?: boolean | undefined;
19
17
  enabledRotations?: import("../../types/components").Boolean3Array | undefined;
20
18
  enabledTranslations?: import("../../types/components").Boolean3Array | undefined;
21
19
  dominance?: number | undefined;
20
+ position?: RigidBodyProperties['position'];
21
+ rotation?: RigidBodyProperties['rotation'];
22
+ scale?: RigidBodyProperties['scale'];
23
+ lookAt?: RigidBodyProperties['lookAt'];
22
24
  /**
23
25
  * Export the rigidBody only after positional initialization
24
26
  */ rigidBody?: RigidBody | undefined;
@@ -57,6 +57,20 @@ export declare type RigidBodyProperties = Omit<TransformableObjectProperties, 'o
57
57
  * Number in the range -127 to 127, default is 0
58
58
  */
59
59
  dominance?: number;
60
+ /**
61
+ * Damping lets you slow down a rigid-body automatically. This can be used to
62
+ * achieve a wide variety of effects like fake air friction. Larger values of
63
+ * damping coefficients lead to a stronger slow-downs. Their default
64
+ * values are 0.0 (no damping at all).
65
+ */
66
+ linearDamping?: number;
67
+ /**
68
+ * Damping lets you slow down a rigid-body automatically. This can be used to
69
+ * achieve a wide variety of effects like fake air friction. Larger values of
70
+ * damping coefficients lead to a stronger slow-downs. Their default
71
+ * values are 0.0 (no damping at all).
72
+ */
73
+ angularDamping?: number;
60
74
  };
61
75
  export declare type ColliderProperties<Shape extends ColliderShapes> = Omit<TransformableObjectProperties, 'object'> & {
62
76
  shape: Shape;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@threlte/rapier",
3
- "version": "0.3.2",
3
+ "version": "0.4.0",
4
4
  "author": "Grischa Erbe <hello@legrisch.com> (https://legrisch.com)",
5
5
  "license": "MIT",
6
6
  "devDependencies": {