Class PxParticleClothBufferHelper

java.lang.Object
physx.NativeObject
physx.particles.PxParticleClothBufferHelper

public class PxParticleClothBufferHelper extends NativeObject
Helper class to manage PxParticleClothDesc buffers used for communicating particle based cloths to PxParticleClothBuffer.
  • Field Details

    • SIZEOF

      public static final int SIZEOF
    • ALIGNOF

      public static final int ALIGNOF
      See Also:
  • Constructor Details

    • PxParticleClothBufferHelper

      protected PxParticleClothBufferHelper()
    • PxParticleClothBufferHelper

      protected PxParticleClothBufferHelper(long address)
  • Method Details

    • wrapPointer

      public static PxParticleClothBufferHelper wrapPointer(long address)
    • arrayGet

      public static PxParticleClothBufferHelper arrayGet(long baseAddress, int index)
    • release

      public void release()
    • getMaxCloths

      public int getMaxCloths()
      Returns:
      The maximum number of cloths this PxParticleClothBufferHelper can hold.
    • getNumCloths

      public int getNumCloths()
      Returns:
      The current number of cloths in this PxParticleClothBufferHelper.
    • getMaxSprings

      public int getMaxSprings()
      Returns:
      The maximum number of springs this PxParticleClothBufferHelper can hold.
    • getNumSprings

      public int getNumSprings()
      Returns:
      The current number of springs in this PxParticleClothBufferHelper.
    • getMaxTriangles

      public int getMaxTriangles()
      Returns:
      The maximum number of triangles this PxParticleClothBufferHelper can hold.
    • getNumTriangles

      public int getNumTriangles()
      Returns:
      The current number of triangles in this PxParticleClothBufferHelper.
    • getMaxParticles

      public int getMaxParticles()
      Returns:
      The maximum number of particles this PxParticleClothBufferHelper can hold.
    • getNumParticles

      public int getNumParticles()
      Returns:
      The current number of particles in this PxParticleClothBufferHelper.
    • addCloth

      public void addCloth(PxParticleCloth particleCloth, PxU32Ptr triangles, int numTriangles, PxParticleSpring springs, int numSprings, PxVec4 restPositions, int numParticles)
      Adds a PxParticleCloth to this PxParticleClothBufferHelper instance.
      Parameters:
      particleCloth - The PxParticleCloth to be added.
      triangles - A pointer to the triangles
      numTriangles - The number of triangles
      springs - A pointer to the springs
      numSprings - The number of springs
      restPositions - A pointer to the particle rest positions
      numParticles - The number of particles in this cloth
      See Also:
    • addCloth

      public void addCloth(float blendScale, float restVolume, float pressure, PxU32Ptr triangles, int numTriangles, PxParticleSpring springs, int numSprings, PxVec4 restPositions, int numParticles)
      Adds a cloth to this PxParticleClothBufferHelper instance.

      Adds a cloth to this PxParticleClothBufferHelper instance. With this method the relevant parameters for inflatable simulation (restVolume, pressure) can be set directly.

      Parameters:
      blendScale - This should be 1.f / (numPartitions + 1) if the springs are partitioned by the user. Otherwise this will be set during spring partitioning.
      restVolume - The rest volume of the inflatable
      pressure - The pressure of the inflatable. The target inflatable volume is defined as restVolume * pressure. Setting this to > 0.0 will enable inflatable simulation.
      triangles - A pointer to the triangles
      numTriangles - The number of triangles
      springs - A pointer to the springs
      numSprings - The number of springs
      restPositions - A pointer to the particle rest positions
      numParticles - The number of particles in this cloth
      See Also:
    • getParticleClothDesc

      public PxParticleClothDesc getParticleClothDesc()
      Returns a PxParticleClothDesc for this PxParticleClothBufferHelper instance to be used for spring partitioning.
      Returns:
      the PxParticleClothDesc.