public virtual void GetReleaseVelocities(Hand hand, out Vector3 velocity, out Vector3 angularVelocity)
{
if (hand.noSteamVRFallbackCamera && releaseVelocityStyle != ReleaseStyle.NoChange)
{
releaseVelocityStyle = ReleaseStyle.ShortEstimation; // only type that works with fallback hand is short estimation.
}
switch (releaseVelocityStyle)
{
case ReleaseStyle.ShortEstimation:
velocityEstimator.FinishEstimatingVelocity();
velocity = velocityEstimator.GetVelocityEstimate();
angularVelocity = velocityEstimator.GetAngularVelocityEstimate();
break;
case ReleaseStyle.AdvancedEstimation:
hand.GetEstimatedPeakVelocities(out velocity, out angularVelocity);
break;
case ReleaseStyle.GetFromHand:
velocity = hand.GetTrackedObjectVelocity(releaseVelocityTimeOffset);
angularVelocity = hand.GetTrackedObjectAngularVelocity(releaseVelocityTimeOffset);
break;
default:
case ReleaseStyle.NoChange:
velocity = rigidBody.velocity;
angularVelocity = rigidBody.angularVelocity;
break;
}
if (releaseVelocityStyle != ReleaseStyle.NoChange)
{
velocity *= scaleReleaseVelocity;
}
}