Struct Array3D<T>
A three-dimensional array backed a flat array.
Implements
System.IDisposable
Namespace: GDX.Collections.Generic
Syntax
public struct Array3D<T> : IDisposable
Type Parameters
Name | Description |
---|---|
T | Type of objects. |
Constructors
| Improve this Doc View SourceArray3D(Int32, Int32, Int32)
Create a Array3D<T> with a uniform dimensional length.
Declaration
public Array3D(int width, int height, int depth)
Parameters
Type | Name | Description |
---|---|---|
System.Int32 | width | X-axis length. |
System.Int32 | height | Y-axis length. |
System.Int32 | depth | Z-axis length. |
Fields
| Improve this Doc View SourceArray
The backing flat array.
Declaration
public T[] Array
Field Value
Type | Description |
---|---|
T[] |
Depth
The stride of the z-axis segment in Array.
Declaration
public readonly int Depth
Field Value
Type | Description |
---|---|
System.Int32 |
DepthLength
The total length of a single Depth.
Declaration
public readonly int DepthLength
Field Value
Type | Description |
---|---|
System.Int32 |
Height
The stride of the y-axis segment in Array.
Declaration
public readonly int Height
Field Value
Type | Description |
---|---|
System.Int32 |
Length
The length of Array.
Declaration
public readonly int Length
Field Value
Type | Description |
---|---|
System.Int32 |
Width
The stride of the x-axis segment in Array.
Declaration
public readonly int Width
Field Value
Type | Description |
---|---|
System.Int32 |
Properties
| Improve this Doc View SourceItem[Int32, Int32, Int32]
Access a specific location in the voxel.
Declaration
public T this[int x, int y, int z] { get; set; }
Parameters
Type | Name | Description |
---|---|---|
System.Int32 | x | X location index. |
System.Int32 | y | Y location index. |
System.Int32 | z | Z location index. |
Property Value
Type | Description |
---|---|
T |
Item[int3]
Access a specific location in the voxel.
Declaration
public T this[int3 index] { get; set; }
Parameters
Type | Name | Description |
---|---|---|
Unity.Mathematics.int3 | index | A three-dimensional index. |
Property Value
Type | Description |
---|---|
T |
Methods
| Improve this Doc View SourceDispose()
Properly dispose of the Array3D<T>.
Declaration
public void Dispose()
GetFromIndex(Int32)
Get the three-dimensional index of a flat array index.
Declaration
public int3 GetFromIndex(int index)
Parameters
Type | Name | Description |
---|---|---|
System.Int32 | index | A flat array index. |
Returns
Type | Description |
---|---|
Unity.Mathematics.int3 | A three-dimensional voxel index. |
GetFromIndex(int3)
Declaration
public int GetFromIndex(int3 index)
Parameters
Type | Name | Description |
---|---|---|
Unity.Mathematics.int3 | index |
Returns
Type | Description |
---|---|
System.Int32 |
Implements
System.IDisposable