Planeshift
Public Types | Public Member Functions | Protected Types | Protected Member Functions | Protected Attributes

psEffectObj Class Reference

An effect is not much more than a collection of effect objects. More...

#include <pseffectobj.h>

List of all members.

Public Types

enum  DIR_TYPE {
  DT_NONE = 0, DT_ORIGIN, DT_TARGET, DT_TO_TARGET,
  DT_CAMERA, DT_BILLBOARD, DT_COUNT
}

Public Member Functions

virtual bool AttachToAnchor (psEffectAnchor *newAnchor)
 Attaches this mesh to the given effect anchor.
virtual psEffectObjClone () const
 Clones the effect object.
virtual void CloneBase (psEffectObj *newObj) const
 Convenience function to clone the base member variables.
const csString & GetAnchorName () const
 Gets the name of the anchor that this effect obj is attached to.
float GetAnimLength () const
 Accessor function to get the animation length of this effect obj.
float GetBirth () const
 Get the birth.
int GetDirection () const
 Get the direction.
psEffectObjKeyFrameGetKeyFrame (size_t idx) const
 Returns the keyframe at the given index.
size_t GetKeyFrameCount () const
 Returns the number of keyframes in this obj.
int GetKillTime () const
 Gets the time left that the effect obj has to live.
unsigned int GetMixMode () const
 Get the mixmode for rendering the mesh.
csString GetName () const
 Gets the name of this effect obj.
CS::Graphics::RenderPriority GetRenderPriority () const
 Get the priority for rendering the mesh.
csZBufMode GetZBufMode () const
 Get the zbuf mode for rendering the mesh.
virtual bool Load (iDocumentNode *node, iLoaderContext *ldr_context)
 Loads the effect object from an xml node.
 psEffectObj (iView *parentView, psEffect2DRenderer *renderer2d)
virtual bool Render (const csVector3 &up)
 Renders the effect.
void SetAnchorName (const csString &anchor)
 Sets the name of the anchor that this effect obj is attached to.
void SetAnimationScaling (float s)
virtual bool SetFrameParamScalings (const float *scale)
 Adjust each parameter in each frame that have the use_scale property set with this scale.
void SetKillTime (int newKillTime)
 Sets the new time left that the effect obj has to live.
void SetPosition (const csMatrix3 &newPosTransf)
 Sets the position rotation of the effect obj.
void SetRotBase (const csMatrix3 &newRotBase)
 Sets the base rotation matrix of the effect obj.
virtual bool SetScaling (float scale, float aspect)
 If the obj supports it, sets the scaling parameters.
void SetTarget (const csMatrix3 &newTargetTransf)
 Sets the target rotation of the effect obj.
virtual void Show (bool value)
 Shows or hides an object.
virtual bool Update (csTicks elapsed)
 Updates the spell effect -- called every frame.
virtual ~psEffectObj ()

Protected Types

enum  SCALING_TYPE {
  SCALING_NONE = 0, SCALING_BIRTH = 1, SCALING_DEATH = 2, SCALING_FRAMES = 4,
  SCALING_LOOP = 8
}

Protected Member Functions

csMatrix3 BuildRotMatrix (const csVector3 &up) const
 Builds a rotation matrix given an up vector (yaw is assumed to be 0).
void FillInLerps ()
 Linearly interpolates keyFrame values for actions that weren't specified in a certain key frame.
size_t FindKeyFrameByTime (csTicks time) const
 Finds the index of the keyFrame at the specified time.
bool FindNextKeyFrameWithAction (size_t startFrame, size_t action, size_t &index) const
 Finds the next key frame where the specific action is specified.
float lerp (float f1, float f2, float factor)
float lerpFactor (csTicks t1, csTicks t2, csTicks t)
csVector3 lerpVec (const csVector3 &v1, const csVector3 &v2, float factor)

Protected Attributes

psEffectAnchoranchor
csRef< iMeshWrapper > anchorMesh
csString anchorName
csTicks animLength
float animScaling
float aspect
int autoScale
float baseScale
csTicks birth
size_t currKeyFrame
int dir
csRef< iCollection > effectsCollection
 region to store the CS objects
