org.jocl.cloth
Class ClothSimulationCoreJOCL

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

 class ClothSimulationCoreJOCL
extends java.lang.Object
implements Simulation

The core of a cloth Simulation implemented with OpenCL.


Constructor Summary
ClothSimulationCoreJOCL(CLSetup clSetup, ParticleData p, ResourceHandle<org.jocl.cl_mem> positions, ResourceHandle<org.jocl.cl_mem> candidatePositions, EdgeData[] e, ResourceHandle<java.nio.FloatBuffer> renderingPositions)
          Creates a new cloth simulation core
 
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

ClothSimulationCoreJOCL

ClothSimulationCoreJOCL(CLSetup clSetup,
                        ParticleData p,
                        ResourceHandle<org.jocl.cl_mem> positions,
                        ResourceHandle<org.jocl.cl_mem> candidatePositions,
                        EdgeData[] e,
                        ResourceHandle<java.nio.FloatBuffer> renderingPositions)
Creates a new cloth simulation core

Parameters:
clSetup - The OpenCL setup
p - The ParticleData
positions - The positions
candidatePositions - The candidate positions
e - The EdgeData
renderingPositions - If the buffers are not shared between OpenGL and OpenCL, then this is the handle to the rendering buffer. Otherwise, this is null.
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