This project have been deprecated and might no longer work with the latest version of the Wonderland Engine.
An updated version of this feature can be found in the PP library.
You can also find a similar template project here.
A showcase of the Grab & Throw feature for the Wonderland Engine
- Use the right controller top button to make the grabbed object snap on the hand
- Use the left controller top button to force emulated velocities instead of the XRPose ones
- Can be used to test how the throw would behave when XRPose velocities are not available
- Import the
pp
folder into yourproject
folder, along with all the subfolders (you can avoid importing thetool
folder)- This
pp
folder should only contain thepp.js
file, apart for other folders - You must link this folder in the Java Script Sources list (under Project Settings) before any other folders that contain scripts that use the
PP
namespace - This is needed to make sure the
PP
namespace is created before it is used - If you put it as first (after
/js/components/
) you should be safe
- This
- Add the
grab
component to one of the hands_myHandedness
: the handedness of the hand_mySnapOnPivot
: specify if you want the grabbed object to snap on the pivot- If you want to offset the pivot, just put the grab component in an object child of the hand and offset that
- The same object must also have a
collision
component that will be used as a trigger to know if a grabbable is close
- Add the
grabbable
component to an object- This object must have a
collision
component used as a trigger for the grab - The object must also have a
physx
component used to add the velocities when thrown- If the object does not move after being grabbed add to it the
fix-physx-kinematic-parent
component you can find in thecauldron
folder
- If the object does not move after being grabbed add to it the
- This object must have a
You are free to use this in your projects, just remember to credit me somewhere!
Oculus Quest Controller Models by Jezza3D on Sketchfab with small adjustments made by me.
Watermelon model done by Florian with love <3