docs.unity3d.com
    Show / Hide Table of Contents

    Struct RayPerceptionInput

    Contains the elements that define a ray perception sensor.

    Inherited Members
    ValueType.Equals(Object)
    ValueType.GetHashCode()
    ValueType.ToString()
    Object.Equals(Object, Object)
    Object.ReferenceEquals(Object, Object)
    Object.GetType()
    Namespace: Unity.MLAgents.Sensors
    Syntax
    public struct RayPerceptionInput

    Fields

    Angles

    List of angles (in degrees) used to define the rays. 90 degrees is considered "forward" relative to the game object.

    Declaration
    public IReadOnlyList<float> Angles
    Field Value
    Type Description
    IReadOnlyList<Single>

    CastRadius

    Radius of the sphere to use for spherecasting. If 0 or less, rays are used instead - this may be faster, especially for complex environments.

    Declaration
    public float CastRadius
    Field Value
    Type Description
    Single

    CastType

    Whether to perform the casts in 2D or 3D.

    Declaration
    public RayPerceptionCastType CastType
    Field Value
    Type Description
    RayPerceptionCastType

    DetectableTags

    List of tags which correspond to object types agent can see.

    Declaration
    public IReadOnlyList<string> DetectableTags
    Field Value
    Type Description
    IReadOnlyList<String>

    EndOffset

    Ending height offset of ray from center of agent.

    Declaration
    public float EndOffset
    Field Value
    Type Description
    Single

    LayerMask

    Filtering options for the casts.

    Declaration
    public int LayerMask
    Field Value
    Type Description
    Int32

    RayLength

    Length of the rays to cast. This will be scaled up or down based on the scale of the transform.

    Declaration
    public float RayLength
    Field Value
    Type Description
    Single

    StartOffset

    Starting height offset of ray from center of agent

    Declaration
    public float StartOffset
    Field Value
    Type Description
    Single

    Transform

    Transform of the GameObject.

    Declaration
    public Transform Transform
    Field Value
    Type Description
    Transform

    Methods

    OutputSize()

    Returns the expected number of floats in the output.

    Declaration
    public int OutputSize()
    Returns
    Type Description
    Int32

    RayExtents(Int32)

    Get the cast start and end points for the given ray index/

    Declaration
    public (Vector3 StartPositionWorld, Vector3 EndPositionWorld) RayExtents(int rayIndex)
    Parameters
    Type Name Description
    Int32 rayIndex
    Returns
    Type Description
    (T1, T2)<Vector3, Vector3>

    A tuple of the start and end positions in world space.

    Back to top
    Terms of use
    Copyright © 2023 Unity Technologies — Terms of use
    • Legal
    • Privacy Policy
    • Cookies
    • Do Not Sell or Share My Personal Information
    • Your Privacy Choices (Cookie Settings)
    "Unity", Unity logos, and other Unity trademarks are trademarks or registered trademarks of Unity Technologies or its affiliates in the U.S. and elsewhere (more info here). Other names or brands are trademarks of their respective owners.
    Generated by DocFX on 18 October 2023