|
LightWrap++
AC++wrapperfortheLightWave3DSDK
|
#include <particle_services.h>
Inheritance diagram for lwpp::ParticleServices:
Collaboration diagram for lwpp::ParticleServices:Public Member Functions | |
| ParticleServices (LWPSysID _prtsv_id=0) | |
| Constructor. | |
| LWPSBufID | addBuffer (LWPSBufDesc lwbufdesc) |
| int | addParticle () |
| void | attach (LWItemID lwitid) |
| void | cleanup () |
| LWPSysID | create (int flags, int type=LWPST_PRTCL) |
| int | destroy () |
| void | detach (LWItemID lwitid) |
| void * | getAge (int index) |
| template<typename T > | |
| void | getBufferData (LWPSBufID buffer_id, T &data) |
| LWPSBufID | getBufferID (int bufferFlag) |
| void * | getCollisionAge (int index) |
| void * | getForce (int index) |
| LWPSysID | getID () const |
| Returns the ID of the particle service. | |
| void * | getLink (int index) |
| void * | getMass (int index) |
| void | getParticle (LWPSBufID buffer_id, int index, void *data) |
| int | getParticleCount () |
| void * | getParticleID (int index) |
| char | getParticleState (int index) |
| LWPSysID * | getParticleSystems (LWItemID lwitid) |
| void | getPosition (int index, float *position) |
| Point3f | getPosition (int index) |
| void * | getPressure (int index) |
| void * | getRelativeAge (int index) |
| void | getRGBA (int index, unsigned char *RGBA) |
| void | getRotation (int index, float *rotation) |
| void | getScale (int index, float *scale) |
| void | getSize (int index, float *size) |
| void * | getStartPosition (int index, float *sposition) |
| void | getStartRotation (int index, float *srotation) |
| void | getStartScale (int index, float *sscale) |
| void * | getTemperature (int index) |
| void | getVelocity (int index, float *velocity) |
| int | init (int num_particles) |
| bool | isAlive (int index) |
| bool | isDead (int index) |
| bool | isLimbo (int index) |
| void | load (LWLoadState *loadstate) |
| void | removeParticle (int index) |
| void | save (LWSaveState *savestate) |
| void | setAge (int index, float *age) |
| template<typename T > | |
| void | setBufferData (LWPSBufID buffer_id, T data) |
| void | setCollisionAge (int index, float cage) |
| void | setForce (int index, float force) |
| void | setLink (int index, int link) |
| void | setMass (int index, float mass) |
| void | setParticle (LWPSBufID buffer_id, int index, void *data) |
| void | setParticleAlive (int index) |
| void | setParticleDead (int index) |
| void | setParticleID (int index, int PID) |
| void | setParticleLimbo (int index) |
| void | setParticleState (int index, char state) |
| void | setPosition (int index, float *position) |
| void | setPosition (int index, Point3d &position) |
| void | setPressure (int index, float pressure) |
| void | setRelativeAge (int index, float rage) |
| void | setRGBA (int index, unsigned char *RGBA) |
| void | setRotation (int index, float rotation) |
| void | setScale (int index, float scale) |
| void | setSize (int index, float size) |
| void | setStartPosition (int index, float sposition) |
| void | setStartRotation (int index, float srotation) |
| void | setStartScale (int index, float sscale) |
| void | setTemperature (int index, float temperature) |
| void | setVelocity (int index, float velocity) |
Protected Member Functions | |
| bool | _acquireGlobal () |
| virtual bool | available () const |
| Check if the global is available. | |
| virtual LWPSysFuncs * | getGlobal () |
| Get the pointer to the global. | |
| LWPSysFuncs * | operator-> () |
| Get the pointer to the global. | |
Static Protected Attributes | |
| static LWPSysFuncs * | globPtr |
| Pointer to the global functions. | |
Allow you to create particle systems and to read and write particle data. Particles are typically used by volumetric renderers to define the extent and local density of a volume.
The host side of the particles global manages a database of particle systems. The global supplies methods for adding, deleting and reading particle data in the database. Having such a database allows one plug-in to create particle systems that others can later use.
You can allocate, initialize and read particle data either individually (one particle at a time) or all at once. Which approach you take will depend primarily on where the data comes from and how you use it.
|
inline |
Constructor.
|
inlineprotectedinherited |
|
inline |
Add a custom per-particle buffer. Call this before any calls to init or addParticle. (The predefined buffer types should be added when create is called.) The structure used to define the buffer is described below. The buffer ID returned by this function can be used with the functions that get and set buffer data.
The function uses a buffer descriptor to define the buffer to be added. typedef struct st_LWPSBufDesc { const char *name; int dataType; int dataSize; } LWPSBufDesc;
name A string that names the buffer. In the future, this may allow users or plug-ins to refer to the buffer by name. dataType The data type of the data in the buffer. LWPSBT_FLOAT 0 LWPSBT_INT 1 LWPSBT_CHAR 2 dataSize The number of values per particle in the buffer (and not the number of bytes).
|
inline |
Add a particle.
|
inline |
Associate a particle system with an item in the scene, usually an object. More than one particle system can be attached to an item, and more than one item can share the same particle system. Attaching a particle system to an item makes it possible for others, Hypervoxels in particular, to use the getPSys function to find it.
|
inlinevirtualinherited |
Check if the global is available.
|
inline |
Frees the memory allocated by init and addParticle.
|
inline |
Create a particle system. The flags indicate which buffers should be allocated for the particles and can be any of the following, combined using bitwise-or. LWPSB_POS position float[3] LWPSB_SIZ size float LWPSB_SCL scale float[3] LWPSB_ROT rotation float[3] LWPSB_VEL velocity float[3] LWPSB_AGE age float LWPSB_FCE force float LWPSB_PRS pressure float LWPSB_TMP temperature float LWPSB_MAS mass float LWPSB_LNK link to particle (for trails) int LWPSB_ID ID (unique index for the particle) int LWPSB_ENB enable state (dead/alive/limbo) char LWPSB_RGBA display color and alpha char[4] LWPSB_CAGE time since last collision float
The particle type can be either LWPST_PRTCL (single points) or LWPST_TRAIL (line segments). LWPST_TRAIL particle systems has the LWPSB_LNK buffer for the second point in each trail created automatically.
|
inline |
Free the particle system.
|
inline |
Remove the association between a particle system and an item.
|
inline |
Returns the Age of a particle
| index | Index of the particle |
|
inline |
Set the buffer values for all particles. The data is an array of the appropriate type for the buffer, with a number of entries equal to the number of particles. Use setParticle to set the buffer data for one particle at a time.
|
inline |
Returns a buffer ID for one of the predefined buffers. This is used with the functions that get and set buffer data. The second argument is one of the buffer flags passed to create.
|
inline |
Returns the Collision Age (time since last collision) of a particle
| index | Index of the particle |
|
inline |
Returns the Force of a particle
| index | Index of the particle |
|
inlinevirtualinherited |
Get the pointer to the global.
|
inline |
Returns the ID of the particle service.
|
inline |
Returns the particle Link of a particle
| index | Index of the particle |
|
inline |
Returns the Mass of a particle
| index | Index of the particle |
|
inline |
Get the buffer value for a particle. Particles are numbered from 0 to getPCount-1 in the order in which they're added.
|
inline |
Returns the number of particles.
|
inline |
Returns the particle ID of a particle
| index | Index of the particle |
|
inline |
Returns the particle state of a particle
| index | Index of the particle Particle state values #define LWPST_DEAD 0 #define LWPST_ALIVE 1 #define LWPST_LIMBO 2 |
|
inline |
Returns a NULL-terminated array of particle system IDs that have been associated with the item by the attach function.
|
inline |
Returns the position of a particle
| index | Index of the particle |
| position | Pointer to a float[3] array were store the position of the particle |
|
inline |
Returns the position of a particle
| index | Index of the particle |
|
inline |
Returns the Pressure of a particle
| index | Index of the particle |
|
inline |
Returns the Relative Age (provide information about the life expectancy) of a particle
| index | Index of the particle |
|
inline |
Returns the RGBA of a particle
| index | Index of the particle |
| RGBA | Pointer to a char[4] array were store the RGBA of the particle |
|
inline |
Returns the rotation of a particle
| index | Index of the particle |
| rotation | Pointer to a float[3] array were store the rotation of the particle |
|
inline |
Returns the scale of a particle
| index | Index of the particle |
| scale | Pointer to a float[3] array were store the scale of the particle |
|
inline |
Returns the Size of a particle
| [in] | index | Index of the particle |
| [out] | size | A float storing containing the size |
|
inline |
Returns the start position of a particle
| index | Index of the particle |
| sposition | Pointer to a float[3] array were store the start position of the particle |
|
inline |
Returns the start rotation of a particle
| index | Index of the particle |
| srotation | Pointer to a float[3] array were store the rotation of the particle |
|
inline |
Returns the start scale of a particle
| index | Index of the particle |
| sscale | Pointer to a float[3] array were store the start scale of the particle |
|
inline |
Returns the Temperature of a particle
| index | Index of the particle |
|
inline |
Returns the velocity of a particle
| index | Index of the particle |
| velocity | Pointer to a float[3] array were store the velocity of the particle |
|
inline |
Allocate memory for the particles. This is equivalent to calling the addParticle function nparticles times.
|
inline |
Returns true if the particle is Alive
| index | Index of the particle |
|
inline |
Returns true if the particle is Dead
| index | Index of the particle |
|
inline |
Returns true if the particle is in Limbo
| index | Index of the particle |
|
inline |
Read the particle system data from a file. This will typically be used by handler load callbacks.
|
inlineinherited |
Get the pointer to the global.
|
inline |
Remove a particle.
|
inline |
Write the particle system data to a file. This will typically be used by handler save callbacks.
|
inline |
Changes the Age of a particle
| index | Index of the particle |
| age | Pointer to a float with the new Age of the particle |
|
inline |
Set the buffer values for all particles. The data is an array of the appropriate type for the buffer, with a number of entries equal to the number of particles. Use setParticle to set the buffer data for one particle at a time.
|
inline |
Changes the Collision Age (time since last collision) of a particle
| index | Index of the particle |
| cage | Pointer to a float with the new Collision Age of the particle |
|
inline |
Changes the Force of a particle
| index | Index of the particle |
| force | Pointer to a float with the new Force of the particle |
|
inline |
Changes the particle Link of a particle
| index | Index of the particle |
| link | Pointer to a float with the new Mass of the particle |
|
inline |
Changes the Mass of a particle
| index | Index of the particle |
| mass | Pointer to a float with the new Mass of the particle |
|
inline |
Set the buffer value for a particle. Particles are numbered from 0 to getPCount-1 in the order in which they're added.
|
inline |
Changes the state of a particle to Alive
| index | Index of the particle |
|
inline |
Changes the state of a particle to Dead
| index | Index of the particle |
|
inline |
Changes the particle ID of a particle
| index | Index of the particle |
| PID | Pointer to a int PID the new particle ID of the particle |
|
inline |
Changes the state of a particle to Limbo
| index | Index of the particle |
|
inline |
Changes the state of a particle
| index | Index of the particle |
| state | Pointer to a char with the new state of the particle |
|
inline |
Changes the position of a particle
| index | Index of the particle |
| position | Pointer to a float[3] array were is the new position of the particle |
|
inline |
Changes the position of a particle
| index | Index of the particle |
| position | Pointer to a Point3D were is the new position of the particle |
|
inline |
Changes the Pressure of a particle
| index | Index of the particle |
| pressure | Pointer to a float with the new Pressure of the particle |
|
inline |
Changes the Relative Age (provide information about the life expectancy) of a particle
| index | Index of the particle |
| rage | Pointer to a float with the new Relative Age of the particle |
|
inline |
Changes the the RGBA of a particle
| index | Index of the particle |
| RGBA | Pointer Pointer to a char[4] array were is the new RGBA of the particle |
|
inline |
Changes the rotation of a particle
| index | Index of the particle |
| rotation | Pointer to a float[3] array were is the new rotation of the particle |
|
inline |
Changes the scale of a particle
| index | Index of the particle |
| scale | Pointer to a float[3] array were is the new scale of the particle |
|
inline |
Changes the Size of a particle
| [in] | index | Index of the particle |
| [in] | size | a float with the new Size of the particle |
|
inline |
Changes the start position of a particle
| index | Index of the particle |
| sposition | Pointer to a float[3] array were is the new start position of the particle |
|
inline |
Changes the start rotation of a particle
| index | Index of the particle |
| srotation | Pointer to a float[3] array were is the new start rotation of the particle |
|
inline |
Changes the start scale of a particle
| index | Index of the particle |
| sscale | Pointer to a float[3] array were is the new start scale of the particle |
|
inline |
Changes the Temperature of a particle
| index | Index of the particle |
| temperature | Pointer to a float with the new Temperature of the particle |
|
inline |
Changes the velocity of a particle
| index | Index of the particle |
| velocity | Pointer to a float[3] array were is the new velocity of the particle |
|
staticprotectedinherited |
Pointer to the global functions.