java.lang.Object
physx.NativeObject
physx.particles.PxParticleClothBufferHelper
Helper class to manage PxParticleClothDesc buffers used for communicating particle based cloths to PxParticleClothBuffer.
-
Nested Class Summary
Nested classes/interfaces inherited from class physx.NativeObject
NativeObject.Allocator<T> -
Field Summary
FieldsFields inherited from class physx.NativeObject
address, isExternallyAllocated, SIZEOF_BYTE, SIZEOF_DOUBLE, SIZEOF_FLOAT, SIZEOF_INT, SIZEOF_LONG, SIZEOF_POINTER, SIZEOF_SHORT -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidaddCloth(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.voidaddCloth(PxParticleCloth particleCloth, PxU32Ptr triangles, int numTriangles, PxParticleSpring springs, int numSprings, PxVec4 restPositions, int numParticles) Adds a PxParticleCloth to this PxParticleClothBufferHelper instance.static PxParticleClothBufferHelperarrayGet(long baseAddress, int index) intintintintintintintintReturns a PxParticleClothDesc for this PxParticleClothBufferHelper instance to be used for spring partitioning.voidrelease()static PxParticleClothBufferHelperwrapPointer(long address) Methods inherited from class physx.NativeObject
checkNotNull, equals, getAddress, hashCode
-
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
-
arrayGet
-
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 trianglesnumTriangles- The number of trianglessprings- A pointer to the springsnumSprings- The number of springsrestPositions- A pointer to the particle rest positionsnumParticles- 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 inflatablepressure- 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 trianglesnumTriangles- The number of trianglessprings- A pointer to the springsnumSprings- The number of springsrestPositions- A pointer to the particle rest positionsnumParticles- The number of particles in this cloth- See Also:
-
getParticleClothDesc
Returns a PxParticleClothDesc for this PxParticleClothBufferHelper instance to be used for spring partitioning.- Returns:
- the PxParticleClothDesc.
-