cancel
Showing results for 
Search instead for 
Did you mean: 

How can I use OVRInput.GetLocalControllerAngularVelocity to affect a rigidbody.angularVelocity?

TheStonefox
Explorer
Hi all,

I'm trying to affect a rigidbody's angular velocity (which is a Vector3) based on the current angular velocity of the touch controller.

OVRInput has a GetLocalControllerAngularVelocity method but this returns a Quaternion and not a Vector3.

If I get the Eular from the returned quaternion then it's a really high number (i'm guessing it's in degrees as well) which means the rotation is way too high when affecting the rigidbody's angular velocity.

I've also tried converting the eular to radians but that doesn't seem to work correctly either.

Does anyone know how you can get the angular velocity of the controller and apply it to a rigidbody's angular velocity?
15 REPLIES 15

TheStonefox
Explorer

digibix said:

Hi... I think there is a workaround for that problem near the end of the following video tutorial:

https://www.youtube.com/watch?v=mFFta9OszzA




Thanks for the video, I can confirm this seems to work for me too!

GEMISIS
Adventurer
@vrdaveb  Has the 2*Pi clamping issue been fixed as of yet out of curiosity?  If not, is this still on the roadmap to be fixed?

GEMISIS
Adventurer
No worries, the game I am working on for Touch is a bit far off, so as long as it is still on the road map I am okay to wait for a fix in the SDK rather than a temporary solution.  :smile: I'll keep an eye out for the feature in the future.

DHARMAKAYA
Protege
Are there any official grabber and grabbable scripts that function properly on Gear VR controller yet or is the company still treating Gear VR like it doesn't care about it? 

I wrote a grab/carry/drop script, yet now working on the throw...and already WAAAAAAAAAY over spending days on something that SHOULD be included in the Gear VR sdk for Unity...

GEMISIS
Adventurer
I ended up writing a few tutorials on how we ended up handling grabbing with Oculus Touch on my LLC's blog. The tutorials could pretty easily be ported over to the GearVR, though from my experience GearVR doesn't operate well with those motions (generally you want 2 joints to simulate moving an arm for things like grabbing, whereas GearVR can really only simulate 1). The full code for our implementation is available on our Github page if you want to check it out.

To throw an object with a Touch controller i know i need velocity on the rigidbody to = OVRInput - must i use a script for this?

I've just picked Unity up again after a long time off and noticed a lot of things i used to have to use scripts for are built-in.  I'm just seeing how far i can go without scripts.  Thanks.