@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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@react-three/rapier",
3
- "version": "0.6.9",
3
+ "version": "0.7.0",
4
4
  "source": "src/index.ts",
5
5
  "main": "dist/react-three-rapier.cjs.js",
6
6
  "module": "dist/react-three-rapier.esm.js",
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 the RigidBody:
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 colliders:
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