Edytuj

Udostępnij za pośrednictwem


StabilizedRay Class

Definition

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

The ray uses Anatolie Gavrulic's "DynamicExpDecay" filter to stabilize the ray this filter adjusts its smoothing factor based on the velocity of the filtered object

The formula is Y_smooted += ∆𝑌_𝑟 where 〖∆𝑌_𝑟=∆𝑌∗〖0.5〗^(∆𝑌/〖Halflife〗)

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

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

Constructors

StabilizedRay(Single)

HalfLife closer to zero means lerp closer to one.

Properties

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

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