org.jocl.cloth
Class SimMeshUtils

java.lang.Object
  extended by org.jocl.cloth.SimMeshUtils

public class SimMeshUtils
extends java.lang.Object

Utility methods for handling simulation meshes


Method Summary
static java.util.List<de.javagl.simplemesh.Edge> computeBendingEdges(de.javagl.simplemesh.MeshPrimitives meshPrimitives)
          Compute all bending edges for the given mesh primitives.
(package private) static float[] computeEdgeRestLengths(java.util.Collection<? extends de.javagl.simplemesh.Edge> edges)
          Compute the rest lengths for the given edges.
(package private) static float[] computeInverseVertexMasses(de.javagl.simplemesh.MeshPrimitives meshPrimitives, float massPerSquareMeter)
          Compute the inverse masses of the vertices of the given MeshPrimitives.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

computeInverseVertexMasses

static float[] computeInverseVertexMasses(de.javagl.simplemesh.MeshPrimitives meshPrimitives,
                                          float massPerSquareMeter)
Compute the inverse masses of the vertices of the given MeshPrimitives.

Parameters:
meshPrimitives - The mesh primitives
massPerSquareMeter - The desired mass per square meter
Returns:
The inverse vertex masses

computeBendingEdges

public static java.util.List<de.javagl.simplemesh.Edge> computeBendingEdges(de.javagl.simplemesh.MeshPrimitives meshPrimitives)
Compute all bending edges for the given mesh primitives. That is, for all pairs of triangles that have a common edge, this method creates an edge between the vertices of the triangles that are not part of the common edges. It is made sure that no double edges are contained in the resulting list.

Parameters:
meshPrimitives - The mesh primitives
Returns:
The list of bending edges

computeEdgeRestLengths

static float[] computeEdgeRestLengths(java.util.Collection<? extends de.javagl.simplemesh.Edge> edges)
Compute the rest lengths for the given edges. This method assumes that the vertices of the given edges are in their rest state, and the array will simply contain the current lengths of the given edges.

Parameters:
edges - The edges
Returns:
The rest lengths