Bot releases are hidden (Show)
Published by bjornstar almost 3 years ago
Published by bjornstar almost 3 years ago
-10
to -9.81
(@alexandernanberg)boxBufferGeometry
with boxGeometry
and planeBufferGeometry
with planeGeometry
(@drcmda)Published by bjornstar almost 3 years ago
Published by bjornstar about 3 years ago
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.
Full Changelog: https://github.com/pmndrs/use-cannon/compare/v3.1.2...v4.0.0
Published by stockhuman about 3 years ago
Published by stockhuman about 3 years ago
Published by stockhuman over 3 years ago
Published by stockhuman over 3 years ago
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.
Published by stockhuman over 3 years ago
This release contains improvements to types and documentation, notably using Triplet
instead of number[]
(#206)
Thanks, @bjornstar!
Published by stockhuman over 3 years ago
Fixes undefined world
in event listeners added for granular collision events.
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
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!
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.
Published by stockhuman over 3 years ago
Fix subscriptions on component disposal (#195)
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!
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!
Published by stockhuman over 3 years ago