AR Design
UBC EML collab with UBC SALA - visualizing IoT data in AR
HoloToolkit.Unity.Interpolator Class Reference

A MonoBehaviour that interpolates a transform's position, rotation or scale. More...

Inheritance diagram for HoloToolkit.Unity.Interpolator:

Public Member Functions

void Awake ()
 
void SetTargetPosition (Vector3 target)
 Sets the target position for the transform and if position wasn't already animating, fires the InterpolationStarted event. More...
 
void SetTargetRotation (Quaternion target)
 Sets the target rotation for the transform and if rotation wasn't already animating, fires the InterpolationStarted event. More...
 
void SetTargetLocalRotation (Quaternion target)
 Sets the target local rotation for the transform and if rotation wasn't already animating, fires the InterpolationStarted event. More...
 
void SetTargetLocalScale (Vector3 target)
 Sets the target local scale for the transform and if scale wasn't already animating, fires the InterpolationStarted event. More...
 
void Update ()
 
void SnapToTarget ()
 Snaps to the final target and stops interpolating More...
 
void StopInterpolating ()
 Stops the interpolation regardless if it has reached the target More...
 
void Reset ()
 Stops the transform in place and terminates any animations. More...
 

Static Public Member Functions

static Vector3 NonLinearInterpolateTo (Vector3 start, Vector3 target, float deltaTime, float speed)
 Interpolates smoothly to a target position. More...
 

Public Attributes

bool UseUnscaledTime = true
 
float PositionPerSecond = 30.0f
 
float RotationDegreesPerSecond = 720.0f
 
float RotationSpeedScaler = 0.0f
 
float ScalePerSecond = 5.0f
 
bool SmoothLerpToTarget = false
 
float SmoothPositionLerpRatio = 0.5f
 
float SmoothRotationLerpRatio = 0.5f
 
float SmoothScaleLerpRatio = 0.5f
 

Properties

bool AnimatingPosition [get]
 True if the transform's position is animating; false otherwise. More...
 
bool AnimatingRotation [get]
 True if the transform's rotation is animating; false otherwise. More...
 
bool AnimatingLocalRotation [get]
 True if the transform's local rotation is animating; false otherwise. More...
 
bool AnimatingLocalScale [get]
 True if the transform's scale is animating; false otherwise. More...
 
Vector3 PositionVelocity [get]
 The velocity of a transform whose position is being interpolated. More...
 
bool Running [get]
 True if position, rotation or scale are animating; false otherwise. More...
 
Vector3 TargetPosition [get]
 If animating position, specifies the target position as specified by SetTargetPosition. Otherwise returns the current position of the transform. More...
 
Quaternion TargetRotation [get]
 If animating rotation, specifies the target rotation as specified by SetTargetRotation. Otherwise returns the current rotation of the transform. More...
 
Quaternion TargetLocalRotation [get]
 If animating local rotation, specifies the target local rotation as specified by SetTargetLocalRotation. Otherwise returns the current local rotation of the transform. More...
 
Vector3 TargetLocalScale [get]
 If animating local scale, specifies the target local scale as specified by SetTargetLocalScale. Otherwise returns the current local scale of the transform. More...
 

Events

System.Action InterpolationStarted
 The event fired when an Interpolation is started. More...
 
System.Action InterpolationDone
 The event fired when an Interpolation is completed. More...
 

Detailed Description

A MonoBehaviour that interpolates a transform's position, rotation or scale.

Definition at line 11 of file Interpolator.cs.

Member Function Documentation

§ Awake()

void HoloToolkit.Unity.Interpolator.Awake ( )

Definition at line 103 of file Interpolator.cs.

§ NonLinearInterpolateTo()

static Vector3 HoloToolkit.Unity.Interpolator.NonLinearInterpolateTo ( Vector3  start,
Vector3  target,
float  deltaTime,
float  speed 
)
static

Interpolates smoothly to a target position.

Parameters
startThe starting position.
targetThe destination position.
deltaTimeCaller-provided Time.deltaTime.
speedThe speed to apply to the interpolation.
Returns
New interpolated position closer to target

Definition at line 239 of file Interpolator.cs.

§ Reset()

void HoloToolkit.Unity.Interpolator.Reset ( )

Stops the transform in place and terminates any animations.

Definition at line 427 of file Interpolator.cs.

§ SetTargetLocalRotation()

void HoloToolkit.Unity.Interpolator.SetTargetLocalRotation ( Quaternion  target)

Sets the target local rotation for the transform and if rotation wasn't already animating, fires the InterpolationStarted event.

Parameters
targetThe new target local rotation for the transform.

Definition at line 177 of file Interpolator.cs.

§ SetTargetLocalScale()

void HoloToolkit.Unity.Interpolator.SetTargetLocalScale ( Vector3  target)

Sets the target local scale for the transform and if scale wasn't already animating, fires the InterpolationStarted event.

Parameters
targetThe new target local rotation for the transform.

Definition at line 206 of file Interpolator.cs.

§ SetTargetPosition()

void HoloToolkit.Unity.Interpolator.SetTargetPosition ( Vector3  target)

Sets the target position for the transform and if position wasn't already animating, fires the InterpolationStarted event.

Parameters
targetThe new target position to for the transform.

Definition at line 118 of file Interpolator.cs.