csRef< iEngine > engine
csRef< iStringSet > globalStringSet
bool isAlive
csRef< psEffectObjKeyFrameGroupkeyFrames
int killTime
csTicks life
csMatrix3 matBase
csString materialName
csMatrix3 matUp
csRef< iMeshWrapper > mesh
csRef< iMeshFactoryWrapper > meshFact
unsigned int mixmode
csString name
size_t nextKeyFrame
csVector3 objUp
CS::Graphics::RenderPriority priority
psEffect2DRendererrenderer2d
float scale
csRef< iShaderVarStringSet > stringSet
csVector3 target
csRef< iView > view
csZBufMode zFunc

Detailed Description

An effect is not much more than a collection of effect objects.

Effect objects aren't much more than a set of initial attributes and a collection of key frames to dictate behaviour

Definition at line 207 of file pseffectobj.h.


Member Enumeration Documentation

Enumerator:
DT_NONE 
DT_ORIGIN 
DT_TARGET 
DT_TO_TARGET 
DT_CAMERA 
DT_BILLBOARD 
DT_COUNT 

Definition at line 446 of file pseffectobj.h.

enum psEffectObj::SCALING_TYPE [protected]
Enumerator:
SCALING_NONE 
SCALING_BIRTH 
SCALING_DEATH 
SCALING_FRAMES 
SCALING_LOOP 

Definition at line 460 of file pseffectobj.h.


Constructor & Destructor Documentation

psEffectObj::psEffectObj ( iView *  parentView,
psEffect2DRenderer renderer2d 
)
virtual psEffectObj::~psEffectObj ( ) [virtual]

Member Function Documentation

virtual bool psEffectObj::AttachToAnchor ( psEffectAnchor newAnchor) [virtual]

Attaches this mesh to the given effect anchor.

Parameters:
newAnchorThe effect anchor to attach this mesh to.
Returns:
true If it attached properly, false otherwise.

Reimplemented in psEffectObjLight, psEffectObjSound, and psEffectObjText2D.

csMatrix3 psEffectObj::BuildRotMatrix ( const csVector3 &  up) const [protected]

Builds a rotation matrix given an up vector (yaw is assumed to be 0).

Parameters:
upthe up (unit) vector
Returns:
a rotation matrix representing the up vector
virtual psEffectObj* psEffectObj::Clone ( ) const [virtual]
virtual void psEffectObj::CloneBase ( psEffectObj newObj) const [virtual]

Convenience function to clone the base member variables.

Parameters:
newObjreference to the new object that will contain the cloned variables

Reimplemented in psEffectObjLabel, and psEffectObjQuad.

void psEffectObj::FillInLerps ( ) [protected]

Linearly interpolates keyFrame values for actions that weren't specified in a certain key frame.

size_t psEffectObj::FindKeyFrameByTime ( csTicks  time) const [protected]

Finds the index of the keyFrame at the specified time.

Parameters:
timethe time to lookup
Returns:
the index of the keyFrame at the specified time
bool psEffectObj::FindNextKeyFrameWithAction ( size_t  startFrame,
size_t  action,
size_t &  index 
) const [protected]

Finds the next key frame where the specific action is specified.

Parameters:
startFramethe first frame to start looking
actionthe action to look for
indexa container to store the index of the found key frame
Returns:
true if it found one, false otherwise
const csString& psEffectObj::GetAnchorName ( ) const [inline]

Gets the name of the anchor that this effect obj is attached to.

Returns:
The name of the anchor that this effect obj is attached to.

Definition at line 358 of file pseffectobj.h.

float psEffectObj::GetAnimLength ( ) const [inline]

Accessor function to get the animation length of this effect obj.

Returns:
the animation length of this effect obj

Definition at line 408 of file pseffectobj.h.

float psEffectObj::GetBirth ( ) const [inline]

Get the birth.

Returns:
the birth value

Definition at line 398 of file pseffectobj.h.

int psEffectObj::GetDirection ( ) const [inline]

Get the direction.

Returns:
direction.

Definition at line 338 of file pseffectobj.h.

psEffectObjKeyFrame* psEffectObj::GetKeyFrame ( size_t  idx) const [inline]

Returns the keyframe at the given index.

