Download

Hand Movement Speed

Hi Folks

I have a particle system in my VR hand and I want to modulate it’s audio based on how fast I wave my hand around.

I need to get the movement speed of my hand, or at least the movement speed of the particle system, so that I can have a float value to use. Anybody know how I can get this?

I thought maybe I could use getHandPositionAndOrientation and compare current value with last value, but I have no idea how I could do this, if somebody knows that would be amazing.

Thanks a lot

You have to integrate the speed yourself. There is no value for the velocity of the controller from what we have seen.

Even worse, at least on the PSVR, it is quite easy to loose tracking and then the position remains the same even though you are moving so the instantaneous velocity would go to zero.

So we integrate velocity in a moving average window of a short duration. Basically sum of multiple delta positions divided by the delta time for a given window.

Velocity is quite an easy bit of math, here you go;

I think you also can just get the component velocity actually, but i dont use that as i like having values stored…

Edit; those are FVectors btw, to get a float just grab a .length…