newspeoplefor developersdocumentationdownloads

nParticleShapeNode Class Reference
[Scene System]

#include <nparticleshapenode.h>

Inheritance diagram for nParticleShapeNode:

nShapeNode nMaterialNode nAbstractShaderNode nTransformNode nSceneNode nRoot nObject nNode nReferenced nSignalEmitter List of all members.

Detailed Description

A shape node representing a particle system.

See also nParticleShapeNode Script Interface

(C) 2004 RadonLabs GmbH

Definition at line 21 of file nparticleshapenode.h.


Public Member Functions

 nParticleShapeNode ()
 constructor
virtual ~nParticleShapeNode ()
 destructor
virtual bool SaveCmds (nPersistServer *ps)
 object persistency
virtual void RenderContextCreated (nRenderContext *renderContext)
 called by app when new render context has been created for this object
virtual void Attach (nSceneServer *sceneServer, nRenderContext *renderContext)
 called by nSceneServer when object is attached to scene
virtual bool ApplyGeometry (nSceneServer *sceneServer)
 perform pre-instancing rendering of geometry
virtual bool RenderGeometry (nSceneServer *sceneServer, nRenderContext *renderContext)
 render geometry
virtual int GetMeshUsage () const
 get the mesh usage flags required by this shape node
virtual bool RenderTransform (nSceneServer *sceneServer, nRenderContext *renderContext, const matrix44 &parentMatrix)
 update transform and render into scene server
void SetEmissionDuration (nTime time)
 set the end time
nTime GetEmissionDuration () const
 get the emission duration
void SetLoop (bool b)
 set if loop emitter or not
bool GetLoop () const
 is loop emitter ?
void SetActivityDistance (float f)
 set the activity distance
float GetActivityDistance () const
 get the activity distance
void SetSpreadAngle (float f)
 set the inner cone
float GetSpreadAngle () const
 get the spread angle
void SetBirthDelay (float f)
 set the maximum birth delay
float GetBirthDelay () const
 get the maximum birth delay
void SetStartRotation (float f)
 set the maximum start rotation angle
float GetStartRotation () const
 get the maximum start rotation angle
void SetRenderOldestFirst (bool b)
 set whether to render oldest or youngest particles first
bool GetRenderOldestFirst () const
 get whether to render oldest or youngest particles first
void SetCurve (nParticleEmitter::CurveType curveType, const nEnvelopeCurve &curve)
 set one of the envelope curves (not the color)
const nEnvelopeCurveGetCurve (nParticleEmitter::CurveType curveType) const
 get one of the envelope curves
void SetRGBCurve (const nVector3EnvelopeCurve &curve)
 set the particle rgb curve
const nVector3EnvelopeCurveGetRGBCurve () const
 get the particle rgb curve
nParticleEmitterGetEmitter (nRenderContext *renderContext)
 Returns the current emitter.

Protected Attributes

nAutoRef< nParticleServerrefParticleServer
int emitterVarIndex
 index of the emitter in the render context
nTime emissionDuration
 how long shall be emitted ?
bool loop
 loop emitter ?
float activityDistance
 distance between viewer and emitter on witch emitter is active
float spreadAngle
 angle of emitted particle cone
float birthDelay
 maximum delay until particle starts to live
float startRotation
 maximum angle of rotation at birth
bool renderOldestFirst
 whether to render the oldest particles first or the youngest
nEnvelopeCurve curves [nParticleEmitter::CurveTypeCount]
nVector3EnvelopeCurve rgbCurve
nVariable::Handle timeHandle
nVariable::Handle windHandle

Constructor & Destructor Documentation

nParticleShapeNode::nParticleShapeNode  ) 
 

constructor

Definition at line 16 of file nparticleshapenode_main.cc.

nParticleShapeNode::~nParticleShapeNode  )  [virtual]
 

destructor

Definition at line 40 of file nparticleshapenode_main.cc.


Member Function Documentation

virtual bool nParticleShapeNode::SaveCmds nPersistServer ps  )  [virtual]
 

object persistency

Reimplemented from nShapeNode.

void nParticleShapeNode::RenderContextCreated nRenderContext renderContext  )  [virtual]
 

called by app when new render context has been created for this object

Reimplemented from nSceneNode.

Definition at line 112 of file nparticleshapenode_main.cc.

void nParticleShapeNode::Attach nSceneServer sceneServer,
nRenderContext renderContext
[virtual]
 

called by nSceneServer when object is attached to scene

Reimplemented from nTransformNode.

Definition at line 135 of file nparticleshapenode_main.cc.

bool nParticleShapeNode::ApplyGeometry nSceneServer sceneServer  )  [virtual]
 

perform pre-instancing rendering of geometry

Perform pre-instance-rendering of particle system. FIXME: check if this is the optimal setup for the new instance rendering!

Reimplemented from nShapeNode.

Definition at line 161 of file nparticleshapenode_main.cc.

bool nParticleShapeNode::RenderGeometry nSceneServer sceneServer,
nRenderContext renderContext
[virtual]
 

render geometry

Reimplemented from nShapeNode.

Definition at line 171 of file nparticleshapenode_main.cc.

int nParticleShapeNode::GetMeshUsage  )  const [virtual]
 

get the mesh usage flags required by this shape node

This method must return the mesh usage flag combination required by this shape node class. Subclasses should override this method based on their requirements.

Returns:
a combination of nMesh2::Usage flags

Reimplemented from nShapeNode.

Definition at line 149 of file nparticleshapenode_main.cc.

bool nParticleShapeNode::RenderTransform nSceneServer sceneServer,
nRenderContext renderContext,
const matrix44 parentMatrix
[virtual]
 

