use-cannon

πŸ‘‹πŸ’£ physics based hooks for @react-three/fiber

Downloads
64.4K
Stars
2.7K
Committers
46

Bot releases are hidden (Show)

use-cannon - v3.1.1 - 2021-09-02

Published by bjornstar almost 3 years ago

  • Fix useRaycastVehicle, getUUID was receiving unintended index values (@bjornstar)
  • [README.md] Update demos to point to cannon.pmnd.rs (@bjornstar)
use-cannon - v4.1.0 - 2021-11-21

Published by bjornstar almost 3 years ago

  • Update default gravity value from -10 to -9.81 (@alexandernanberg)
  • [devDependencies] Update to latest versions (@bjornstar)
  • [CHANGELOG.md] Start writing a changelog (@bjornstar)
  • [README.md] Replace boxBufferGeometry with boxGeometry and planeBufferGeometry with planeGeometry (@drcmda)
  • [examples/devDependencies] Update to latest version (@bjornstar)
use-cannon - v3.1.2 - 2021-09-02

Published by bjornstar almost 3 years ago

  • Rebuild package (@stockHuman)
use-cannon - v4.0.1 - 2021-10-06

Published by bjornstar about 3 years ago

  • Fix an bug where multiple rotations shared an array (@bjornstar)
use-cannon - v4.0.0 - 2021-10-05

Published by bjornstar about 3 years ago

⚠️ There is a breaking change to the useSphere API ⚠️

Previously, the args property for useSphere was a single number, but this has caused a lot of confusion as many people expected it to be an array. We have standardized the format of the args property to be an array for all hooks.

Before v4:

useSphere((index) => ({ args: 10, mass: 10, position: [0, 0.5, 0] }))

From v4 onwards:

useSphere((index) => ({ args: [10], mass: 10, position: [0, 0.5, 0] }))

If you are calling useSphere you'll need to modify your code to use an array instead of a number. If you update to v4 and don't change, you will receive runtime errors saying: 'useSphere args must be an array`.

We have also included a bug fix for the rotation subscription API and added a quaternion API for direct access to the quaternions that Cannon is using behind the scenes.

What's Changed

Full Changelog: https://github.com/pmndrs/use-cannon/compare/v3.1.2...v4.0.0

use-cannon - v3.1.0 - 2021-09-01

Published by stockhuman about 3 years ago

  • [Examples] Convert Kinematic Cube to TypeScript (#262) (@bjornstar)
  • [Examples] Convert Heightmap to TypeScript (#264) (@bjornstar)
  • [Examples] Convert SphereDebug to TypeScript (#261) (@bjornstar)
  • [Examples] Convert Hinge Motor to TypeScript (#263) (@bjornstar)
  • [Examples] Convert Cube Heap to TypeScript (#265) (@bjornstar)
  • [Examples] Convert Convex Polyhedron to TypeScript (#266) (@bjornstar)
  • [Examples] Convert Compound Body to TypeScript (#268) (@bjornstar)
  • [Examples] Convert Constraints to TypeScript (#267) (@bjornstar)
  • [Examples] Convert Raycast Vehicle to TypeScript (#270) (@bjornstar)
  • [Examples] Convert Chain to TypeScript (#269) (@bjornstar)
  • [Examples] Convert Raycast to TypeScript (#271) (@bjornstar)
  • [Examples] Convert Ping Pong to TypeScript (@bjornstar)
  • [readme.md] Switch build badge from travis to github (@bjornstar)
  • Use Ref to allow for forwarded refs (@bjornstar)
  • Use React.DependencyList instead of any[] for deps (@bjornstar)
  • [CI] Test on node v14 as vercel doesn't support 16 yet (@bjornstar)
use-cannon - v2.6.0 - 2021-08-11

Published by stockhuman about 3 years ago

  • Switch from CRA to vite (@bjornstar)
  • feat: add applyTorque API to body (@a-type)
use-cannon - v2.5.0 - 2021-07-01

Published by stockhuman over 3 years ago

  • Add shouldInvalidate to readme code (@aunyks)
  • [Examples] CubeHeap, click to change to spheres (@bjornstar)
  • Expose WakeUp & Sleep API (stockHuman)
use-cannon - v2.4.0 - 2021-06-28

Published by stockhuman over 3 years ago

  • Remove dead code (@Gusted)
  • Setup automated hygiene (@bjornstar)
  • Add prepare script (@bjornstar)
  • Run CI on the master branch (@bjornstar)
  • Don't build examples (@bjornstar)
  • Add 'shouldInvalidate' prop to Physics provider component to allow for pausing the simulation (@aunyks)
  • Update bug_report.md (@stockHuman)
  • Integrate pausing functionality (@stockHuman)
  • Set printWidth to 110 (@bjornstar)
use-cannon - v2.3.4

Published by stockhuman over 3 years ago

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.

use-cannon - v2.3.0

Published by stockhuman over 3 years ago

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

use-cannon - v2.2.1

Published by stockhuman over 3 years ago

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

use-cannon - v2.2.0

Published by stockhuman over 3 years ago

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

use-cannon - v1.4.0

Published by stockhuman over 3 years ago

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!

use-cannon - v1.3.0

Published by stockhuman over 3 years ago

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)
use-cannon - v1.2.1

Published by stockhuman over 3 years ago

Fix subscriptions on component disposal (#195)

use-cannon - v1.2.0

Published by stockhuman over 3 years ago

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

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

Thanks, @age2pierre!

use-cannon - v1.1.0

Published by stockhuman over 3 years ago

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!

use-cannon - v1.0.0

Published by stockhuman over 3 years ago

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

use-cannon - v0.6.1

Published by stockhuman over 3 years ago

  • Disabled source maps in production build (#167)
Package Rankings
Top 1.43% on Npmjs.org
Top 6.74% on Proxy.golang.org
Badges
Extracted from project README
Build Status Discord Shield