<commit_before>// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License. See LICENSE in the project root for license information.

using Microsoft.MixedReality.Toolkit.Physics;
using System;
using UnityEngine;
using UnityEngine.Serialization;

namespace Microsoft.MixedReality.Toolkit.Utilities.Solvers
{
    /// <summary>
    /// SurfaceMagnetism casts rays to Surfaces in the world and aligns the object to the hit surface.
    /// </summary>
    public class SurfaceMagnetism : Solver
    {
        #region Enums

        /// <summary>
        /// Raycast direction mode for solver
        /// </summary>
        public enum RaycastDirectionMode
        {
            /// <summary>
            /// Cast from Tracked Target in facing direction
            /// </summary>
            TrackedTargetForward = 0,

            /// <summary>
            /// Cast from Tracked Target position to this object's position
            /// </summary>
            ToObject,

            /// <summary>
            /// Cast from Tracked Target Position to linked solver position
            /// </summary>
            ToLinkedPosition
        }

        /// <summary>
        /// Orientation mode for solver
        /// </summary>
        public enum OrientationMode
        {
            /// <summary>
            /// No orienting
            /// </summary>
            None = 0,

            /// <summary>
            /// Face the tracked transform
            /// </summary>
            TrackedTarget = 1,

            /// <summary>
            /// Aligned to surface normal completely
            /// </summary>
            SurfaceNormal = 2,

            /// <summary>
            /// Blend between tracked transform vertical and the surface orientation
            /// </summary>
            Blended = 3,
        }
        #endregion

        #region SurfaceMagnetism Parameters
        [SerializeField]
        [Tooltip("Array of LayerMask to execute from highest to lowest priority. First layermask to provide a raycast hit will be used by component")]
        private LayerMask[] magneticSurfaces = { UnityEngine.Physics.DefaultRaycastLayers };

        /// <summary>
        /// Array of LayerMask to execute from highest to lowest priority. First layermask to provide a raycast hit will be used by component
        /// </summary>
        public LayerMask[] MagneticSurfaces
        {
            get { return magneticSurfaces; }
            set { magneticSurfaces = value; }
        }

        [SerializeField]
        [Tooltip("Max distance for raycast to check for surfaces")]
        [FormerlySerializedAs("maxDistance")]
        private float maxRaycastDistance = 50.0f;

        /// <summary><commit_msg>minor wording fix<commit_after>// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License. See LICENSE in the project root for license information.

using Microsoft.MixedReality.Toolkit.Physics;
using System;
using UnityEngine;
using UnityEngine.Serialization;

namespace Microsoft.MixedReality.Toolkit.Utilities.Solvers
{
    /// <summary>
    /// SurfaceMagnetism casts rays to Surfaces in the world and aligns the object to the hit surface.
    /// </summary>
    public class SurfaceMagnetism : Solver
    {
        #region Enums

        /// <summary>
        /// Raycast direction mode for solver
        /// </summary>
        public enum RaycastDirectionMode
        {
            /// <summary>
            /// Cast from Tracked Target in facing direction
            /// </summary>
            TrackedTargetForward = 0,

            /// <summary>
            /// Cast from Tracked Target position to this object's position
            /// </summary>
            ToObject,

            /// <summary>
            /// Cast from Tracked Target Position to linked solver position
            /// </summary>
            ToLinkedPosition
        }

        /// <summary>
        /// Orientation mode for solver
        /// </summary>
        public enum OrientationMode
        {
            /// <summary>
            /// No orienting
            /// </summary>
            None = 0,

            /// <summary>
            /// Face the tracked transform
            /// </summary>
            TrackedTarget = 1,

            /// <summary>
            /// Aligned to surface normal completely
            /// </summary>
            SurfaceNormal = 2,

            /// <summary>
            /// Blend between tracked transform and the surface normal orientation
            /// </summary>
            Blended = 3,
        }
        #endregion

        #region SurfaceMagnetism Parameters
        [SerializeField]
        [Tooltip("Array of LayerMask to execute from highest to lowest priority. First layermask to provide a raycast hit will be used by component")]
        private LayerMask[] magneticSurfaces = { UnityEngine.Physics.DefaultRaycastLayers };

        /// <summary>
        /// Array of LayerMask to execute from highest to lowest priority. First layermask to provide a raycast hit will be used by component
        /// </summary>
        public LayerMask[] MagneticSurfaces
        {
            get { return magneticSurfaces; }
            set { magneticSurfaces = value; }
        }

        [SerializeField]
        [Tooltip("Max distance for raycast to check for surfaces")]
        [FormerlySerializedAs("maxDistance")]
        private float maxRaycastDistance = 50.0f;

        /// <summary>
{'fraction_non_alphanumeric': 0.0921004732435384, 'fraction_numerical': 0.0029122679286494356, 'mean_word_length': 1.6329659798754192, 'pattern_counts': {'":': 0, '<': 49, '<?xml version=': 0, '>': 49, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '3112381', 'n_tokens_mistral': 1326, 'n_tokens_neox': 1263, 'n_words': 451}