/// <summary>
 /// Fix rotation to the rotation from manipulation start
 /// </summary>
 public override void ApplyConstraint(ref MixedRealityTransform transform)
 {
     transform.Rotation = this.worldPoseOnManipulationStart.Rotation;
 }
Example #2
0
 public void ApplyTranslationConstraints(ref MixedRealityTransform transform, bool isOneHanded, bool isNear)
 {
     ApplyConstraintsForType(ref transform, isOneHanded, isNear, TransformFlags.Move);
 }
        /// <summary>
        /// Constrains scale such that the object's apparent size at manipulation
        /// start does not change when the object is moved towards and away from
        /// the head.
        /// </summary>
        public override void ApplyConstraint(ref MixedRealityTransform transform)
        {
            float dist = (transform.Position - CameraCache.Main.transform.position).magnitude;

            transform.Scale = (dist / initialDist) * initialScale;
        }