日本語翻訳ドキュメントはサポートを終了しました

MRTK 2.6 以降のドキュメントについては、公式の Microsoft ドキュメント を参照してください。

    Show / Hide Table of Contents

    Class SurfaceMagnetism

    SurfaceMagnetism casts rays to Surfaces in the world and aligns the object to the hit surface.

    Inheritance
    Object
    Solver
    SurfaceMagnetism
    Inherited Members
    Solver.UpdateLinkedTransform
    Solver.MoveLerpTime
    Solver.RotateLerpTime
    Solver.ScaleLerpTime
    Solver.Smoothing
    Solver.SolverHandler
    Solver.GoalPosition
    Solver.GoalRotation
    Solver.GoalScale
    Solver.WorkingPosition
    Solver.WorkingRotation
    Solver.WorkingScale
    Solver.Awake()
    Solver.OnEnable()
    Solver.Start()
    Solver.OnDestroy()
    Solver.SolverUpdateEntry()
    Solver.SnapTo(Vector3, Quaternion, Vector3)
    Solver.SnapGoalTo(Vector3, Quaternion, Vector3)
    Solver.SnapTo(Vector3, Quaternion)
    Solver.SnapGoalTo(Vector3, Quaternion)
    Solver.AddOffset(Vector3)
    Solver.SmoothTo(Vector3, Vector3, Single, Single)
    Solver.SmoothTo(Quaternion, Quaternion, Single, Single)
    Solver.UpdateTransformToGoal()
    Solver.UpdateWorkingToGoal()
    Solver.UpdateWorkingPositionToGoal()
    Solver.UpdateWorkingRotationToGoal()
    Solver.UpdateWorkingScaleToGoal()
    Namespace: Microsoft.MixedReality.Toolkit.Utilities.Solvers
    Assembly: cs.temp.dll.dll
    Syntax
    public class SurfaceMagnetism : Solver

    Properties

    BoxRaysPerEdge

    Number of rays per edge, should be odd. Total casts is n^2

    Declaration
    public int BoxRaysPerEdge { get; set; }
    Property Value
    Type Description
    Int32

    CloseDistance

    Closest distance to bring object

    Declaration
    [Obsolete("Use ClosestDistance instead")]
    public float CloseDistance { get; set; }
    Property Value
    Type Description
    Single

    ClosestDistance

    Closest distance to bring object

    Declaration
    public float ClosestDistance { get; set; }
    Property Value
    Type Description
    Single

    CurrentOrientationMode

    How solver will orient model. See OrientationMode enum for possible modes. When mode=Blended, use OrientationBlend property to define ratio for blending

    Declaration
    public SurfaceMagnetism.OrientationMode CurrentOrientationMode { get; set; }
    Property Value
    Type Description
    SurfaceMagnetism.OrientationMode

    CurrentRaycastDirectionMode

    Raycast direction type. Default is forward direction of Tracked Target transform

    Declaration
    public SurfaceMagnetism.RaycastDirectionMode CurrentRaycastDirectionMode { get; set; }
    Property Value
    Type Description
    SurfaceMagnetism.RaycastDirectionMode

    DebugEnabled

    If enabled, the debug lines will be drawn in the editor

    Declaration
    public bool DebugEnabled { get; set; }
    Property Value
    Type Description
    Boolean

    KeepOrientationVertical

    If true, ensures object is kept vertical for TrackedTarget, SurfaceNormal, and Blended Orientation Modes

    Declaration
    public bool KeepOrientationVertical { get; set; }
    Property Value
    Type Description
    Boolean

    MagneticSurfaces

    Array of LayerMask to execute from highest to lowest priority. First layermask to provide a raycast hit will be used by component

    Declaration
    public LayerMask[] MagneticSurfaces { get; set; }
    Property Value
    Type Description
    LayerMask[]

    MaxDistance

    Max distance for raycast to check for surfaces

    Declaration
    [Obsolete("Use MaxRaycastDistance instead")]
    public float MaxDistance { get; set; }
    Property Value
    Type Description
    Single

    MaximumNormalVariance

    Align to ray cast direction if box cast hits many normals facing in varying directions

    Declaration
    public float MaximumNormalVariance { get; set; }
    Property Value
    Type Description
    Single

    MaxRaycastDistance

    Max distance for raycast to check for surfaces

    Declaration
    public float MaxRaycastDistance { get; set; }
    Property Value
    Type Description
    Single

    OnSurface

    Whether or not the object is currently magnetized to a surface.

    Declaration
    public bool OnSurface { get; }
    Property Value
    Type Description
    Boolean

    OrientationBlend

    Value used for when Orientation Mode=Blended. If 0.0 orientation is driven all by TrackedTarget mode and if 1.0 orientation is driven all by SurfaceNormal mode

    Declaration
    public float OrientationBlend { get; set; }
    Property Value
    Type Description
    Single

    OrthographicBoxCast

    If true, use orthographic casting for box lines instead of perspective

    Declaration
    public bool OrthographicBoxCast { get; set; }
    Property Value
    Type Description
    Boolean

    RaycastMode

    Surface raycast mode for solver

    Declaration
    public SceneQueryType RaycastMode { get; set; }
    Property Value
    Type Description
    SceneQueryType

    SphereSize

    Radius to use for sphere cast

    Declaration
    public float SphereSize { get; set; }
    Property Value
    Type Description
    Single

    SurfaceNormalOffset

    Offset from surface along surface normal

    Declaration
    public float SurfaceNormalOffset { get; set; }
    Property Value
    Type Description
    Single

    SurfaceRayOffset

    Offset from surface along ray cast direction

    Declaration
    public float SurfaceRayOffset { get; set; }
    Property Value
    Type Description
    Single

    UseLinkedAltScaleOverride

    When doing volume casts, use linked AltScale instead of object's current scale

    Declaration
    public bool UseLinkedAltScaleOverride { get; set; }
    Property Value
    Type Description
    Boolean

    VolumeCastSizeOverride

    When doing volume casts, use size override if non-zero instead of object's current scale

    Declaration
    public float VolumeCastSizeOverride { get; set; }
    Property Value
    Type Description
    Single

    Methods

    SolverUpdate()

    Should be implemented in derived classes, but Solver can be used to flush shared transform to real transform

    Declaration
    public override void SolverUpdate()
    Overrides
    Solver.SolverUpdate()
    Back to top Generated by DocFX