@@ -22,7 +22,7 @@ const joints = shallowRef<ImpulseJoint>()
2222
2323const dispose = () => {
2424 if (joints .value ) {
25- world .removeImpulseJoint (joints .value , wakeUpOnChanges )
25+ world .value . removeImpulseJoint (joints .value , wakeUpOnChanges )
2626 joints .value = undefined
2727 }
2828}
@@ -31,8 +31,8 @@ const setup = (bodies: JointProps['bodies'], params: JointProps['params']) => {
3131 dispose ()
3232
3333 if (
34- ! (bodies ?.[0 ] instanceof rapier .RigidBody )
35- || ! (bodies ?.[1 ] instanceof rapier .RigidBody )
34+ ! (bodies ?.[0 ] instanceof rapier .value . RigidBody )
35+ || ! (bodies ?.[1 ] instanceof rapier .value . RigidBody )
3636 || ! Array .isArray (params )
3737 ) {
3838 return
@@ -49,7 +49,7 @@ const setup = (bodies: JointProps['bodies'], params: JointProps['params']) => {
4949 && (Array .isArray (params [2 ]) && params [2 ].length >= 3 )
5050 && (Array .isArray (params [3 ]) && params [3 ].length >= 4 )
5151 ) {
52- jointParams = rapier .JointData .fixed (
52+ jointParams = rapier .value . JointData .fixed (
5353 new Vector3 (... params [0 ] as VectorArray ),
5454 new Quaternion (... params [1 ] as QuaternionArray ),
5555 new Vector3 (... params [2 ] as VectorArray ),
@@ -68,7 +68,7 @@ const setup = (bodies: JointProps['bodies'], params: JointProps['params']) => {
6868 && (Array .isArray (params [2 ]) && params [2 ].length >= 3 )
6969 && typeof params [3 ] === ' number'
7070 ) {
71- jointParams = rapier .JointData .generic (
71+ jointParams = rapier .value . JointData .generic (
7272 new Vector3 (... params [0 ] as VectorArray ),
7373 new Vector3 (... params [1 ] as VectorArray ),
7474 new Vector3 (... params [2 ] as VectorArray ),
@@ -86,7 +86,7 @@ const setup = (bodies: JointProps['bodies'], params: JointProps['params']) => {
8686 && (Array .isArray (params [1 ]) && params [1 ].length >= 3 )
8787 && (Array .isArray (params [2 ]) && params [2 ].length >= 3 )
8888 ) {
89- jointParams = rapier .JointData .prismatic (
89+ jointParams = rapier .value . JointData .prismatic (
9090 new Vector3 (... params [0 ] as VectorArray ),
9191 new Vector3 (... params [1 ] as VectorArray ),
9292 new Vector3 (... params [1 ] as VectorArray ),
@@ -103,7 +103,7 @@ const setup = (bodies: JointProps['bodies'], params: JointProps['params']) => {
103103 && (Array .isArray (params [1 ]) && params [1 ].length >= 3 )
104104 && (Array .isArray (params [2 ]) && params [2 ].length >= 3 )
105105 ) {
106- jointParams = rapier .JointData .revolute (
106+ jointParams = rapier .value . JointData .revolute (
107107 new Vector3 (... params [0 ] as VectorArray ),
108108 new Vector3 (... params [1 ] as VectorArray ),
109109 new Vector3 (... params [2 ] as VectorArray ),
@@ -120,7 +120,7 @@ const setup = (bodies: JointProps['bodies'], params: JointProps['params']) => {
120120 && (Array .isArray (params [1 ]) && params [1 ].length >= 3 )
121121 && (Array .isArray (params [2 ]) && params [2 ].length >= 4 )
122122 ) {
123- jointParams = rapier .JointData .rope (
123+ jointParams = rapier .value . JointData .rope (
124124 params [0 ],
125125 new Vector3 (... params [1 ] as VectorArray ),
126126 new Quaternion (... params [2 ] as QuaternionArray ),
@@ -136,7 +136,7 @@ const setup = (bodies: JointProps['bodies'], params: JointProps['params']) => {
136136 && (Array .isArray (params [0 ]) && params [0 ].length >= 3 )
137137 && (Array .isArray (params [1 ]) && params [1 ].length >= 3 )
138138 ) {
139- jointParams = rapier .JointData .spherical (
139+ jointParams = rapier .value . JointData .spherical (
140140 new Vector3 (... params [0 ] as VectorArray ),
141141 new Vector3 (... params [1 ] as VectorArray ),
142142 )
@@ -154,7 +154,7 @@ const setup = (bodies: JointProps['bodies'], params: JointProps['params']) => {
154154 && (Array .isArray (params [3 ]) && params [3 ].length >= 3 )
155155 && (Array .isArray (params [4 ]) && params [4 ].length >= 3 )
156156 ) {
157- jointParams = rapier .JointData .spring (
157+ jointParams = rapier .value . JointData .spring (
158158 params [0 ],
159159 params [1 ],
160160 params [2 ],
@@ -174,7 +174,7 @@ const setup = (bodies: JointProps['bodies'], params: JointProps['params']) => {
174174 throw new Error (` Unsupported joint type. If you think this is a bug or the "${type }" type should be implemented, please open an issue. ` )
175175 }
176176
177- joints .value = world .createImpulseJoint (jointParams , bodies [0 ], bodies [1 ], wakeUpOnChanges )
177+ joints .value = world .value . createImpulseJoint (jointParams , bodies [0 ], bodies [1 ], wakeUpOnChanges )
178178}
179179
180180onUpdated (() => setup (bodies , params ))
0 commit comments