Nazara Engine  0.4
A fast, complete, cross-platform API designed for game development
Nz::ParticleMapper Class Reference

Graphics class that represents the mapping between the internal buffer and the particle declaration. More...

Public Member Functions

 ParticleMapper (void *buffer, const ParticleDeclaration *declaration)
 Constructs a ParticleMapper object with a raw buffer and a particle declaration. More...
 
template<typename T >
SparsePtr< T > GetComponentPtr (ParticleComponent component)
 Gets a pointer to iterate through same components. More...
 
template<typename T >
SparsePtr< const T > GetComponentPtr (ParticleComponent component) const
 Gets a pointer to iterate through same components. More...
 
void * GetPointer ()
 Gets a raw pointer to the particle buffer. More...
 

Detailed Description

Graphics class that represents the mapping between the internal buffer and the particle declaration.

Constructor & Destructor Documentation

◆ ParticleMapper()

Nz::ParticleMapper::ParticleMapper ( void *  buffer,
const ParticleDeclaration declaration 
)

Constructs a ParticleMapper object with a raw buffer and a particle declaration.

Parameters
bufferRaw buffer to store particles data
declarationDeclaration of the particle

Member Function Documentation

◆ GetComponentPtr() [1/2]

template<typename T >
SparsePtr< T > Nz::ParticleMapper::GetComponentPtr ( ParticleComponent  component)

Gets a pointer to iterate through same components.

Returns
SparsePtr pointing to same components
Parameters
componentComponent to get in the declaration
Remarks
The same components are not continguous but separated by sizeof(ParticleSize)
Produces a NazaraError if component is disabled

TODO: Check the ratio between the type of the attribute and the template type ?

◆ GetComponentPtr() [2/2]

template<typename T >
SparsePtr< const T > Nz::ParticleMapper::GetComponentPtr ( ParticleComponent  component) const

Gets a pointer to iterate through same components.

Returns
SparsePtr pointing to same components
Parameters
componentComponent to get in the declaration
Remarks
The same components are not continguous but separated by sizeof(ParticleSize)
Produces a NazaraError if component is disabled

TODO: Check the ratio between the type of the attribute and the template type ?

◆ GetPointer()

void * Nz::ParticleMapper::GetPointer ( )
inline

Gets a raw pointer to the particle buffer.

This can be useful when working directly with a struct

Returns
Pointer to the buffer

The documentation for this class was generated from the following files: