04-26-2022 05:16 AM
Hello.
I am trying to drag an object on one of its own axes using the Oculus GrabBegin function. This works fine when the rotation of the object is zeroed. When the object is rotated the object is dragged on the world axis rather than local.
I log the initial position and rotation when I grab the object and then apply those values to the axes I want locked every frame. I’ve tried using transformdirection, inversetransformdirection, and variations of the space conversion functions, tried normalizing the vector and nothing works.
Is there an Oculus feature built in for this or is there another way to be able to drag this object along its own axis?
Thank you.
Solved! Go to Solution.
04-26-2022 10:52 AM - edited 05-02-2022 06:25 AM
Got it sorted. Here's the code in case anyone else has this issue:
ObjA being the object I am dragging. Logging where it is when I initially grab it "objA.lastPos". thisObjLastPos being where the object that I want to actually move was before I grabbed objA. Hope this helps if anyone has this issue!
04-26-2022 10:52 AM - edited 05-02-2022 06:25 AM
Got it sorted. Here's the code in case anyone else has this issue:
ObjA being the object I am dragging. Logging where it is when I initially grab it "objA.lastPos". thisObjLastPos being where the object that I want to actually move was before I grabbed objA. Hope this helps if anyone has this issue!