// Copyright (c) Microsoft Corporation.
// Licensed under the MIT License.
using Microsoft.MixedReality.Toolkit.Utilities;
namespace Microsoft.MixedReality.Toolkit.UI
{
///
/// Component for fixing the rotation of a manipulated object relative to the world
///
public class FixedRotationToWorldConstraint : TransformConstraint
{
#region Properties
public override TransformFlags ConstraintType => TransformFlags.Rotate;
#endregion Properties
#region Public Methods
///
/// Fix rotation to the rotation from manipulation start
///
public override void ApplyConstraint(ref MixedRealityTransform transform)
{
transform.Rotation = this.worldPoseOnManipulationStart.Rotation;
}
#endregion Public Methods
}
}