Parameters:
idxthe index of the keyframe to grab
Returns:
the keyframe at the given index

Definition at line 441 of file pseffectobj.h.

size_t psEffectObj::GetKeyFrameCount ( ) const [inline]

Returns the number of keyframes in this obj.

Returns:
the keyFrame count

Definition at line 430 of file pseffectobj.h.

int psEffectObj::GetKillTime ( ) const [inline]

Gets the time left that the effect obj has to live.

Returns:
the current kill time

Definition at line 285 of file pseffectobj.h.

unsigned int psEffectObj::GetMixMode ( ) const [inline]

Get the mixmode for rendering the mesh.

Returns:
the CS mixmode.

Definition at line 388 of file pseffectobj.h.

csString psEffectObj::GetName ( ) const [inline]

Gets the name of this effect obj.

Returns:
the name of this effect obj.

Definition at line 420 of file pseffectobj.h.

CS::Graphics::RenderPriority psEffectObj::GetRenderPriority ( ) const [inline]

Get the priority for rendering the mesh.

Returns:
the CS engine priority.

Definition at line 368 of file pseffectobj.h.

csZBufMode psEffectObj::GetZBufMode ( ) const [inline]

Get the zbuf mode for rendering the mesh.

Returns:
the CS zbuf mode.

Definition at line 378 of file pseffectobj.h.

float psEffectObj::lerp ( float  f1,
float  f2,
float  factor 
) [inline, protected]

Definition at line 556 of file pseffectobj.h.

float psEffectObj::lerpFactor ( csTicks  t1,
csTicks  t2,
csTicks  t 
) [inline, protected]

Definition at line 580 of file pseffectobj.h.

csVector3 psEffectObj::lerpVec ( const csVector3 &  v1,
const csVector3 &  v2,
float  factor 
) [inline, protected]

Definition at line 568 of file pseffectobj.h.

virtual bool psEffectObj::Load ( iDocumentNode *  node,
iLoaderContext *  ldr_context 
) [virtual]

Loads the effect object from an xml node.

Parameters:
nodethe xml node containing the effect object, must be valid
ldr_contextthe current loader context.
Returns:
true on success, false otherwise

Reimplemented in psEffectObjDecal, psEffectObjLabel, psEffectObjLight, psEffectObjMesh, psEffectObjParticles, psEffectObjQuad, psEffectObjSimpMesh, psEffectObjSound, psEffectObjSpire, psEffectObjStar, psEffectObjText, psEffectObjText2D, and psEffectObjTrail.

virtual bool psEffectObj::Render ( const csVector3 &  up) [virtual]

Renders the effect.

Parameters:
upthe base up vector of the effect obj
Returns:
true on success

Reimplemented in psEffectObjDecal, psEffectObjLabel, psEffectObjLight, psEffectObjMesh, psEffectObjParticles, psEffectObjQuad, psEffectObjSimpMesh, psEffectObjSound, psEffectObjSpire, psEffectObjStar, psEffectObjText2D, and psEffectObjTrail.

void psEffectObj::SetAnchorName ( const csString &  anchor) [inline]

Sets the name of the anchor that this effect obj is attached to.

Parameters:
anchorthe new name of the anchor that this obj is attached to

Definition at line 348 of file pseffectobj.h.

void psEffectObj::SetAnimationScaling ( float  s)
virtual bool psEffectObj::SetFrameParamScalings ( const float scale) [virtual]

Adjust each parameter in each frame that have the use_scale property set with this scale.

Returns:
True if if any params where scaled
void psEffectObj::SetKillTime ( int  newKillTime) [inline]

Sets the new time left that the effect obj has to live.

Parameters:
newKillTimethe new kill time

Definition at line 295 of file pseffectobj.h.

void psEffectObj::SetPosition ( const csMatrix3 &  newPosTransf) [inline]

Sets the position rotation of the effect obj.

Parameters:
newPosTransfthe new position rotation.

Definition at line 316 of file pseffectobj.h.

void psEffectObj::SetRotBase ( const csMatrix3 &  newRotBase) [inline]

Sets the base rotation matrix of the effect obj.

Parameters:
newRotBasethe base rotation matrix of the angle

Definition at line 305 of file pseffectobj.h.

