3 weeks ago
I'm trying to get the velocity of how to get either of the VR Controllers so that it can be applied to another object when hit. I cant figure out how to aquire the velocty with the SDK setup. Any help please?
3 weeks ago
Hi vallenkilling,
I don't think there's a centralized place from which that value is provided, but there are tools available that will help you calculate it. For a simple calculation, you can just monitor displacement over time directly --- for example, `(controllerPositionNow - controllerPositionATenthOfASecondAgo) / 0.1 seconds`.
If you want something more sophisticated, take a look at RANSACVelocity.cs (in the essentials package > Runtime > Scripts > Throw). This is how ISDK itself calculates velocities for throwing --- you can see this usage in Grabbable.cs --- but it should be usable for calculating good, noise-resilient velocity estimates of other things too, including controllers. I don't think there's much documentation about that file yet, but if you're interested and have questions, either I or @LucaMefisto should be able to help you dig deeper.
Hope this helps, and best of luck!
2 weeks ago
Hi vallenkilling,
Getting the velocity of a VR Controller can be done in different ways. You can directly query it in OVRInput using (note that it is local to the tracking space):
`OVRInput.GetLocalControllerVelocity`.
Alternatively, if you want to do it without OVR and filter out possible noisy data you can use the InteractionSDK RANSACVelocity.cs class. You will have to create a component that makes use of it and attach it to a Controller thought.
Roughly speaking:
```
2 weeks ago