Class SensorUtils
Provides some useful ad hoc functions.
Namespace: Mechatronics.SensorSDK
Syntax
public class SensorUtils
Fields
WavelengthPropertyKey
Property key in our shaders for wave length.
Declaration
public static int WavelengthPropertyKey
Field Value
| Type | Description |
|---|---|
| Int32 |
Methods
CreateOrResizeComputeBuffer<T>(ref ComputeBuffer, Int32, String)
If the buffer does not have the exact number of elements requested or is not currently allocated, allocate it.
Declaration
public static void CreateOrResizeComputeBuffer<T>(ref ComputeBuffer buffer, int count, string name = null)
where T : struct
Parameters
| Type | Name | Description |
|---|---|---|
| ComputeBuffer | buffer | Compute buffer to possibly reallocate |
| Int32 | count | Number of elements of type T in the buffer |
| String | name | Optional name of the compute buffer used in debuggers |
Type Parameters
| Name | Description |
|---|---|
| T | The type of the elements in the buffer |
ObjectIdVector(UInt32)
Pack an id in a vector4.
Declaration
public static Vector4 ObjectIdVector(uint id)
Parameters
| Type | Name | Description |
|---|---|---|
| UInt32 | id | Index that will be packed. |
Returns
| Type | Description |
|---|---|
| Vector4 | Vector that contain the intex. |
TryAddTriggerBoxCollider(GameObject, Single)
If no collider is on the game object, add a box collider of given size, in Trigger mode
Declaration
public static bool TryAddTriggerBoxCollider(GameObject gameObject, float size = 0.01F)
Parameters
| Type | Name | Description |
|---|---|---|
| GameObject | gameObject | Game object to add the collider to |
| Single | size | Size of the cube |
Returns
| Type | Description |
|---|---|
| Boolean | true if the collider was added |