§ SetTargetRotation()

void HoloToolkit.Unity.Interpolator.SetTargetRotation ( Quaternion  target)

Sets the target rotation for the transform and if rotation wasn't already animating, fires the InterpolationStarted event.

Parameters
targetThe new target rotation for the transform.

Definition at line 148 of file Interpolator.cs.

§ SnapToTarget()

void HoloToolkit.Unity.Interpolator.SnapToTarget ( )

Snaps to the final target and stops interpolating

Definition at line 385 of file Interpolator.cs.

§ StopInterpolating()

void HoloToolkit.Unity.Interpolator.StopInterpolating ( )

Stops the interpolation regardless if it has reached the target

Definition at line 411 of file Interpolator.cs.

§ Update()

void HoloToolkit.Unity.Interpolator.Update ( )

Definition at line 261 of file Interpolator.cs.

Member Data Documentation

§ PositionPerSecond

float HoloToolkit.Unity.Interpolator.PositionPerSecond = 30.0f

Definition at line 21 of file Interpolator.cs.

§ RotationDegreesPerSecond

float HoloToolkit.Unity.Interpolator.RotationDegreesPerSecond = 720.0f

Definition at line 24 of file Interpolator.cs.

§ RotationSpeedScaler

float HoloToolkit.Unity.Interpolator.RotationSpeedScaler = 0.0f

Definition at line 27 of file Interpolator.cs.

§ ScalePerSecond

float HoloToolkit.Unity.Interpolator.ScalePerSecond = 5.0f

Definition at line 30 of file Interpolator.cs.

§ SmoothLerpToTarget

bool HoloToolkit.Unity.Interpolator.SmoothLerpToTarget = false

Definition at line 35 of file Interpolator.cs.

§ SmoothPositionLerpRatio

float HoloToolkit.Unity.Interpolator.SmoothPositionLerpRatio = 0.5f

Definition at line 37 of file Interpolator.cs.

§ SmoothRotationLerpRatio

float HoloToolkit.Unity.Interpolator.SmoothRotationLerpRatio = 0.5f

Definition at line 39 of file Interpolator.cs.

§ SmoothScaleLerpRatio

float HoloToolkit.Unity.Interpolator.SmoothScaleLerpRatio = 0.5f

Definition at line 41 of file Interpolator.cs.

§ UseUnscaledTime

bool HoloToolkit.Unity.Interpolator.UseUnscaledTime = true

Definition at line 14 of file Interpolator.cs.

Property Documentation

§ AnimatingLocalRotation

bool HoloToolkit.Unity.Interpolator.AnimatingLocalRotation
get

True if the transform's local rotation is animating; false otherwise.

Definition at line 65 of file Interpolator.cs.

§ AnimatingLocalScale

bool HoloToolkit.Unity.Interpolator.AnimatingLocalScale
get

True if the transform's scale is animating; false otherwise.

Definition at line 73 of file Interpolator.cs.

§ AnimatingPosition

bool HoloToolkit.Unity.Interpolator.AnimatingPosition
get

True if the transform's position is animating; false otherwise.

Definition at line 49 of file Interpolator.cs.

§ AnimatingRotation

bool HoloToolkit.Unity.Interpolator.AnimatingRotation
get

True if the transform's rotation is animating; false otherwise.

Definition at line 57 of file Interpolator.cs.

§ PositionVelocity

Vector3 HoloToolkit.Unity.Interpolator.PositionVelocity
get

The velocity of a transform whose position is being interpolated.

Definition at line 88 of file Interpolator.cs.

§ Running

bool HoloToolkit.Unity.Interpolator.Running
get

True if position, rotation or scale are animating; false otherwise.

Definition at line 96 of file Interpolator.cs.

§ TargetLocalRotation

Quaternion HoloToolkit.Unity.Interpolator.TargetLocalRotation
get

If animating local rotation, specifies the target local rotation as specified by SetTargetLocalRotation. Otherwise returns the current local rotation of the transform.

Definition at line 482 of file Interpolator.cs.

§ TargetLocalScale

Vector3 HoloToolkit.Unity.Interpolator.TargetLocalScale
get

If animating local scale, specifies the target local scale as specified by SetTargetLocalScale. Otherwise returns the current local scale of the transform.

Definition at line 499 of file Interpolator.cs.

§ TargetPosition

Vector3 HoloToolkit.Unity.Interpolator.TargetPosition
get

If animating position, specifies the target position as specified by SetTargetPosition. Otherwise returns the current position of the transform.

Definition at line 448 of file Interpolator.cs.

§ TargetRotation

Quaternion HoloToolkit.Unity.Interpolator.TargetRotation
get

If animating rotation, specifies the target rotation as specified by SetTargetRotation. Otherwise returns the current rotation of the transform.

Definition at line 465 of file Interpolator.cs.

Event Documentation

§ InterpolationDone

System.Action HoloToolkit.Unity.Interpolator.InterpolationDone

The event fired when an Interpolation is completed.

Definition at line 83 of file Interpolator.cs.

§ InterpolationStarted

System.Action HoloToolkit.Unity.Interpolator.InterpolationStarted

The event fired when an Interpolation is started.

Definition at line 78 of file Interpolator.cs.


The documentation for this class was generated from the following file: