@react-three/rapier 0.6.9 → 0.7.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/declarations/src/AnyCollider.d.ts +6 -2
- package/dist/declarations/src/InstancedRigidBodies.d.ts +1 -1
- package/dist/declarations/src/MeshCollider.d.ts +1 -1
- package/dist/declarations/src/Physics.d.ts +32 -19
- package/dist/declarations/src/RigidBody.d.ts +0 -2
- package/dist/declarations/src/hooks.d.ts +3 -1
- package/dist/declarations/src/shared-objects.d.ts +3 -0
- package/dist/declarations/src/types.d.ts +48 -17
- package/dist/declarations/src/utils-collider.d.ts +36 -0
- package/dist/declarations/src/utils-rigidbody.d.ts +20 -0
- package/dist/declarations/src/utils.d.ts +5 -46
- package/dist/react-three-rapier.cjs.dev.js +749 -679
- package/dist/react-three-rapier.cjs.prod.js +749 -679
- package/dist/react-three-rapier.esm.js +750 -682
- package/package.json +1 -1
- package/readme.md +19 -3
package/package.json
CHANGED
package/readme.md
CHANGED
@@ -210,9 +210,9 @@ const Scene = () => {
|
|
210
210
|
};
|
211
211
|
```
|
212
212
|
|
213
|
-
## Events
|
213
|
+
## Collision Events
|
214
214
|
|
215
|
-
You can subscribe to collision and state events on
|
215
|
+
You can subscribe to collision and state events on a RigidBody:
|
216
216
|
|
217
217
|
```tsx
|
218
218
|
const RigidBottle = () => {
|
@@ -235,7 +235,7 @@ return (
|
|
235
235
|
}
|
236
236
|
```
|
237
237
|
|
238
|
-
You may also subscribe to collision events on individual
|
238
|
+
You may also subscribe to collision events on individual Colliders:
|
239
239
|
|
240
240
|
```tsx
|
241
241
|
<CuboidCollider
|
@@ -289,6 +289,22 @@ When the second argument is omitted, the collider will interact with all groups:
|
|
289
289
|
|
290
290
|
> **Note** By default, colliders are members of all groups, and will interact with all other groups.
|
291
291
|
|
292
|
+
## Sensors
|
293
|
+
|
294
|
+
A Collider can be set to be a sensor, which means that it will not generate any contact points, and will not be affected by forces. This is useful for detecting when a collider enters or leaves another collider, without affecting the other collider.
|
295
|
+
|
296
|
+
```tsx
|
297
|
+
<RigidBody>
|
298
|
+
<GoalPosts />
|
299
|
+
|
300
|
+
<CuboidCollider
|
301
|
+
args={[5, 5, 1]}
|
302
|
+
sensor
|
303
|
+
onIntersectionEnter={() => console.log("Goal!")}
|
304
|
+
/>
|
305
|
+
</RigidBody>
|
306
|
+
```
|
307
|
+
|
292
308
|
## Joints
|
293
309
|
|
294
310
|
WIP
|