org.jocl.cloth
Class ClothSimulationCoreJava

java.lang.Object
  extended by org.jocl.cloth.ClothSimulationCoreJava
All Implemented Interfaces:
Simulation

 class ClothSimulationCoreJava
extends java.lang.Object
implements Simulation

The core of a cloth Simulation implemented in plain Java. It uses an ExecutorService to execute the computation with multiple threads. The particle-based tasks are divided among the available processors. The only edge-based tasks, namely the constraint enforcement of the independent sets, are each computed by one thread.


Constructor Summary
ClothSimulationCoreJava(ResourceHandle<java.nio.FloatBuffer> positionsHandle, ParticleData p, EdgeData[][] e)
          Creates a new cloth simulation core that will write the vertex positions into the buffer obtained from the given handle, and operates on the given simulation data .
 
Method Summary
 void performTimeStep(float dt)
          Perform a simulation step with the given size
 void prepareRendering()
          Perform any steps necessary to render the current simulation state
 void shutdown()
          Shut down the simulation and free all allocated resources
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ClothSimulationCoreJava

ClothSimulationCoreJava(ResourceHandle<java.nio.FloatBuffer> positionsHandle,
                        ParticleData p,
                        EdgeData[][] e)
Creates a new cloth simulation core that will write the vertex positions into the buffer obtained from the given handle, and operates on the given simulation data .

Parameters:
positionsHandle - The handle for the positions buffer
p - The ParticleData
e - The EdgeData
Method Detail

prepareRendering

public void prepareRendering()
Description copied from interface: Simulation
Perform any steps necessary to render the current simulation state

Specified by:
prepareRendering in interface Simulation

performTimeStep

public void performTimeStep(float dt)
Description copied from interface: Simulation
Perform a simulation step with the given size

Specified by:
performTimeStep in interface Simulation
Parameters:
dt - The step size

shutdown

public void shutdown()
Description copied from interface: Simulation
Shut down the simulation and free all allocated resources

Specified by:
shutdown in interface Simulation