Class Momentum
Applies acceleration/velocity/friction to simulate momentum for an object being moved by other solvers/components
Inherited Members
Namespace: Microsoft.MixedReality.Toolkit.Utilities.Solvers
Assembly: cs.temp.dll.dll
Syntax
public class Momentum : Solver
Properties
AccelerationRate
Accelerate to goal position at this rate
Declaration
public float AccelerationRate { get; set; }
Property Value
Type | Description |
---|---|
Single |
Resistance
Friction to slow down the current velocity
Declaration
public float Resistance { get; set; }
Property Value
Type | Description |
---|---|
Single |
ResistanceVelocityPower
Apply more resistance when going faster- applied resistance is resistance * (velocity ^ resistanceVelocityPower)
Declaration
public float ResistanceVelocityPower { get; set; }
Property Value
Type | Description |
---|---|
Single |
SnapZ
Instantly maintain a constant depth from the view point instead of simulating Z-velocity
Declaration
public bool SnapZ { get; set; }
Property Value
Type | Description |
---|---|
Boolean |
Springiness
Apply more acceleration if farther from target- applied acceleration is accelerationRate + springiness * distance
Declaration
public float Springiness { get; set; }
Property Value
Type | Description |
---|---|
Single |
Methods
OnEnable()
Declaration
protected override void OnEnable()
Overrides
SnapTo(Vector3, Quaternion, Vector3)
Snaps the solver to the desired pose.
Declaration
public override void SnapTo(Vector3 position, Quaternion rotation, Vector3 scale)
Parameters
Type | Name | Description |
---|---|---|
Vector3 | position | |
Quaternion | rotation | |
Vector3 | scale |
Overrides
Remarks
SnapTo may be used to bypass smoothing to a certain position if the object is teleported or spawned.
SolverUpdate()
Should be implemented in derived classes, but Solver can be used to flush shared transform to real transform
Declaration
public override void SolverUpdate()