Scope for editing triangles of a mesh collider. More...
Inherits IDisposable.
Public Member Functions | |
EditMeshScope (FrameBase frame, DynamicMap map, int colliderIndex) | |
Creates a new scope for editing the triangles of a mesh collider. More... | |
void | AddTriangle (ref TriangleCCW tri) |
Adds a triangle to the mesh collider. More... | |
void | Dispose () |
Releases the resources used by the EditTrianglesScope. More... | |
TriangleCCW | GetTriangle (int index) |
Gets the triangle at the specified index from the edit data in the EditTrianglesScope. More... | |
Int32 | ReserveTriangleCapacity (FrameBase f, int capacity) |
Ensures that the mesh capacity is at least the specified capacity value. More... | |
void | SetTriangle (int index, ref TriangleCCW tri) |
Sets a triangle within the used range of a mesh collider. More... | |
void | SetTriangleUnchecked (int index, ref TriangleCCW tri) |
Setting a triangle of a mesh collider without checking the validity of the index . More... | |
bool | TryAddTriangle (ref TriangleCCW tri) |
Tries to add a triangle to the mesh collider. More... | |
bool | TrySetTriangle (int index, ref TriangleCCW tri) |
Try setting a triangle within the used range of a mesh collider. More... | |
Properties | |
MeshUnmanagedTrianglesRef | EditData [get] |
The mesh collider being edited. More... | |
Scope for editing triangles of a mesh collider.
|
inline |
Creates a new scope for editing the triangles of a mesh collider.
frame | Current Frame instance. Must be a Verified Frame. |
map | Dynamic map currently loaded by the physics engine. |
colliderIndex | Index of the mesh collider in the map . |
InvalidOperationException | If the frame is Predicted. |
InvalidOperationException | If the map is not the same map currently loaded by the Physics Engine. |
|
inline |
Ensures that the mesh capacity is at least the specified capacity value.
f | Current Frame instance. |
capacity | The requested capacity to be reserved. If smaller than the current capacity, nothing happens. |
|
inline |
Sets a triangle within the used range of a mesh collider.
index | The index of the triangle. |
tri | The triangle to set. |
IndexOutOfRangeException | If index is out bounds, considering the capacity of this mesh. |
InvalidOperationException | If index is out of the range of USED triangles. |
How to set a triangle of a mesh collider:
|
inline |
Try setting a triangle within the used range of a mesh collider.
index | The index of the triangle. |
tri | The triangle to set. |
false
if the index is out of the range of USED triangles. true
otherwise.How to try setting a triangle of a mesh collider:
|
inline |
Setting a triangle of a mesh collider without checking the validity of the index .
index | The index of the triangle. |
tri | The triangle to set. |
How to set a triangle of a mesh collider without checking the index:
|
inline |
Adds a triangle to the mesh collider.
tri | The triangle to be added. |
InvalidOperationException | If all triangles within the mesh capacity are already being used. |
How to add a triangle to a mesh collider:
If the mesh collider is at capacity, an InvalidOperationException is thrown.
|
inline |
Tries to add a triangle to the mesh collider.
tri | The triangle to be added. |
false
if all triangles within the mesh capacity are already being used. true
otherwise.How to try adding a triangle to a mesh collider:
|
inline |
Gets the triangle at the specified index from the edit data in the EditTrianglesScope.
index | The index of the triangle to get. |
IndexOutOfRangeException | If the index is out of bounds for the collider, considering its capacity. |
How to get a triangle from a mesh collider:
|
inline |
Releases the resources used by the EditTrianglesScope.
If the current frame is predicted, the method does nothing. Otherwise, it assigns the EditData to the collider at the specified index in the CollidersRuntimeTriangles dictionary and inserts the mesh collider into the physics engine scene using the TriangleReference obtained from Physics3D.SceneMesh.
|
get |
The mesh collider being edited.