// Copyright (c) Microsoft Corporation. // Licensed under the MIT License. using System.Runtime.CompilerServices; [assembly: InternalsVisibleTo("Microsoft.MixedReality.Toolkit.Tests.PlayModeTests")] namespace Microsoft.MixedReality.Toolkit.Experimental.Physics { /// /// Represents a damped harmonic oscillator over an /// N-dimensional vector space, specified by generic type T. /// /// This extensibility allows not just for 1, 2, and 3-D springs, but /// allows for 4-dimensional quaternion springs. /// public interface IElasticSystem { /// /// Update the internal state of the damped harmonic oscillator, /// given the forcing/desired value, returning the new value. /// /// Forcing function, for example, a desired manipulation position. /// See https://en.wikipedia.org/wiki/Forcing_function_(differential_equations). It is a non-time-dependent /// input function to a differential equation; in our situation, it is the "input position" to the spring. /// Amount of time that has passed since the last update. /// The new value of the system. T ComputeIteration(T forcingValue, float deltaTime); /// /// Query the elastic system for the current instantaneous value /// /// Current value of the elastic system T GetCurrentValue(); /// /// Query the elastic system for the current instantaneous velocity /// /// Current value of the elastic system T GetCurrentVelocity(); } }