Hello All,
I'm desperate to found a solution and I need your help please.
I've create a simple cube in Vision OS. I can get it by hand (close my hand on it) and move it pretty where I want. But, I would like to throw it (exemple like a basket ball). Not push it, I want to have it in hand and throw it away of me with a velocity and direction = my hand move (and finger opened to release it).
Please put me on the wait to do that.
Cheers and thanks Mathis
Hi @Mathis06
Glad you like the code! Happy to help.
and what's funny is the ball not roll when are o the ground, or, to be clear, they roll really strange :(
The method generateCollisionShapes
always generates a box collision shape. If you change the mesh to a sphere you need to manually create and set the collision shapes to a sphere.
let shape = ShapeResource.generateSphere(radius: radius)
throwable.components.set(CollisionComponent(shapes: [shape]))
When the hand is out of Vision Camera, the code thinks the hand is opened. Existing a way to have the hand considering closed in this case please ?
Change
guard allJointsTracked else {return .indeterminate}
to
guard allJointsTracked else {return .closed}