Planeshift
|
An effect is not much more than a collection of effect objects. More...
#include <pseffectobj.h>
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. More... | |
virtual psEffectObj * | Clone () const |
Clones the effect object. More... | |
virtual void | CloneBase (psEffectObj *newObj) const |
Convenience function to clone the base member variables. More... | |
const csString & | GetAnchorName () const |
Gets the name of the anchor that this effect obj is attached to. More... | |
float | GetAnimLength () const |
Accessor function to get the animation length of this effect obj. More... | |
float | GetBirth () const |
Get the birth. More... | |
int | GetDirection () const |
Get the direction. More... | |
psEffectObjKeyFrame * | GetKeyFrame (size_t idx) const |
Returns the keyframe at the given index. More... | |
size_t | GetKeyFrameCount () const |
Returns the number of keyframes in this obj. More... | |
int | GetKillTime () const |
Gets the time left that the effect obj has to live. More... | |
unsigned int | GetMixMode () const |
Get the mixmode for rendering the mesh. More... | |
csString | GetName () const |
Gets the name of this effect obj. More... | |
CS::Graphics::RenderPriority | GetRenderPriority () const |
Get the priority for rendering the mesh. More... | |
csZBufMode | GetZBufMode () const |
Get the zbuf mode for rendering the mesh. More... | |
virtual bool | Load (iDocumentNode *node, iLoaderContext *ldr_context) |
Loads the effect object from an xml node. More... | |
psEffectObj (iView *parentView, psEffect2DRenderer *renderer2d) | |
virtual bool | Render (const csVector3 &up) |
Renders the effect. More... | |
void | SetAnchorName (const csString &anchor) |
Sets the name of the anchor that this effect obj is attached to. More... | |
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. More... | |
void | SetKillTime (int newKillTime) |
Sets the new time left that the effect obj has to live. More... | |
void | SetPosition (const csMatrix3 &newPosTransf) |
Sets the position rotation of the effect obj. More... | |
void | SetRotBase (const csMatrix3 &newRotBase) |
Sets the base rotation matrix of the effect obj. More... | |
virtual bool | SetScaling (float scale, float aspect) |
If the obj supports it, sets the scaling parameters. More... | |
void | SetTarget (const csMatrix3 &newTargetTransf) |
Sets the target rotation of the effect obj. More... | |
virtual void | Show (bool value) |
Shows or hides an object. More... | |
virtual bool | Update (csTicks elapsed) |
Updates the spell effect – called every frame. More... | |
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). More... | |
void | FillInLerps () |
Linearly interpolates keyFrame values for actions that weren't specified in a certain key frame. More... | |
size_t | FindKeyFrameByTime (csTicks time) const |
Finds the index of the keyFrame at the specified time. More... | |
bool | FindNextKeyFrameWithAction (size_t startFrame, size_t action, size_t &index) const |
Finds the next key frame where the specific action is specified. More... | |
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 | |
psEffectAnchor * | anchor |
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 More... | |
csRef< iEngine > | engine |
csRef< iStringSet > | globalStringSet |
bool | isAlive |
csRef< psEffectObjKeyFrameGroup > | keyFrames |
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 |
psEffect2DRenderer * | renderer2d |
float | scale |
csRef< iShaderVarStringSet > | stringSet |
csVector3 | target |
csRef< iView > | view |
csZBufMode | zFunc |
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.
Enumerator | |
---|---|
DT_NONE | |
DT_ORIGIN | |
DT_TARGET | |
DT_TO_TARGET | |
DT_CAMERA | |
DT_BILLBOARD | |
DT_COUNT |
Definition at line 446 of file pseffectobj.h.
|
protected |
Enumerator | |
---|---|
SCALING_NONE | |
SCALING_BIRTH | |
SCALING_DEATH | |
SCALING_FRAMES | |
SCALING_LOOP |
Definition at line 460 of file pseffectobj.h.
psEffectObj::psEffectObj | ( | iView * | parentView, |
psEffect2DRenderer * | renderer2d | ||
) |
|
virtual |
|
virtual |
Attaches this mesh to the given effect anchor.
newAnchor | The effect anchor to attach this mesh to. |
Reimplemented in psEffectObjText2D, psEffectObjLight, and psEffectObjSound.
|
protected |
Builds a rotation matrix given an up vector (yaw is assumed to be 0).
up | the up (unit) vector |
|
virtual |
Clones the effect object.
This will almost always be overloaded.
Reimplemented in psEffectObjTrail, psEffectObjStar, psEffectObjQuad, psEffectObjSpire, psEffectObjText2D, psEffectObjText, psEffectObjLabel, psEffectObjDecal, psEffectObjParticles, psEffectObjSound, psEffectObjLight, psEffectObjMesh, and psEffectObjSimpMesh.
|
virtual |
Convenience function to clone the base member variables.
newObj | reference to the new object that will contain the cloned variables |
Reimplemented in psEffectObjQuad, and psEffectObjLabel.
|
protected |
Linearly interpolates keyFrame values for actions that weren't specified in a certain key frame.
|
protected |
Finds the index of the keyFrame at the specified time.
time | the time to lookup |
|
protected |
Finds the next key frame where the specific action is specified.
startFrame | the first frame to start looking |
action | the action to look for |
index | a container to store the index of the found key frame |
|
inline |
Gets the name of the anchor that this effect obj is attached to.
Definition at line 358 of file pseffectobj.h.
|
inline |
Accessor function to get the animation length of this effect obj.
Definition at line 408 of file pseffectobj.h.
|
inline |
|
inline |
|
inline |
Returns the keyframe at the given index.
idx | the index of the keyframe to grab |
Definition at line 441 of file pseffectobj.h.
|
inline |
Returns the number of keyframes in this obj.
Definition at line 430 of file pseffectobj.h.
|
inline |
Gets the time left that the effect obj has to live.
Definition at line 285 of file pseffectobj.h.
Get the mixmode for rendering the mesh.
Definition at line 388 of file pseffectobj.h.
|
inline |
Gets the name of this effect obj.
Definition at line 420 of file pseffectobj.h.
|
inline |
Get the priority for rendering the mesh.
Definition at line 368 of file pseffectobj.h.
|
inline |
Get the zbuf mode for rendering the mesh.
Definition at line 378 of file pseffectobj.h.
Definition at line 556 of file pseffectobj.h.
|
inlineprotected |
Definition at line 580 of file pseffectobj.h.
|
inlineprotected |
Definition at line 568 of file pseffectobj.h.
|
virtual |
Loads the effect object from an xml node.
node | the xml node containing the effect object, must be valid |
ldr_context | the current loader context. |
Reimplemented in psEffectObjTrail, psEffectObjStar, psEffectObjSpire, psEffectObjQuad, psEffectObjText2D, psEffectObjText, psEffectObjLabel, psEffectObjDecal, psEffectObjParticles, psEffectObjLight, psEffectObjMesh, psEffectObjSound, and psEffectObjSimpMesh.
|
virtual |
Renders the effect.
up | the base up vector of the effect obj |
Reimplemented in psEffectObjTrail, psEffectObjStar, psEffectObjSpire, psEffectObjQuad, psEffectObjText2D, psEffectObjLabel, psEffectObjDecal, psEffectObjParticles, psEffectObjLight, psEffectObjMesh, psEffectObjSound, and psEffectObjSimpMesh.
|
inline |
Sets the name of the anchor that this effect obj is attached to.
anchor | the 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 |
Adjust each parameter in each frame that have the use_scale property set with this scale.
|
inline |
Sets the new time left that the effect obj has to live.
newKillTime | the new kill time |
Definition at line 295 of file pseffectobj.h.
|
inline |
Sets the position rotation of the effect obj.
newPosTransf | the new position rotation. |
Definition at line 316 of file pseffectobj.h.
|
inline |
Sets the base rotation matrix of the effect obj.
newRotBase | the base rotation matrix of the angle |
Definition at line 305 of file pseffectobj.h.
If the obj supports it, sets the scaling parameters.
|
inline |
Sets the target rotation of the effect obj.
newTargetTransf | the new target rotation. |
Definition at line 327 of file pseffectobj.h.
|
virtual |
Shows or hides an object.
value | show or hide (true = show, false = hide) |
|
virtual |
Updates the spell effect – called every frame.
elapsed | the ticks elapsed since last update |
Reimplemented in psEffectObjTrail, psEffectObjStar, psEffectObjSpire, psEffectObjQuad, psEffectObjText2D, psEffectObjLabel, psEffectObjDecal, psEffectObjParticles, psEffectObjLight, psEffectObjMesh, psEffectObjSound, and psEffectObjSimpMesh.
|
protected |
Definition at line 514 of file pseffectobj.h.
|
protected |
Definition at line 513 of file pseffectobj.h.
|
protected |
Definition at line 512 of file pseffectobj.h.
|
protected |
Definition at line 507 of file pseffectobj.h.
|
protected |
Definition at line 508 of file pseffectobj.h.
|
protected |
Definition at line 554 of file pseffectobj.h.
|
protected |
Definition at line 509 of file pseffectobj.h.
|
protected |
Definition at line 527 of file pseffectobj.h.
|
protected |
Definition at line 525 of file pseffectobj.h.
|
protected |
Definition at line 539 of file pseffectobj.h.
|
protected |
Definition at line 536 of file pseffectobj.h.
|
protected |
region to store the CS objects
Definition at line 551 of file pseffectobj.h.
|
protected |
Definition at line 546 of file pseffectobj.h.
|
protected |
Definition at line 548 of file pseffectobj.h.
|
protected |
Definition at line 526 of file pseffectobj.h.
|
protected |
Definition at line 543 of file pseffectobj.h.
|
protected |
Definition at line 505 of file pseffectobj.h.
|
protected |
Definition at line 506 of file pseffectobj.h.
|
protected |
Definition at line 519 of file pseffectobj.h.
|
protected |
Definition at line 503 of file pseffectobj.h.
|
protected |
Definition at line 520 of file pseffectobj.h.
|
protected |
Definition at line 523 of file pseffectobj.h.
|
protected |
Definition at line 522 of file pseffectobj.h.
Definition at line 533 of file pseffectobj.h.
|
protected |
Definition at line 502 of file pseffectobj.h.
|
protected |
Definition at line 540 of file pseffectobj.h.
|
protected |
Definition at line 518 of file pseffectobj.h.
|
protected |
Definition at line 532 of file pseffectobj.h.
|
protected |
Definition at line 529 of file pseffectobj.h.
|
protected |
Definition at line 553 of file pseffectobj.h.
|
protected |
Definition at line 500 of file pseffectobj.h.
|
protected |
Definition at line 516 of file pseffectobj.h.
|
protected |
Definition at line 547 of file pseffectobj.h.
|
protected |
Definition at line 531 of file pseffectobj.h.