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:
- 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.
- The 'numDetectableTags' element of the sublist will be 1 if the ray missed everything, or 0 if it hit something (detectable or not).
- 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 |