Skip to content

Releases: pmndrs/use-cannon

v2.3.4

22 Jun 15:09
Compare
Choose a tag to compare

This and past point releases include bug fixes, and notably a change to physics objects now setting the target mesh's rotation rather than its quaternion. See #209

The unsung hero of many recent fixes: @drcmda. Thank you.

v2.3.0

16 Jun 15:23
Compare
Choose a tag to compare

This release contains improvements to types and documentation, notably using Triplet instead of number[] (#206)
Thanks, @bjornstar!

v2.2.1

14 Jun 23:08
Compare
Choose a tag to compare

Fixes undefined world in event listeners added for granular collision events.

v2.2.0

10 Jun 16:05
Compare
Choose a tag to compare

Use-cannon 2.x is compatible with (and the cause of) react-three-fiber v7.

The integrated debugger has been improved and made optional and modular, integrate it into your scene and pass parameters as follows, where scale visually scales the physics mesh representation to better see it against your geometry.

<Physics>
  <Debug scale={1.1} color='black'>
    {/* children */}
  </Debug>
</Physics>

This release also includes more granular, detailed collision events! (#133)
See collideBegin and collideEnd events.
Thanks, @a-type

v1.4.0

08 Jun 11:00
Compare
Choose a tag to compare

This release contains the ability to display a built-in visualization of the physics colliders in your scene, using cannon-es-debugger! (#190)

Pass the debug prop to your Physics component to view.

Thanks, @elisherer!

v1.3.0

06 Jun 20:52
Compare
Choose a tag to compare

This release contains the perhaps long-awaited ability to dynamically alter the world's physics, including setting gravity! Thanks, @hazem3500. See the ConvexPolyhedron demo.

  • make Physics provider props dynamic! (#202)
  • Removes use of Nullish coalescing operator to improve compatibility with the default Create-React-App setup (#198)

v1.2.1

29 May 21:15
Compare
Choose a tag to compare

Fix subscriptions on component disposal (#195)

v1.2.0

26 May 23:00
Compare
Choose a tag to compare

This release adds triggers, allowing for easy-to-use implementations of common game mechanics within the physics world. (#193)

useBox(() => ({ isTrigger: true, ... })

Thanks, @age2pierre!

v1.1.0

15 Apr 01:12
Compare
Choose a tag to compare

useConstraint now returns an API as follows: (#180)

type SpringApi = [
  React.MutableRefObject<THREE.Object3D | undefined>,
  React.MutableRefObject<THREE.Object3D | undefined>,
  {
    setStiffness: (value: number) => void
    setRestLength: (value: number) => void
    setDamping: (value: number) => void
  }
]

Allowing more complex and expressive physics constraints. Thanks @brunnolou!

v1.0.0

02 Apr 01:26
Compare
Choose a tag to compare

This release brings use-cannon in line with r3f v6, updating demos to match.