@react-three/rapier 0.15.0-canary.0 → 0.15.1
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/package.json +4 -4
- package/readme.md +27 -19
package/package.json
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
{
|
2
2
|
"name": "@react-three/rapier",
|
3
|
-
"version": "0.15.
|
3
|
+
"version": "0.15.1",
|
4
4
|
"source": "src/index.ts",
|
5
5
|
"main": "dist/react-three-rapier.cjs.js",
|
6
6
|
"module": "dist/react-three-rapier.esm.js",
|
@@ -26,9 +26,9 @@
|
|
26
26
|
"vitest": "0.29.7"
|
27
27
|
},
|
28
28
|
"peerDependencies": {
|
29
|
-
"@react-three/fiber": "8.9.
|
30
|
-
"react": "18.
|
31
|
-
"three": ">=0.139.
|
29
|
+
"@react-three/fiber": ">=8.9.0",
|
30
|
+
"react": ">=18.0.0",
|
31
|
+
"three": ">=0.139.0"
|
32
32
|
},
|
33
33
|
"dependencies": {
|
34
34
|
"@dimforge/rapier3d-compat": "0.11.2",
|
package/readme.md
CHANGED
@@ -27,7 +27,7 @@ The goal of this library to is to provide a fast physics engine with minimal fri
|
|
27
27
|
```tsx
|
28
28
|
import { Box, Torus } from "@react-three/drei";
|
29
29
|
import { Canvas } from "@react-three/fiber";
|
30
|
-
import { Physics, RigidBody, Debug } from "@react-three/rapier";
|
30
|
+
import { Physics, RigidBody, Debug, CuboidCollider } from "@react-three/rapier";
|
31
31
|
|
32
32
|
const App = () => {
|
33
33
|
return (
|
@@ -654,10 +654,14 @@ const JointedThing = () => {
|
|
654
654
|
bodyA,
|
655
655
|
bodyB,
|
656
656
|
[
|
657
|
-
|
658
|
-
[0, 0, 0
|
659
|
-
|
660
|
-
[0, 0, 0, 1],
|
657
|
+
// Position of the joint in bodyA's local space
|
658
|
+
[0, 0, 0],
|
659
|
+
// Orientation of the joint in bodyA's local space
|
660
|
+
[0, 0, 0, 1],
|
661
|
+
// Position of the joint in bodyB's local space
|
662
|
+
[0, 0, 0],
|
663
|
+
// Orientation of the joint in bodyB's local space
|
664
|
+
[0, 0, 0, 1],
|
661
665
|
]);
|
662
666
|
|
663
667
|
return (
|
@@ -684,8 +688,10 @@ const JointedThing = () => {
|
|
684
688
|
bodyA,
|
685
689
|
bodyB,
|
686
690
|
[
|
687
|
-
|
688
|
-
[0, 0, 0],
|
691
|
+
// Position of the joint in bodyA's local space
|
692
|
+
[0, 0, 0],
|
693
|
+
// Position of the joint in bodyB's local space
|
694
|
+
[0, 0, 0],
|
689
695
|
]);
|
690
696
|
|
691
697
|
return (
|
@@ -712,17 +718,15 @@ const JointedThing = () => {
|
|
712
718
|
bodyA,
|
713
719
|
bodyB,
|
714
720
|
[
|
715
|
-
|
716
|
-
[0, 0, 0],
|
717
|
-
|
721
|
+
// Position of the joint in bodyA's local space
|
722
|
+
[0, 0, 0],
|
723
|
+
// Position of the joint in bodyB's local space
|
724
|
+
[0, 0, 0],
|
725
|
+
// Axis of the joint, expressed in the local-space of
|
726
|
+
// the rigid-bodies it is attached to. Cannot be [0,0,0].
|
727
|
+
[0, 1, 0],
|
718
728
|
]);
|
719
729
|
|
720
|
-
useEffect(() => {
|
721
|
-
if (joint.current) {
|
722
|
-
|
723
|
-
}
|
724
|
-
}, [])
|
725
|
-
|
726
730
|
return (
|
727
731
|
<group>
|
728
732
|
<RigidBody ref={bodyA}>
|
@@ -747,9 +751,13 @@ const JointedThing = () => {
|
|
747
751
|
bodyA,
|
748
752
|
bodyB,
|
749
753
|
[
|
750
|
-
|
751
|
-
[0, 0, 0],
|
752
|
-
|
754
|
+
// Position of the joint in bodyA's local space
|
755
|
+
[0, 0, 0],
|
756
|
+
// Position of the joint in bodyB's local space
|
757
|
+
[0, 0, 0],
|
758
|
+
// Axis of the joint, expressed in the local-space of
|
759
|
+
// the rigid-bodies it is attached to. Cannot be [0,0,0].
|
760
|
+
[0, 1, 0],
|
753
761
|
]);
|
754
762
|
|
755
763
|
return (
|