update transform and render into scene server

Compute the resulting modelview matrix and set it in the scene server as current modelview matrix.

FIXME FIXME FIXME *** why is emitter setup in RenderTransform() and not in RenderGeometry()??? generally do some cleanup on the particle subsystem

Reimplemented from nTransformNode.

Definition at line 57 of file nparticleshapenode_main.cc.

void nParticleShapeNode::SetEmissionDuration nTime  time  )  [inline]
 

set the end time

Definition at line 107 of file nparticleshapenode.h.

nTime nParticleShapeNode::GetEmissionDuration  )  const [inline]
 

get the emission duration

Definition at line 115 of file nparticleshapenode.h.

void nParticleShapeNode::SetLoop bool  b  )  [inline]
 

set if loop emitter or not

Definition at line 123 of file nparticleshapenode.h.

bool nParticleShapeNode::GetLoop  )  const [inline]
 

is loop emitter ?

Definition at line 131 of file nparticleshapenode.h.

void nParticleShapeNode::SetActivityDistance float  f  )  [inline]
 

set the activity distance

Definition at line 139 of file nparticleshapenode.h.

float nParticleShapeNode::GetActivityDistance  )  const [inline]
 

get the activity distance

Definition at line 171 of file nparticleshapenode.h.

void nParticleShapeNode::SetSpreadAngle float  f  )  [inline]
 

set the inner cone

Definition at line 147 of file nparticleshapenode.h.

float nParticleShapeNode::GetSpreadAngle  )  const [inline]
 

get the spread angle

Definition at line 179 of file nparticleshapenode.h.

void nParticleShapeNode::SetBirthDelay float  f  )  [inline]
 

set the maximum birth delay

Definition at line 155 of file nparticleshapenode.h.

float nParticleShapeNode::GetBirthDelay  )  const [inline]
 

get the maximum birth delay

Definition at line 187 of file nparticleshapenode.h.

void nParticleShapeNode::SetStartRotation float  f  )  [inline]
 

set the maximum start rotation angle

Definition at line 163 of file nparticleshapenode.h.

float nParticleShapeNode::GetStartRotation  )  const [inline]
 

get the maximum start rotation angle

Definition at line 195 of file nparticleshapenode.h.

void nParticleShapeNode::SetRenderOldestFirst bool  b  )  [inline]
 

set whether to render oldest or youngest particles first

Definition at line 205 of file nparticleshapenode.h.

bool nParticleShapeNode::GetRenderOldestFirst  )  const [inline]
 

get whether to render oldest or youngest particles first

Definition at line 215 of file nparticleshapenode.h.

void nParticleShapeNode::SetCurve nParticleEmitter::CurveType  curveType,
const nEnvelopeCurve curve
[inline]
 

set one of the envelope curves (not the color)

Definition at line 225 of file nparticleshapenode.h.

const nEnvelopeCurve & nParticleShapeNode::GetCurve nParticleEmitter::CurveType  curveType  )  const [inline]
 

get one of the envelope curves

Definition at line 237 of file nparticleshapenode.h.

void nParticleShapeNode::SetRGBCurve const nVector3EnvelopeCurve curve  )  [inline]
 

set the particle rgb curve

Definition at line 249 of file nparticleshapenode.h.

const nVector3EnvelopeCurve & nParticleShapeNode::GetRGBCurve  )  const [inline]
 

get the particle rgb curve

Definition at line 259 of file nparticleshapenode.h.

nParticleEmitter * nParticleShapeNode::GetEmitter nRenderContext renderContext  ) 
 

Returns the current emitter.

Returns the current emitter

Definition at line 196 of file nparticleshapenode_main.cc.


Member Data Documentation

nAutoRef<nParticleServer> nParticleShapeNode::refParticleServer [protected]
 

Definition at line 85 of file nparticleshapenode.h.

int nParticleShapeNode::emitterVarIndex [protected]
 

index of the emitter in the render context

Definition at line 87 of file nparticleshapenode.h.

nTime nParticleShapeNode::emissionDuration [protected]
 

how long shall be emitted ?

Definition at line 88 of file nparticleshapenode.h.

bool nParticleShapeNode::loop [protected]
 

loop emitter ?

Definition at line 89 of file nparticleshapenode.h.

float nParticleShapeNode::activityDistance [protected]
 

distance between viewer and emitter on witch emitter is active

Definition at line 91 of file nparticleshapenode.h.

float nParticleShapeNode::spreadAngle [protected]
 

angle of emitted particle cone

Definition at line 92 of file nparticleshapenode.h.

float nParticleShapeNode::birthDelay [protected]
 

maximum delay until particle starts to live

Definition at line 93 of file nparticleshapenode.h.

float nParticleShapeNode::startRotation [protected]
 

maximum angle of rotation at birth

Definition at line 94 of file nparticleshapenode.h.

bool nParticleShapeNode::renderOldestFirst [protected]
 

whether to render the oldest particles first or the youngest

Definition at line 95 of file nparticleshapenode.h.

nEnvelopeCurve nParticleShapeNode::curves[nParticleEmitter::CurveTypeCount] [protected]
 

Definition at line 97 of file nparticleshapenode.h.

nVector3EnvelopeCurve nParticleShapeNode::rgbCurve [protected]
 

Definition at line 98 of file nparticleshapenode.h.

nVariable::Handle nParticleShapeNode::timeHandle [protected]
 

Definition at line 100 of file nparticleshapenode.h.

nVariable::Handle nParticleShapeNode::windHandle [protected]
 

Definition at line 101 of file nparticleshapenode.h.


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

Copyright © 1999-2005 by the contributing authors. Ideas, requests, problems: Send feedback.