- Direct Known Subclasses:
PxParticleAndDiffuseBuffer,PxParticleClothBuffer
See #PxPhysics::createParticleBuffer.
A particle buffer is a container that specifies per-particle attributes of a set of particles that will be used during the simulation of a particle system. It exposes direct access to the underlying GPU buffers and is independent of the scene and particle system. Particle buffers can be added/removed from a particle system at any time between simulation steps, and transferred from one particle system to another.
-
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 TypeMethodDescriptionstatic PxParticleBufferarrayGet(long baseAddress, int index) intDeprecated.Will be removed in a future version, use getUniqueId() instead.intGet the start index for the first particle of this particle buffer in the complete list of particles of the particle system this buffer is used in.intGet the maximum number particles this particle buffer can hold.intDeprecated.Particle-cloth, -rigids, -attachments and -volumes have been deprecated.intGet the number of active particles for this particle buffer.intDeprecated.Particle-cloth, -rigids, -attachments and -volumes have been deprecated.Deprecated.Particle-cloth, -rigids, -attachments and -volumes have been deprecated.Get phases for this particle buffer.Get positions and inverse masses for this particle buffer.Get velocities for this particle buffer.voidRaise dirty flags on this particle buffer to communicate that the corresponding data has been updated by the user.voidrelease()Release this buffer and deallocate all the memory.voidsetNbActiveParticles(int nbActiveParticles) Set the number of active particles for this particle buffer.voidsetNbParticleVolumes(int nbParticleVolumes) Deprecated.Particle-cloth, -rigids, -attachments and -volumes have been deprecated.voidsetRigidAttachments(PxParticleRigidAttachment attachments, int nbAttachments) Deprecated.Particle-cloth, -rigids, -attachments and -volumes have been deprecated.voidsetRigidFilters(PxParticleRigidFilterPair filters, int nbFilters) Deprecated.Particle-cloth, -rigids, -attachments and -volumes have been deprecated.static PxParticleBufferwrapPointer(long address) Methods inherited from class physx.common.PxBase
getBaseFlags, getConcreteType, getConcreteTypeName, isReleasable, setBaseFlag, setBaseFlagsMethods 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
-
PxParticleBuffer
protected PxParticleBuffer() -
PxParticleBuffer
protected PxParticleBuffer(long address)
-
-
Method Details
-
wrapPointer
-
arrayGet
-
getBufferUniqueId
Deprecated.Will be removed in a future version, use getUniqueId() instead. Unique index that does not change over the lifetime of a PxParticleBuffer. -
getPositionInvMasses
Get positions and inverse masses for this particle buffer.- Returns:
- A pointer to a device buffer containing the positions and inverse mass packed as PxVec4(pos.x, pos.y, pos.z, inverseMass).
-
getVelocities
Get velocities for this particle buffer.- Returns:
- A pointer to a device buffer containing the velocities packed as PxVec4(vel.x, vel.y, vel.z, 0.0f).
-
getPhases
Get phases for this particle buffer.See #PxParticlePhaseFlag
- Returns:
- A pointer to a device buffer containing the per-particle phases for this particle buffer.
-
getParticleVolumes
Deprecated.Particle-cloth, -rigids, -attachments and -volumes have been deprecated. See #PxParticleVolumeGet particle volumes for this particle buffer.- Returns:
- A pointer to a device buffer containing the #PxParticleVolume s for this particle buffer.
-
setNbActiveParticles
public void setNbActiveParticles(int nbActiveParticles) Set the number of active particles for this particle buffer.- Parameters:
nbActiveParticles- The number of active particles.The number of active particles can be <= PxParticleBuffer::getMaxParticles(). The particle system will simulate the first x particles in the #PxParticleBuffer, where x is the number of active particles.
-
getNbActiveParticles
public int getNbActiveParticles()Get the number of active particles for this particle buffer.- Returns:
- The number of active particles.
-
getMaxParticles
public int getMaxParticles()Get the maximum number particles this particle buffer can hold.The maximum number of particles is specified when creating a #PxParticleBuffer. See #PxPhysics::createParticleBuffer.
- Returns:
- The maximum number of particles.
-
getNbParticleVolumes
Deprecated.Particle-cloth, -rigids, -attachments and -volumes have been deprecated.Get the number of particle volumes in this particle buffer.- Returns:
- The number of #PxParticleVolume s for this particle buffer.
-
setNbParticleVolumes
Deprecated.Particle-cloth, -rigids, -attachments and -volumes have been deprecated.Set the number of #PxParticleVolume s for this particle buffer.- Parameters:
nbParticleVolumes- The number of particle volumes in this particle buffer.
-
getMaxParticleVolumes
Deprecated.Particle-cloth, -rigids, -attachments and -volumes have been deprecated.See #PxParticleVolume.
Get the maximum number of particle volumes this particle buffer can hold.- Returns:
- The maximum number of particle volumes this particle buffer can hold.
-
setRigidFilters
Deprecated.Particle-cloth, -rigids, -attachments and -volumes have been deprecated. See #PxParticleRigidFilterPairSet the #PxParticleRigidFilterPair s for collision filtering of particles in this buffer with rigid bodies.- Parameters:
filters- A device buffer containing #PxParticleRigidFilterPair s.nbFilters- The number of particle-rigid body collision filtering pairs.
-
setRigidAttachments
@Deprecated public void setRigidAttachments(PxParticleRigidAttachment attachments, int nbAttachments) Deprecated.Particle-cloth, -rigids, -attachments and -volumes have been deprecated.See #PxParticleRigidAttachment
Set the particle-rigid body attachments for particles in this particle buffer.- Parameters:
attachments- A device buffer containing #PxParticleRigidAttachment s.nbAttachments- The number of particle-rigid body attachments.
-
getFlatListStartIndex
public int getFlatListStartIndex()Get the start index for the first particle of this particle buffer in the complete list of particles of the particle system this buffer is used in.The return value is only correct if the particle buffer is assigned to a particle system and at least one call to simulate() has been performed.
- Returns:
- The index of the first particle in the complete particle list.
-
raiseFlags
Raise dirty flags on this particle buffer to communicate that the corresponding data has been updated by the user.- Parameters:
flags- The flag corresponding to the data that is dirty.See #PxParticleBufferFlag.
-
release
public void release()Release this buffer and deallocate all the memory.
-