API reference

RANSACVelocity Class

A helper class that uses an underlying RandomSampleConsensus<TModel> to select the best pair of linear and angular velocities from a buffer of recent timed poses.
RANSACVelocity allows for the stable estimation of velocity under noise-prone circumstances. This is particuarly important when throwing objects because of the unreliability of data around the moment of intended release: if the perceived moment of release is slightly too late, for example, the behavior of the throwing implement (hand, controller, etc.) should not impact the calculated velocity. RANSAC velocity estimation across several frames mitigates this problem.

Constructors

RANSACVelocity ( samplesCount , samplesDeadZone , minHighConfidenceSamples )
Signature
Oculus.Interaction.Throw.RANSACVelocity.RANSACVelocity(int samplesCount=10, int samplesDeadZone=2, int minHighConfidenceSamples=2)
Parameters
samplesCount: int
samplesDeadZone: int
minHighConfidenceSamples: int
RANSACVelocity ( samplesCount , samplesDeadZone )
Creates a new RANSACVelocity for estimating velocity.
Signature
Oculus.Interaction.Throw.RANSACVelocity.RANSACVelocity(int samplesCount=10, int samplesDeadZone=2)
Parameters
samplesCount: int  The size of the rolling sample buffer from which to seek consensus.
samplesDeadZone: int  The number of most recent samples to exclude from the consensus.

Properties

MaxSyntheticSpeed : float
[Get][Set]
Maximum speed (in m/s) allowed for synthetic poses.
This is used in internal calculations and should generally not need to be tuned.
Synthetic poses are generated and used by RANSACVelocity to fill tracking gaps (when Input.IHand.IsHighConfidence for a tracked hand is false, for example). Capping the allowed speed mitigates the risk of generating nonsensical synthetic poses.
Signature
float Oculus.Interaction.Throw.RANSACVelocity.MaxSyntheticSpeed

Protected Methods

GetSortedTimePoses ( idx1 , idx2 , older , younger )
Signature
void Oculus.Interaction.Throw.RANSACVelocity.GetSortedTimePoses(int idx1, int idx2, out TimedPose older, out TimedPose younger)
Parameters
idx1: int
idx2: int
older: out TimedPose
younger: out TimedPose
Returns
void
PositionOffset ( youngerPose , olderPose )
Signature
virtual Vector3 Oculus.Interaction.Throw.RANSACVelocity.PositionOffset(Pose youngerPose, Pose olderPose)
Parameters
youngerPose: Pose
olderPose: Pose
Returns
Vector3

Methods

GetVelocities ( velocity , torque )
Estimates the current translational and rotational velocities based on the available data.
If there is insufficient data to produce an estimate, returns 0 trivial velocities.
Signature
void Oculus.Interaction.Throw.RANSACVelocity.GetVelocities(out Vector3 velocity, out Vector3 torque)
Parameters
velocity: out Vector3  Output parameter for translational velocity.
torque: out Vector3  Output parameter for rotational velocity.
Returns
void
Initialize ()
Initializes a RANSACVelocity calculator, clearing its state and preparing it to receive new data.
Can be called repeatedly to reset the state of an existing RANSACVelocity.
Signature
void Oculus.Interaction.Throw.RANSACVelocity.Initialize()
Returns
void
Process ( pose , time , isHighConfidence )
Consumes a new frame of Pose data for example, from the IGrabbable.Transform of a grabbed GrabInteractable.
The RANSACVelocity instance must be regularly supplied with such data so that velocities can be estimated when needed.
Signature
void Oculus.Interaction.Throw.RANSACVelocity.Process(Pose pose, float time, bool isHighConfidence=true)
Parameters
pose: Pose  The Pose observed.
time: float  The time at which pose was observed.
isHighConfidence: bool  Whether or not pose was observed with high confidence. For example, if pose is from an IGrabbable.Transform being held by an Input.IHand for which Input.IHand.IsHighConfidence is false, then pose might also be considered to be known with low confidence.
Returns
void

Protected Static Methods

GetTorque ( older , younger )
Signature
static Vector3 Oculus.Interaction.Throw.RANSACVelocity.GetTorque(TimedPose older, TimedPose younger)
Parameters
older: TimedPose
younger: TimedPose
Returns
Vector3

Inner Struct

TimedPose Struct

Constructors

TimedPose ( time , pose )
Signature
Oculus.Interaction.Throw.RANSACVelocity.TimedPose.TimedPose(float time, Pose pose)
Parameters
time: float
pose: Pose

Fields

pose : Pose
Signature
Pose Oculus.Interaction.Throw.RANSACVelocity.TimedPose.pose
time : float
Signature
float Oculus.Interaction.Throw.RANSACVelocity.TimedPose.time