How do i add physics and hand tracking to my code?

Hello all,

I took this BJS tutorial from Gabriel Baker on youtube:

I am trying to modify the project’s code to add physics and hand tracking in a way the helmet can still float, but i would be able to spin it with my hands(no movememt, just spin).

For weeks, i have tried all i could but no positive result, and honestly, BJS docs isn’t helping. can someone be kind enough to help?

code:

Regarding the physics part, you can have a floating object by setting its mass to 0 and the motion type to DYNAMIC:

I don’t know XR, but it’s now a matter of calling applyAngularImpulse with the right value depending on the hand gesture.

3 Likes