Struct MeshSurface
Mesh data structure. Used for modifying mesh data and reading/writing back to UnityEngine.Mesh.
Implements
Inherited Members
Namespace: ProjectDawn.Geometry3D
Assembly: ProjectDawn.Geometry.dll
Syntax
public struct MeshSurface : INativeDisposable, IDisposable
Constructors
| Improve this Doc View SourceMeshSurface(Int32, NativeArray<VertexAttributeDescriptor>, Allocator)
Declaration
public MeshSurface(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 |
Fields
| Improve this Doc View SourceIndices
Index list of the surface.
Declaration
public NativeList<int3> Indices
Field Value
| Type | Description |
|---|---|
| Unity.Collections.NativeList<Unity.Mathematics.int3> |
SubMeshes
Sub meshes of the surface.
Declaration
public NativeList<SubMeshDescriptor> SubMeshes
Field Value
| Type | Description |
|---|---|
| Unity.Collections.NativeList<UnityEngine.Rendering.SubMeshDescriptor> |
VertexData
Vertex Data of the surface.
Declaration
public VertexData VertexData
Field Value
| Type | Description |
|---|---|
| VertexData |
Properties
| Improve this Doc View SourceIsCreated
Returns if the surface is allocated.
Declaration
public bool IsCreated { get; }
Property Value
| Type | Description |
|---|---|
| System.Boolean |
IsEmpty
Whether the surface is empty.
Declaration
public bool IsEmpty { get; }
Property Value
| Type | Description |
|---|---|
| System.Boolean | True if the surface is empty or the surface has not been constructed. |
Methods
| Improve this Doc View SourceBoundingBox()
Returns minimum box that fully covers sub meshes.
Declaration
public Box BoundingBox()
Returns
| Type | Description |
|---|---|
| Box |
Clear()
Clears the container.
Declaration
public void Clear()
Remarks
MeshSurface Capacity remains unchanged.
Dispose()
Releases all resources (memory and safety handles).
Declaration
public void Dispose()
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 |
Read(Mesh.MeshData, JobHandle)
Writes UnityEngine.Mesh.MeshData into MeshSurface.
Declaration
public JobHandle Read(Mesh.MeshData meshData, JobHandle dependency)
Parameters
| Type | Name | Description |
|---|---|---|
| UnityEngine.Mesh.MeshData | meshData | Output. |
| Unity.Jobs.JobHandle | dependency | The dependency for the new job. |
Returns
| Type | Description |
|---|---|
| Unity.Jobs.JobHandle | The handle of the new job. |
RecalculateBounds(JobHandle)
Recalculates sub meshes bounds.
Declaration
public JobHandle RecalculateBounds(JobHandle dependency)
Parameters
| Type | Name | Description |
|---|---|---|
| Unity.Jobs.JobHandle | dependency | The dependency for the new job. |
Returns
| Type | Description |
|---|---|
| Unity.Jobs.JobHandle | The handle of the new job. |
Write(Mesh.MeshData, MeshUpdateFlags, JobHandle)
Writes MeshSurface into UnityEngine.Mesh.MeshData.
Declaration
public JobHandle Write(Mesh.MeshData meshData, MeshUpdateFlags flags, JobHandle dependency)
Parameters
| Type | Name | Description |
|---|---|---|
| UnityEngine.Mesh.MeshData | meshData | Output. |
| UnityEngine.Rendering.MeshUpdateFlags | flags | Mesh update flags. |
| Unity.Jobs.JobHandle | dependency | The dependency for the new job. |
Returns
| Type | Description |
|---|---|
| Unity.Jobs.JobHandle | The handle of the new job. |