Support Forum G3D Web Page |
Not threadsafe. More...
Public Member Functions | |
shared_ptr< Block > | alloc (const shared_ptr< ParticleSystem > &particleSystem, const shared_ptr< ParticleSurface > &surface, int numElements) |
void | allocateVertexBuffer (const int newReserve) |
Allocate the vertexBuffer and all associated attribute arrays, throwing away all old data. More... | |
void | compact (const int newReserveCount) |
void | free (const shared_ptr< Block > &block) |
void | removeUnusedBlocks () |
Remove all blocks that are not in use because the underlying ParticleSurface referencing it is gone. More... | |
int | reserve () const |
Total elements allocated, including those in use. More... | |
Public Attributes | |
Array< shared_ptr< Block > > | blockArray |
A list of all Blocks in s_particleBuffer, which include potentially live ParticleSystems and where their particles are stored in s_particleBuffer. More... | |
int | count |
Elements actually in use. More... | |
IndexStream | indexStream |
Only used for sorted transparency. More... | |
AttributeArray | materialProperties |
material index, texture-space width/height in pixels (packed to top-left), Entity expressive rendering flags (e.g. More... | |
AttributeArray | normal |
GL_UNSIGNED_BYTE x 4. More... | |
AttributeArray | position |
Center of each particle, world-space XYZ, and the angle in GL_FLOAT x 4. More... | |
AttributeArray | shape |
world-space radius, coverage, userdata in GL_FLOAT x 3 More... | |
shared_ptr< VertexBuffer > | vertexBuffer |
Static Public Attributes | |
static const uint16 | CASTS_SHADOWS = 0x1 |
Mask for materialProperties[3]. More... | |
static const uint16 | RECEIVES_SHADOWS = 0x2 |
Mask for materialProperties[3]. More... | |
Not threadsafe.
shared_ptr<Block> G3D::ParticleSystem::ParticleBuffer::alloc | ( | const shared_ptr< ParticleSystem > & | particleSystem, |
const shared_ptr< ParticleSurface > & | surface, | ||
int | numElements | ||
) |
void G3D::ParticleSystem::ParticleBuffer::allocateVertexBuffer | ( | const int | newReserve | ) |
Allocate the vertexBuffer and all associated attribute arrays, throwing away all old data.
void G3D::ParticleSystem::ParticleBuffer::compact | ( | const int | newReserveCount | ) |
void G3D::ParticleSystem::ParticleBuffer::free | ( | const shared_ptr< Block > & | block | ) |
void G3D::ParticleSystem::ParticleBuffer::removeUnusedBlocks | ( | ) |
Remove all blocks that are not in use because the underlying ParticleSurface referencing it is gone.
|
inline |
Total elements allocated, including those in use.
A list of all Blocks in s_particleBuffer, which include potentially live ParticleSystems and where their particles are stored in s_particleBuffer.
Used for managing allocation of space within s_particleBuffer.
|
static |
Mask for materialProperties[3].
int G3D::ParticleSystem::ParticleBuffer::count |
Elements actually in use.
IndexStream G3D::ParticleSystem::ParticleBuffer::indexStream |
Only used for sorted transparency.
Recomputed for each draw call based on a depth sort. GL_UNSIGNED_INT
AttributeArray G3D::ParticleSystem::ParticleBuffer::materialProperties |
material index, texture-space width/height in pixels (packed to top-left), Entity expressive rendering flags (e.g.
: casts shadows, receives shadows), and userdataInt in GL_UNSIGNED_SHORT x 4 format
AttributeArray G3D::ParticleSystem::ParticleBuffer::normal |
GL_UNSIGNED_BYTE x 4.
The fourth component indicates how much it should be used vs. the billboard normal for shading purposes (we could use the magnitude of the normal, but we need the fourth component for alignment anyway).
AttributeArray G3D::ParticleSystem::ParticleBuffer::position |
Center of each particle, world-space XYZ, and the angle in GL_FLOAT x 4.
Referenced by reserve().
|
static |
Mask for materialProperties[3].
AttributeArray G3D::ParticleSystem::ParticleBuffer::shape |
world-space radius, coverage, userdata in GL_FLOAT x 3
shared_ptr<VertexBuffer> G3D::ParticleSystem::ParticleBuffer::vertexBuffer |