|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.jocl.cloth.ClothSimulationMethods
class ClothSimulationMethods
Basic methods that are common to most types of cloth simulations.
Method Summary | |
---|---|
(package private) static void |
collisionDetection(int numParticles,
float[] candidatePositions,
float sphereRadius)
Perform a simple ... well, a trivial collision detection: Particles that are inside a virtual sphere with the specified radius will be moved out of the sphere on the shortest way. |
(package private) static void |
collisionDetection(int numParticles,
int minIndex,
int maxIndex,
float[] candidatePositions,
float sphereRadius)
Perform a simple ... well, a trivial collision detection: Particles that are inside a virtual sphere with the specified radius will be moved out of the sphere on the shortest way. |
(package private) static void |
computeCandidateState(int numParticles,
float[] positions,
float[] candidatePositions,
float[] velocities,
float[] accelerations,
float damping,
float dt)
Compute the candidate state for the simulation, by advancing the simulation by one time step, integrating the accelerations to update the velocities, and the velocities to update the positions. |
(package private) static void |
computeCandidateState(int numParticles,
int minIndex,
int maxIndex,
float[] positions,
float[] candidatePositions,
float[] velocities,
float[] accelerations,
float damping,
float dt)
Compute the candidate state for the simulation, by advancing the simulation by one time step, integrating the accelerations to update the velocities, and the velocities to update the positions. |
(package private) static java.lang.String |
debugCandidatePosition(ParticleData s,
int i)
Debugging method |
(package private) static float |
debugDistance(ParticleData s,
int pi0,
int pi1)
Debugging method |
(package private) static java.lang.String |
debugPosition(ParticleData s,
int i)
Debugging method |
(package private) static void |
enforceConstraints(EdgeData[] e,
float[] candidatePositions,
float[] invMasses,
float deviation,
int numIterations)
Perform the specified number of iterations for the edge constraint enforcement. |
(package private) static void |
enforceConstraintsSingleIteration(int numEdges,
int[] edgeVertexIndices,
float[] edgeRestLengths,
float[] candidatePositions,
float[] invMasses,
float deviation)
Perform a single iteration of the edge constraint enforcement. |
(package private) static void |
enforceGlobalConstraints(int numConstraints,
int[] constraints,
float[] constraintPositions,
float[] positions,
float[] candidatePositions,
float[] velocities)
Enforce the global constraints. |
(package private) static void |
initAccelerations(int numParticles,
float[] accelerations)
Initialize the accelerations to be only the gravity (-9.81 in negative y-direction) |
(package private) static void |
initConstraintMasses(int numConstraints,
int[] constraints,
float[] invMasses)
Initialize the inverse particle masses of the particles specified by the given constraints to a "large" number (theoretically, it should be "positive infinity", but #INF should be avoided) |
(package private) static void |
updateVelocities(int numParticles,
float[] positions,
float[] candidatePositions,
float[] velocities,
float dt)
Update the velocities of the particles. |
(package private) static void |
updateVelocities(int numParticles,
int minIndex,
int maxIndex,
float[] positions,
float[] candidatePositions,
float[] velocities,
float dt)
Update the velocities of the particles. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Method Detail |
---|
static void computeCandidateState(int numParticles, float[] positions, float[] candidatePositions, float[] velocities, float[] accelerations, float damping, float dt)
numParticles
- The number of particlespositions
- The particle positionscandidatePositions
- The candidate positionsvelocities
- The particle velocitiesaccelerations
- The particle accelerationsdamping
- The damping factordt
- The time step sizestatic void computeCandidateState(int numParticles, int minIndex, int maxIndex, float[] positions, float[] candidatePositions, float[] velocities, float[] accelerations, float damping, float dt)
numParticles
- The number of particlesminIndex
- The minimum particle index to treat heremaxIndex
- The maximum particle index to treat herepositions
- The particle positionscandidatePositions
- The candidate positionsvelocities
- The particle velocitiesaccelerations
- The particle accelerationsdamping
- The damping factordt
- The time step sizestatic void enforceConstraints(EdgeData[] e, float[] candidatePositions, float[] invMasses, float deviation, int numIterations)
enforceConstraintsSingleIteration(int,
int[], float[], float[], float[], float)
the specified number of times
for each EdgeData
e
- The EdgeDatacandidatePositions
- The candidate positionsinvMasses
- The inverse vertex massesdeviation
- The deviation from the rest length that
an edge must hat so that a correction is appliednumIterations
- The number of iterationsstatic void enforceConstraintsSingleIteration(int numEdges, int[] edgeVertexIndices, float[] edgeRestLengths, float[] candidatePositions, float[] invMasses, float deviation)
numEdges
- The number of edgesedgeVertexIndices
- The edge vertex indicescandidatePositions
- The candidate positionsinvMasses
- The inverse vertex massesedgeRestLengths
- The edge rest lengthsdeviation
- The deviation from the rest length that
an edge must hat so that a correction is appliedstatic void collisionDetection(int numParticles, float[] candidatePositions, float sphereRadius)
numParticles
- The number of particlescandidatePositions
- The candidate positionssphereRadius
- The sphere radiusstatic void collisionDetection(int numParticles, int minIndex, int maxIndex, float[] candidatePositions, float sphereRadius)
numParticles
- The number of particlesminIndex
- The minimum particle index to treat heremaxIndex
- The maximum particle index to treat herecandidatePositions
- The candidate positionssphereRadius
- The sphere radiusstatic void updateVelocities(int numParticles, float[] positions, float[] candidatePositions, float[] velocities, float dt)
numParticles
- The number of particlespositions
- The positionscandidatePositions
- The candidate positionsvelocities
- The velocitiesdt
- The time step sizestatic void updateVelocities(int numParticles, int minIndex, int maxIndex, float[] positions, float[] candidatePositions, float[] velocities, float dt)
numParticles
- The number of particlesminIndex
- The minimum particle index to treat heremaxIndex
- The maximum particle index to treat herepositions
- The positionscandidatePositions
- The candidate positionsvelocities
- The velocitiesdt
- The time step sizestatic void enforceGlobalConstraints(int numConstraints, int[] constraints, float[] constraintPositions, float[] positions, float[] candidatePositions, float[] velocities)
numConstraints
- The number of constraintsconstraints
- The constraints (indices of constrained particles)constraintPositions
- The constraint positionspositions
- The positionscandidatePositions
- The candidate positionsvelocities
- The velocitiesstatic void initConstraintMasses(int numConstraints, int[] constraints, float[] invMasses)
numConstraints
- The number of constraintsconstraints
- The constraints (indices of constrained particles)invMasses
- The inverse particle massesstatic void initAccelerations(int numParticles, float[] accelerations)
numParticles
- The number of particlesaccelerations
- The accelerationsstatic float debugDistance(ParticleData s, int pi0, int pi1)
s
- pi0
- pi1
-
static java.lang.String debugPosition(ParticleData s, int i)
s
- i
-
static java.lang.String debugCandidatePosition(ParticleData s, int i)
s
- i
-
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |