Class RaycastJobHelper
Inherited Members
Namespace: Marus.Sensors
Assembly: cs.temp.dll.dll
Syntax
public abstract class RaycastJobHelper
Methods
CalculateRayDirections(NativeArray<(Single, Single)>)
Calculates direction vectors from angles
Declaration
public static NativeArray<Vector3> CalculateRayDirections(NativeArray<(float, float)> rayAngles)
Parameters
Type | Name | Description |
---|---|---|
NativeArray<System.ValueTuple<System.Single, System.Single>> | rayAngles | Array of tuples defining the direction with angles: (horizontalAngle, verticalAngle) |
Returns
Type | Description |
---|---|
NativeArray<Vector3> | Array of direction vectors |
EvenlyDistributeRays(Int32, Int32, Single, Single)
Set evenly distributed array of ray directions for configured field of view and resolution
Declaration
public static NativeArray<Vector3> EvenlyDistributeRays(int widthRes, int heightRes, float horizontalFieldOfView, float verticalFieldOfView)
Parameters
Type | Name | Description |
---|---|---|
System.Int32 | widthRes | |
System.Int32 | heightRes | |
System.Single | horizontalFieldOfView | |
System.Single | verticalFieldOfView |
Returns
Type | Description |
---|---|
NativeArray<Vector3> |
InitCustomRays(List<Single>, Int32, Single)
Creates rays from vertical ray angles.
Declaration
public static NativeArray<(float, float)> InitCustomRays(List<float> verticalAngles, int widthRes, float horizontalFieldOfView)
Parameters
Type | Name | Description |
---|---|---|
List<System.Single> | verticalAngles | Angles of vertical rays, often found in lidar specification sheets. This also defines vertical field of view. |
System.Int32 | widthRes | Number of horizontal rays. |
System.Single | horizontalFieldOfView | Horizontal field of view. |
Returns
Type | Description |
---|---|
NativeArray<System.ValueTuple<System.Single, System.Single>> |
InitUniformRays(Int32, Int32, Single, Single)
Creates uniform rays defined by horizontal and vertical angles.
Declaration
public static NativeArray<(float, float)> InitUniformRays(int widthRes, int heightRes, float horizontalFieldOfView, float verticalFieldOfView)
Parameters
Type | Name | Description |
---|---|---|
System.Int32 | widthRes | Number of horizontal rays. |
System.Int32 | heightRes | Number of vertical rays. |
System.Single | horizontalFieldOfView | Horizontal field of view |
System.Single | verticalFieldOfView | Vertical field of view. Will span from -fov/2 to +fov/2 |
Returns
Type | Description |
---|---|
NativeArray<System.ValueTuple<System.Single, System.Single>> |
InitVerticalAnglesFromIntervals(List<RayInterval>, Int32, Single)
Creates rays from predefined vertical intervals with corresponding number of rays.
Declaration
public static List<float> InitVerticalAnglesFromIntervals(List<RayInterval> intervals, int widthRes, float horizontalFieldOfView)
Parameters
Type | Name | Description |
---|---|---|
List<RayInterval> | intervals | List of ray intervals containing starting angle, ending angle and number of rays in given interval. |
System.Int32 | widthRes | Number of horizontal rays. |
System.Single | horizontalFieldOfView | Horizontal field of view. |
Returns
Type | Description |
---|---|
List<System.Single> |