API reference
API reference
Select your platform
No SDKs available
No versions available

ThrowWhenUnselected Class

Extends IDisposable
Tracks the movement of a rigidbody while it is selected by an IPointable and applies a throw velocity when it becomes fully unselected.

Constructors

ThrowWhenUnselected ( rigidbody , pointable )
Creates a new instance that listens to the provided IPointable events.
Note that this instance must be disposed via .Dispose() to release the event listener.
Signature
Oculus.Interaction.ThrowWhenUnselected.ThrowWhenUnselected(Rigidbody rigidbody, IPointable pointable)
Parameters
rigidbody: Rigidbody  The rigidbody to track velocity from and throw.
pointable: IPointable  The IPointable indicating when the rigidbody is selected and unselected.

Events

Callback triggered when the object sets the throwing velocities of the referenced rigidbody
Signature
VelocitiesLoadedDelegate Oculus.Interaction.ThrowWhenUnselected.WhenThrown

Methods

Dispose ()
Unregisters the instance from the IPointable events
Signature
void Oculus.Interaction.ThrowWhenUnselected.Dispose()
Returns
void
SetRigidBody ( rigidbody )
Sets the Rigidbody used for the throw velocity calculation
Signature
void Oculus.Interaction.ThrowWhenUnselected.SetRigidBody(Rigidbody rigidbody)
Parameters
rigidbody: Rigidbody  The rigidbody to apply velocity to and measure deltas from
Returns
void
SetTimeProvider ( timeProvider )
Sets the function that provides with the time in order to measure the velocities of the rigidbody
Signature
void Oculus.Interaction.ThrowWhenUnselected.SetTimeProvider(Func< float > timeProvider)
Parameters
timeProvider: Func< float >  The function that provides the time
Returns
void
TryGetVelocities ( velocity , torque )
Retrieves the current tracked velocity of the rigidbody
Signature
bool Oculus.Interaction.ThrowWhenUnselected.TryGetVelocities(out Vector3 velocity, out Vector3 torque)
Parameters
velocity: out Vector3  Linear velocity
torque: out Vector3  Angular velocity
Returns
bool  True if the velocities could be retrieved
VelocitiesLoadedDelegate ( velocity , torque )
Delegate signature for the loaded velocities
Signature
delegate void Oculus.Interaction.ThrowWhenUnselected.VelocitiesLoadedDelegate(Vector3 velocity, Vector3 torque)
Parameters
velocity: Vector3  Linear velocity
torque: Vector3  Angular velocity
Returns
delegate void