docs.unity3d.com
    Show / Hide Table of Contents

    Class SensorUtils

    Provides some useful ad hoc functions.

    Inheritance
    Object
    SensorUtils
    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

    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