public static interface TriMesh.TriListener
extends java.util.EventListener
Classes that maintain references to tris in a tri mesh should implement this interface. Those references are almost certainly invalid (and may prevent garbage collection) after tris are removed from the mesh. This is especially important because tris removed may be reused, and given entirely different state, as tris are added to the mesh.
Tri listeners may be costly. Typically, for each node added to a tri mesh, roughly 4 tris are removed and 6 tris are added. Therefore, tri listeners should be added just prior to making a small number of incremental changes to the mesh, and removed after such changes are completed.
Modifier and Type | Method and Description |
---|---|
void |
triAdded(TriMesh mesh,
TriMesh.Tri tri)
Called after the specified tri has been added to the mesh.
|
void |
triRemoved(TriMesh mesh,
TriMesh.Tri tri)
Called after the specified tri has been removed from the mesh.
|
void triAdded(TriMesh mesh, TriMesh.Tri tri)
mesh
- this mesh.tri
- the tri added.void triRemoved(TriMesh mesh, TriMesh.Tri tri)
mesh
- this mesh.tri
- the tri removed.