Photon Quantum 3.0.0

Public Member Functions | Public Attributes | List of all members
Quantum.MeshUnmanagedTrianglesRef Struct Reference

A lightweight reference to a mesh in unmanaged memory. More...

Public Member Functions

 MeshUnmanagedTrianglesRef ()
 Creates an empty MeshUnmanagedTrianglesRef. More...
 
 MeshUnmanagedTrianglesRef (UnmanagedTriangleArray triangles, Int32 first, Int32 capacity, Int32 usedCount)
 Creates a new instance of MeshUnmanagedTrianglesRef. More...
 
 MeshUnmanagedTrianglesRef (UnmanagedTriangleArray triangles, Int32 first, Int32 usedCount)
 Obsolete. Use overload that takes 'capacity' parameter instead. See MeshUnmanagedTrianglesRef. More...
 
TriangleCCW * GetFreeTriangles (out int freeCount)
 Gets a buffer of unused triangles on this mesh collider. More...
 
TriangleCCW * GetTriangles (out Int32 usedCount)
 Gets a pointer to the first triangle of the mesh and the number of used triangles. Mesh triangles are allocated in a contiguous buffer starting from the first triangle. More...
 
TriangleCCW * GetTriangles (out Int32 usedCount, out Int32 capacity)
 Gets a pointer to the first triangle of the mesh, the number of used triangles and the capacity of the buffer. More...
 
bool TryGetFreeTriangles (out TriangleCCW *freeTriangles, out int freeCount)
 Gets a buffer of unused triangles on this mesh collider. More...
 
bool TryGetTriangles (out TriangleCCW *triangles, out Int32 usedCount)
 
bool TryGetTriangles (out TriangleCCW *triangles, out Int32 usedCount, out Int32 capacity)
 Tries to get a buffer of the triangles on this mesh collider. More...
 

Public Attributes

readonly Int32 Capacity
 The capacity of the buffer. More...
 
Int32 Count => UsedCount
 Obsolete. Use UsedCount instead. More...
 
readonly Int32 First
 The index of the first triangle of this mesh in the buffer. More...
 
readonly UnmanagedTriangleArray Triangles
 The unmanaged buffer containing all triangles. More...
 
readonly Int32 UsedCount
 The amount of triangles used. More...
 

Detailed Description

A lightweight reference to a mesh in unmanaged memory.

Constructor & Destructor Documentation

◆ MeshUnmanagedTrianglesRef() [1/3]

Quantum.MeshUnmanagedTrianglesRef.MeshUnmanagedTrianglesRef ( UnmanagedTriangleArray  triangles,
Int32  first,
Int32  usedCount 
)
inline

Obsolete. Use overload that takes 'capacity' parameter instead. See MeshUnmanagedTrianglesRef.

◆ MeshUnmanagedTrianglesRef() [2/3]

Quantum.MeshUnmanagedTrianglesRef.MeshUnmanagedTrianglesRef ( UnmanagedTriangleArray  triangles,
Int32  first,
Int32  capacity,
Int32  usedCount 
)
inline

Creates a new instance of MeshUnmanagedTrianglesRef.

Parameters
trianglesThe unmanaged buffer containing all triangles.
firstThe index of the first triangle of this mesh in the buffer.
capacityThe capacity of the buffer.
usedCountThe amount of triangles used.

◆ MeshUnmanagedTrianglesRef() [3/3]

Quantum.MeshUnmanagedTrianglesRef.MeshUnmanagedTrianglesRef ( )
inline

Creates an empty MeshUnmanagedTrianglesRef.

Member Function Documentation

◆ GetTriangles() [1/2]

TriangleCCW* Quantum.MeshUnmanagedTrianglesRef.GetTriangles ( out Int32  usedCount)
inline

Gets a pointer to the first triangle of the mesh and the number of used triangles. Mesh triangles are allocated in a contiguous buffer starting from the first triangle.

Parameters
usedCountthe number of used triangles in the mesh.
Returns
A pointer to first triangle in the mesh.

◆ GetTriangles() [2/2]

TriangleCCW* Quantum.MeshUnmanagedTrianglesRef.GetTriangles ( out Int32  usedCount,
out Int32  capacity 
)
inline

Gets a pointer to the first triangle of the mesh, the number of used triangles and the capacity of the buffer.

Parameters
usedCountThe number of used triangles in the mesh.
capacityThe capacity of the buffer allocated for the mesh.
Returns
A pointer to first triangle in the mesh.

◆ TryGetTriangles()

bool Quantum.MeshUnmanagedTrianglesRef.TryGetTriangles ( out TriangleCCW *  triangles,
out Int32  usedCount,
out Int32  capacity 
)
inline

Tries to get a buffer of the triangles on this mesh collider.

Parameters
trianglesA pointer to the first triangles in this mesh collider, if any. null otherwise.
usedCountHow many triangles are used.
capacityThe capacity of the buffer allocated for this mesh.
Returns
true if this mesh collider has triangles. false otherwise.

◆ GetFreeTriangles()

TriangleCCW* Quantum.MeshUnmanagedTrianglesRef.GetFreeTriangles ( out int  freeCount)
inline

Gets a buffer of unused triangles on this mesh collider.

Parameters
freeCountHow many triangles are free.
Returns
A pointer to the first free triangles in this mesh collider, if any. null otherwise.

◆ TryGetFreeTriangles()

bool Quantum.MeshUnmanagedTrianglesRef.TryGetFreeTriangles ( out TriangleCCW *  freeTriangles,
out int  freeCount 
)
inline

Gets a buffer of unused triangles on this mesh collider.

Parameters
freeTrianglesA pointer to the first free triangles in this mesh collider, if any. null otherwise.
freeCountHow many triangles are free.
Returns
true if this mesh collider has free triangles. false otherwise.

Member Data Documentation

◆ Triangles

readonly UnmanagedTriangleArray Quantum.MeshUnmanagedTrianglesRef.Triangles

The unmanaged buffer containing all triangles.

◆ First

readonly Int32 Quantum.MeshUnmanagedTrianglesRef.First

The index of the first triangle of this mesh in the buffer.

◆ UsedCount

readonly Int32 Quantum.MeshUnmanagedTrianglesRef.UsedCount

The amount of triangles used.

◆ Capacity

readonly Int32 Quantum.MeshUnmanagedTrianglesRef.Capacity

The capacity of the buffer.

◆ Count

Int32 Quantum.MeshUnmanagedTrianglesRef.Count => UsedCount

Obsolete. Use UsedCount instead.