virtual bool psEffectObj::SetScaling ( float  scale,
float  aspect 
) [virtual]

If the obj supports it, sets the scaling parameters.

void psEffectObj::SetTarget ( const csMatrix3 &  newTargetTransf) [inline]

Sets the target rotation of the effect obj.

Parameters:
newTargetTransfthe new target rotation.

Definition at line 327 of file pseffectobj.h.

virtual void psEffectObj::Show ( bool  value) [virtual]

Shows or hides an object.

Parameters:
valueshow or hide (true = show, false = hide)
virtual bool psEffectObj::Update ( csTicks  elapsed) [virtual]

Updates the spell effect -- called every frame.

Parameters:
elapsedthe ticks elapsed since last update
Returns:
false if the obj is useless and can be removed

Reimplemented in psEffectObjDecal, psEffectObjLabel, psEffectObjLight, psEffectObjMesh, psEffectObjParticles, psEffectObjQuad, psEffectObjSimpMesh, psEffectObjSound, psEffectObjSpire, psEffectObjStar, psEffectObjText2D, and psEffectObjTrail.


Member Data Documentation

Definition at line 514 of file pseffectobj.h.

csRef<iMeshWrapper> psEffectObj::anchorMesh [protected]

Definition at line 513 of file pseffectobj.h.

csString psEffectObj::anchorName [protected]

Definition at line 512 of file pseffectobj.h.

csTicks psEffectObj::animLength [protected]

Definition at line 507 of file pseffectobj.h.

Definition at line 508 of file pseffectobj.h.

Definition at line 554 of file pseffectobj.h.

Definition at line 509 of file pseffectobj.h.

Definition at line 527 of file pseffectobj.h.

csTicks psEffectObj::birth [protected]

Definition at line 525 of file pseffectobj.h.

size_t psEffectObj::currKeyFrame [protected]

Definition at line 539 of file pseffectobj.h.

int psEffectObj::dir [protected]

Definition at line 536 of file pseffectobj.h.

csRef<iCollection> psEffectObj::effectsCollection [protected]

region to store the CS objects

Definition at line 551 of file pseffectobj.h.

csRef<iEngine> psEffectObj::engine [protected]

Definition at line 546 of file pseffectobj.h.

csRef<iStringSet> psEffectObj::globalStringSet [protected]

Definition at line 548 of file pseffectobj.h.

bool psEffectObj::isAlive [protected]

Definition at line 526 of file pseffectobj.h.

Definition at line 543 of file pseffectobj.h.

Definition at line 505 of file pseffectobj.h.

csTicks psEffectObj::life [protected]

Definition at line 506 of file pseffectobj.h.

csMatrix3 psEffectObj::matBase [protected]

Definition at line 519 of file pseffectobj.h.

csString psEffectObj::materialName [protected]

Definition at line 503 of file pseffectobj.h.

csMatrix3 psEffectObj::matUp [protected]

Definition at line 520 of file pseffectobj.h.

csRef<iMeshWrapper> psEffectObj::mesh [protected]

Definition at line 523 of file pseffectobj.h.

csRef<iMeshFactoryWrapper> psEffectObj::meshFact [protected]

Definition at line 522 of file pseffectobj.h.

Definition at line 533 of file pseffectobj.h.

csString psEffectObj::name [protected]

Definition at line 502 of file pseffectobj.h.

size_t psEffectObj::nextKeyFrame [protected]

Definition at line 540 of file pseffectobj.h.

csVector3 psEffectObj::objUp [protected]

Definition at line 518 of file pseffectobj.h.

CS::Graphics::RenderPriority psEffectObj::priority [protected]

Definition at line 532 of file pseffectobj.h.

Definition at line 529 of file pseffectobj.h.

Definition at line 553 of file pseffectobj.h.

csRef<iShaderVarStringSet> psEffectObj::stringSet [protected]

Definition at line 500 of file pseffectobj.h.

csVector3 psEffectObj::target [protected]

Definition at line 516 of file pseffectobj.h.

csRef<iView> psEffectObj::view [protected]

Definition at line 547 of file pseffectobj.h.

csZBufMode psEffectObj::zFunc [protected]

Definition at line 531 of file pseffectobj.h.


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