docs.unity.cn
Search Results for

    Show / Hide Table of Contents

    Method ToFloatArray

    ToFloatArray(int, int, float[])

    Writes the ray output information to a subset of the float array. Each element in the rayAngles array determines a sublist of data to the observation. The sublist contains the observation data for a single cast. The list is composed of the following:

    1. A one-hot encoding for detectable tags. For example, if DetectableTags.Length = n, the first n elements of the sublist will be a one-hot encoding of the detectableTag that was hit, or all zeroes otherwise.
    2. The 'numDetectableTags' element of the sublist will be 1 if the ray missed everything, or 0 if it hit something (detectable or not).
    3. The 'numDetectableTags+1' element of the sublist will contain the normalized distance to the object hit, or 1.0 if nothing was hit.
    Declaration
    public void ToFloatArray(int numDetectableTags, int rayIndex, float[] buffer)
    Parameters
    Type Name Description
    int numDetectableTags
    int rayIndex
    float[] buffer

    Output buffer. The size must be equal to (numDetectableTags+2) * RayOutputs.Length

    In This Article
    Back to top
    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