XR Throw Lab (playground)

For the past few weeks I have been working on a project which focuses around throwing objects in virtual reality. I created a playground to help me test the functionality and tweak parameters, and I would like to share it with the community!

Features

  • Throwing balls with the VR controllers
  • Adjustable bucket distance to test throwing ranges
  • Center of gravity control to make it easier to ‘flick’ throw with the wrist
  • Exponential smoothing of calculated throwing speed and direction

Playground here: https://playground.babylonjs.com/#K1WGX0#36 (5.0.0-alpha.24 typescript)

12 Likes

@RaananW will love to see that ;D

Awesome!

I noticed you use the angular and linear velocity that comes with the pose itself, but this is only available in the oculus browser at the moment. If you want to enable it cross-browser you can use the physics feature that will emulate those two values if they are not available.

Thanks for making this playground. For some reason when I try this on the Quest 1, the balls don’t fly straight like in your video, instead they fly in +X direction as if there is a strong wind blowing from my west if I’m facing north. But that’s only if I flick my wrist. If it only propel the ball straight up or down then it does not pull to the right.