Language
Edit

StabilizedRay Class

Definition

A ray whose position and direction are stabilized in a way similar to how gaze stabilization works in HoloLens.

public class StabilizedRay
type StabilizedRay = class
Public Class StabilizedRay
Inheritance
StabilizedRay

Remarks

The ray uses a "DynamicExpDecay" filter to stabilize the ray. This filter adjusts its smoothing factor based on the velocity of the filtered object. The formula is Y_smoothed += βˆ†π‘Œ_π‘Ÿ where γ€–βˆ†π‘Œ_π‘Ÿ=βˆ†π‘Œβˆ—γ€–0.5γ€—^(βˆ†π‘Œ/γ€–Halflifeγ€—)

In code, LERP(signal, oldValue, POW(0.5, ABS(signal – oldValue) / hl)

Constructors

Name Description
StabilizedRay(Single, Single)

StabilizedRay with distinct position and direction half life values. HalfLife closer to zero means lerp closer to one.

StabilizedRay(Single)

HalfLife closer to zero means lerp closer to one.

Properties

Name Description
HalfLifeDirection

Half life used for velocity decay calculations.

HalfLifePosition

Half life used for position decay calculations.

StabilizedDirection

Computed stabilized direction.

StabilizedPosition

Computed Stabilized position.

Methods

Name Description
AddSample(Ray)

Add sample to ray stabilizer.

DynamicExpCoefficient(Single, Single)

Compute dynamic exponential coefficient.

DynamicExpDecay(Vector3, Vector3, Single)

Compute stabilized vector3 given a previously stabilized value, and a new sample, given a half life.

Applies to