Search Results for

    Show / Hide Table of Contents

    Struct VertexData

    An managed, resizable vertex data. Stores generic vertex information in interleaved array. As example if structure is created with Position+Normal attributes as result data will be stored in memory as follows: position0/normal0/position1/normal1...

    Implements
    Unity.Collections.INativeDisposable
    System.IDisposable
    Inherited Members
    System.ValueType.Equals(System.Object)
    System.ValueType.GetHashCode()
    System.ValueType.ToString()
    System.Object.Equals(System.Object, System.Object)
    System.Object.GetType()
    System.Object.ReferenceEquals(System.Object, System.Object)
    Namespace: ProjectDawn.Geometry3D
    Assembly: ProjectDawn.Geometry.dll
    Syntax
    [NativeContainer]
    public struct VertexData : INativeDisposable, IDisposable

    Constructors

    | Improve this Doc View Source

    VertexData(Int32, NativeArray<VertexAttributeDescriptor>, Allocator)

    Declaration
    public VertexData(int initialCapacity, NativeArray<VertexAttributeDescriptor> attributes, Allocator allocator)
    Parameters
    Type Name Description
    System.Int32 initialCapacity
    Unity.Collections.NativeArray<UnityEngine.Rendering.VertexAttributeDescriptor> attributes
    Unity.Collections.Allocator allocator

    Properties

    | Improve this Doc View Source

    Capacity

    The number of elements that fit in the current allocation.

    Declaration
    public int Capacity { get; set; }
    Property Value
    Type Description
    System.Int32

    The number of elements that fit in the current allocation.

    Exceptions
    Type Condition
    System.ArgumentOutOfRangeException

    Thrown if the new capacity is smaller than the length.

    | Improve this Doc View Source

    Flags

    Vertex attribute flags used for creating this vertex data.

    Declaration
    public VertexAttributes Flags { get; }
    Property Value
    Type Description
    VertexAttributes
    | Improve this Doc View Source

    IsCreated

    Whether this the vertex data has been allocated (and not yet deallocated).

    Declaration
    public bool IsCreated { get; }
    Property Value
    Type Description
    System.Boolean

    True if this the vertex data has been allocated (and not yet deallocated).

    | Improve this Doc View Source

    IsEmpty

    Whether the vertex data is empty.

    Declaration
    public bool IsEmpty { get; }
    Property Value
    Type Description
    System.Boolean

    True if the list is empty or the list has not been constructed.

    | Improve this Doc View Source

    Length

    The count of elements.

    Declaration
    public int Length { get; set; }
    Property Value
    Type Description
    System.Int32

    The current count of elements. Always less than or equal to the capacity.

    Remarks

    To decrease the memory used by a list, set Capacity after reducing the length of the list.

    | Improve this Doc View Source

    Size

    Size of the single vertex. It is a sum of all attributes size.

    Declaration
    public int Size { get; }
    Property Value
    Type Description
    System.Int32

    Methods

    | Improve this Doc View Source

    AsArray<T>()

    Returns a native array that aliases the array at the index.

    Declaration
    public NativeArray<T> AsArray<T>()
        where T : struct
    Returns
    Type Description
    Unity.Collections.NativeArray<T>

    A native array that aliases the content of this list.

    Type Parameters
    Name Description
    T
    | Improve this Doc View Source

    Clear()

    Clears the container.

    Declaration
    public void Clear()
    Remarks

    VertexData Capacity remains unchanged.

    | Improve this Doc View Source

    Dispose()

    Releases all resources (memory and safety handles).

    Declaration
    public void Dispose()
    | Improve this Doc View Source

    Dispose(JobHandle)

    Creates and schedules a job that releases all resources (memory and safety handles) of this vertex data.

    Declaration
    public JobHandle Dispose(JobHandle inputDeps)
    Parameters
    Type Name Description
    Unity.Jobs.JobHandle inputDeps

    The dependency for the new job.

    Returns
    Type Description
    Unity.Jobs.JobHandle

    The handle of the new job. The job depends upon inputDeps and releases all resources (memory and safety handles) of this vertex data.

    | Improve this Doc View Source

    ElementAt<T>(Int32)

    Returns a reference to the element at an index.

    Declaration
    public T ElementAt<T>(int index)
        where T : struct
    Parameters
    Type Name Description
    System.Int32 index

    An index.

    Returns
    Type Description
    T

    A reference to the element at the index.

    Type Parameters
    Name Description
    T
    Exceptions
    Type Condition
    System.IndexOutOfRangeException

    Thrown if index is out of bounds.

    | Improve this Doc View Source

    GetUnsafeVertexData()

    Returns the internal unsafe vertex data.

    Declaration
    public UnsafeVertexData*GetUnsafeVertexData()
    Returns
    Type Description
    UnsafeVertexData*

    The internal unsafe vertex data.

    Remarks

    Internally, the elements of a VertexData are stored in an UnsafeVertexData.

    | Improve this Doc View Source

    GetVertexAt(Int32)

    Returns vertex position at index.

    Declaration
    public float3 GetVertexAt(int index)
    Parameters
    Type Name Description
    System.Int32 index

    An index.

    Returns
    Type Description
    Unity.Mathematics.float3

    Returns vertex position at index.

    | Improve this Doc View Source

    GetVertexAttributes()

    Returns a native array of attributes used to create this vertex data structure.

    Declaration
    public NativeArray<VertexAttributeDescriptor> GetVertexAttributes()
    Returns
    Type Description
    Unity.Collections.NativeArray<UnityEngine.Rendering.VertexAttributeDescriptor>

    Returns a native array of attributes used to create this vertex data structure.

    | Improve this Doc View Source

    Resize(Int32, NativeArrayOptions)

    Sets the length of this vertex data, increasing the capacity if necessary.

    Declaration
    public void Resize(int length, NativeArrayOptions options)
    Parameters
    Type Name Description
    System.Int32 length

    The new length of this vertex data.

    Unity.Collections.NativeArrayOptions options

    Whether to clear any newly allocated bytes to all zeroes.

    | Improve this Doc View Source

    ResizeUninitialized(Int32)

    Sets the length of this list, increasing the capacity if necessary.

    Declaration
    public void ResizeUninitialized(int length)
    Parameters
    Type Name Description
    System.Int32 length

    The new length of this list.

    Remarks

    Does not clear newly allocated bytes.

    | Improve this Doc View Source

    SetCapacity(Int32)

    Sets the capacity.

    Declaration
    public void SetCapacity(int capacity)
    Parameters
    Type Name Description
    System.Int32 capacity

    The new capacity.

    Implements

    Unity.Collections.INativeDisposable
    System.IDisposable
    • Improve this Doc
    • View Source
    In This Article
    Back to top Copyright © ProjectDawn.
    Generated by DocFX