// Copyright (c) Microsoft Corporation.
// Licensed under the MIT License.
using UnityEngine;
namespace Microsoft.MixedReality.Toolkit.Physics
{
///
/// A base class for a stabilizer that takes an input position and rotation,
/// and performs operations on them to stabilize, or smooth deltas, in the data.
///
public abstract class BaseRayStabilizer : IBaseRayStabilizer
{
///
/// The stabilized position.
///
public abstract Vector3 StablePosition { get; }
///
/// The stabilized rotation.
///
public abstract Quaternion StableRotation { get; }
///
/// A ray representing the stable position and rotation
///
public abstract Ray StableRay { get; }
///
/// Call this each frame to smooth out changes to a position and rotation, if supported.
///
/// Input position to smooth.
/// Input rotation to smooth.
public virtual void UpdateStability(Vector3 position, Quaternion rotation)
{
UpdateStability(position, (rotation * Vector3.forward));
}
///
/// Call this each frame to smooth out changes to a position and direction, if supported.
///
/// Input position to smooth.
/// Input direction to smooth.
public abstract void UpdateStability(Vector3 position, Vector3 direction);
}
}