Planeshift
|
Effect anchors provide a base location / anchor point for all effect objs. More...
#include <pseffectanchor.h>
Public Types | |
enum | DIR_TYPE { DT_NONE = 0, DT_ORIGIN, DT_TARGET, DT_COUNT } |
Public Member Functions | |
size_t | AddKeyFrame (float time) |
Creates a new keyframe and attaches it to this movable. | |
virtual psEffectAnchor * | Clone () const |
Clones the effect anchor. | |
void | CloneBase (psEffectAnchor *newAnchor) const |
Convenience function to clone the base member variables. | |
virtual bool | Create (const csVector3 &offset, iMeshWrapper *posAttach, bool rotateWithMesh=false) |
Creates the effect anchor. | |
void | FillInLerps () |
Interpolates keyFrame actions for ones that weren't specified in each keyframe. | |
float | GetAnimGetSize () |
Gets the animation length of the effect anchor. | |
const char * | GetDirectionType () const |
Gets the direction type of this anchor. | |
psEffectAnchorKeyFrame * | GetKeyFrame (size_t idx) const |
Returns the keyframe at the given index. | |
size_t | GetKeyFrameCount () const |
Returns the number of keyframes in this anchor. | |
iMeshWrapper * | GetMesh () const |
Returns the mesh that's associated with this effect anchor (almost always a nullmesh). | |
const csString & | GetName () const |
Returns the name of this effect anchor. | |
bool | IsReady () const |
Check to see if this anchor is ready. | |
virtual bool | Load (iDocumentNode *node) |
Loads the effect anchors from an xml node. | |
psEffectAnchor () | |
void | SetAnimLength (float newAnimLength) |
Sets the animation length of the effect anchor. | |
void | SetDirectionType (const char *newDir) |
Sets the direction type of this anchor. | |
void | SetName (const csString &newName) |
Sets the name of this effect anchor. | |
virtual void | SetPosition (const csVector3 &basePos, iSectorList *sectors, const csMatrix3 &transf) |
Sets a new position for the effect anchor. | |
virtual void | SetPosition (const csVector3 &basePos, iSector *sector, const csMatrix3 &transf) |
Sets a new position for the effect anchor. | |
virtual void | SetRotBase (const csMatrix3 &newRotBase) |
Sets the base rotation matrix of the effect anchor. | |
void | SetTarget (const csVector3 &newTarget, const csMatrix3 &transf) |
Sets the target of the effect anchor. | |
void | TransformOffset (csVector3 &offset) |
Transforms the offset according to the mesh's settings, like abs_dir, etc. | |
virtual bool | Update (csTicks elapsed) |
Updates the effect anchor -- called every frame. | |
virtual | ~psEffectAnchor () |
Protected Member Functions | |
size_t | FindKeyFrameByTime (float 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 t1, float t2, float t) |
Linear interpolation function for a floating point. | |
csVector3 | lerpVec (const csVector3 &v1, const csVector3 &v2, float t1, float t2, float t) |
Linear interpolation function for a 3D vector. | |
Protected Attributes | |
float | animLength |
The amount of time this anchor has been alive (gets reset on loop). | |
size_t | currKeyFrame |
int | dir |
What type of direction does this movable have. | |
csRef< iEngine > | engine |
Reference to CS's iEngine. | |
bool | isReady |
csRef < psEffectAnchorKeyFrameGroup > | keyFrames |
The next keyframe the anchor will be on. | |
float | life |
A unique name identifying this anchor. | |
csMatrix3 | matBase |
The length of each loop of this anchor. | |
csRef< iMeshWrapper > | mesh |
The mesh that makes up this anchor. | |
csString | name |
size_t | nextKeyFrame |
The current keyframe the anchor is on. | |
csVector3 | objBasePos |
Base pos for the effect anchor, this is used for things like the variable offset from the anchoring mesh. | |
csVector3 | objEffectPos |
The base transform matrix of this anchor. | |
csVector3 | objOffset |
The complete offset, this gets modified by the position action, generally. | |
csVector3 | objTargetOffset |
Stores the delta to the effect target. | |
csMatrix3 | posTransf |
bool | rotateWithMesh |
Whether the anchor should rotate with the mesh. This is so effects can stay aligned, e.g. flame sword. | |
csVector3 | target |
Stores the target of the effect. | |
csMatrix3 | targetTransf |
Effect anchors provide a base location / anchor point for all effect objs.
Definition at line 191 of file pseffectanchor.h.
Definition at line 385 of file pseffectanchor.h.
psEffectAnchor::psEffectAnchor | ( | ) |
virtual psEffectAnchor::~psEffectAnchor | ( | ) | [virtual] |
size_t psEffectAnchor::AddKeyFrame | ( | float | time | ) |
Creates a new keyframe and attaches it to this movable.
time | The time of this new keyFrame. |
virtual psEffectAnchor* psEffectAnchor::Clone | ( | ) | const [virtual] |
Clones the effect anchor.
This will almost always be overloaded.
Reimplemented in psEffectAnchorBasic, psEffectAnchorSocket, and psEffectAnchorSpline.
void psEffectAnchor::CloneBase | ( | psEffectAnchor * | newAnchor | ) | const |
Convenience function to clone the base member variables.
newAnchor | reference to the new anchor that will contain the cloned variables |
virtual bool psEffectAnchor::Create | ( | const csVector3 & | offset, |
iMeshWrapper * | posAttach, | ||
bool | rotateWithMesh = false |
||
) | [virtual] |
Creates the effect anchor.
offset | the offset of the position of the obj. |
posAttach | the mesh to attach this anchor to. |
rotateWithMesh | Rotate the anchor with the mesh. |
Reimplemented in psEffectAnchorBasic, psEffectAnchorSocket, and psEffectAnchorSpline.
void psEffectAnchor::FillInLerps | ( | ) |
Interpolates keyFrame actions for ones that weren't specified in each keyframe.
size_t psEffectAnchor::FindKeyFrameByTime | ( | float | time | ) | const [protected] |
Finds the index of the keyFrame at the specified time.
time | The time to lookup. |
bool psEffectAnchor::FindNextKeyFrameWithAction | ( | size_t | startFrame, |
size_t | action, | ||
size_t & | index | ||
) | const [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. |
float psEffectAnchor::GetAnimGetSize | ( | ) | [inline] |
Gets the animation length of the effect anchor.
Definition at line 362 of file pseffectanchor.h.
const char* psEffectAnchor::GetDirectionType | ( | ) | const |
Gets the direction type of this anchor.
psEffectAnchorKeyFrame* psEffectAnchor::GetKeyFrame | ( | size_t | idx | ) | const [inline] |
Returns the keyframe at the given index.
idx | The index of the keyframe to grab. |
Definition at line 328 of file pseffectanchor.h.
size_t psEffectAnchor::GetKeyFrameCount | ( | ) | const [inline] |
Returns the number of keyframes in this anchor.
Definition at line 317 of file pseffectanchor.h.
iMeshWrapper* psEffectAnchor::GetMesh | ( | ) | const [inline] |
Returns the mesh that's associated with this effect anchor (almost always a nullmesh).
Definition at line 290 of file pseffectanchor.h.
const csString& psEffectAnchor::GetName | ( | ) | const [inline] |
Returns the name of this effect anchor.
Definition at line 270 of file pseffectanchor.h.
bool psEffectAnchor::IsReady | ( | ) | const [inline] |
Check to see if this anchor is ready.
Definition at line 380 of file pseffectanchor.h.
Linear interpolation function for a floating point.
Definition at line 468 of file pseffectanchor.h.
csVector3 psEffectAnchor::lerpVec | ( | const csVector3 & | v1, |
const csVector3 & | v2, | ||
float | t1, | ||
float | t2, | ||
float | t | ||
) | [inline, protected] |
Linear interpolation function for a 3D vector.
Definition at line 477 of file pseffectanchor.h.
virtual bool psEffectAnchor::Load | ( | iDocumentNode * | node | ) | [virtual] |
Loads the effect anchors from an xml node.
node | the xml node containing the effect anchor, must be valid. |
Reimplemented in psEffectAnchorBasic, psEffectAnchorSocket, and psEffectAnchorSpline.
void psEffectAnchor::SetAnimLength | ( | float | newAnimLength | ) | [inline] |
Sets the animation length of the effect anchor.
newAnimLength | the new animation length. |
Definition at line 352 of file pseffectanchor.h.
void psEffectAnchor::SetDirectionType | ( | const char * | newDir | ) |
Sets the direction type of this anchor.
newDir | the new direction type (none, origin, target). |
void psEffectAnchor::SetName | ( | const csString & | newName | ) | [inline] |
Sets the name of this effect anchor.
newName | The new name of the anchor. |
Definition at line 280 of file pseffectanchor.h.
virtual void psEffectAnchor::SetPosition | ( | const csVector3 & | basePos, |
iSectorList * | sectors, | ||
const csMatrix3 & | transf | ||
) | [virtual] |
Sets a new position for the effect anchor.
basePos | The new position of the anchor. |
sectors | The new sectors of the anchor. |
transf | The transform of the position. |
Reimplemented in psEffectAnchorSocket.
virtual void psEffectAnchor::SetPosition | ( | const csVector3 & | basePos, |
iSector * | sector, | ||
const csMatrix3 & | transf | ||
) | [virtual] |
Sets a new position for the effect anchor.
basePos | The new position of the anchor. |
sector | The new sector of the anchor |
transf | The transform of the position. |
Reimplemented in psEffectAnchorSocket.
virtual void psEffectAnchor::SetRotBase | ( | const csMatrix3 & | newRotBase | ) | [inline, virtual] |
Sets the base rotation matrix of the effect anchor.
newRotBase | The base rotation matrix. |
Reimplemented in psEffectAnchorSocket.
Definition at line 300 of file pseffectanchor.h.
void psEffectAnchor::SetTarget | ( | const csVector3 & | newTarget, |
const csMatrix3 & | transf | ||
) | [inline] |
Sets the target of the effect anchor.
newTarget | The new target. |
transf | The transform of the target. |
Definition at line 259 of file pseffectanchor.h.
void psEffectAnchor::TransformOffset | ( | csVector3 & | offset | ) |
Transforms the offset according to the mesh's settings, like abs_dir, etc.
offset | the vector to be transformed. |
virtual bool psEffectAnchor::Update | ( | csTicks | elapsed | ) | [virtual] |
Updates the effect anchor -- called every frame.
elapsed | the ticks elapsed since last update. |
Reimplemented in psEffectAnchorBasic, psEffectAnchorSocket, and psEffectAnchorSpline.
float psEffectAnchor::animLength [protected] |
The amount of time this anchor has been alive (gets reset on loop).
Definition at line 422 of file pseffectanchor.h.
size_t psEffectAnchor::currKeyFrame [protected] |
Definition at line 456 of file pseffectanchor.h.
int psEffectAnchor::dir [protected] |
What type of direction does this movable have.
Definition at line 451 of file pseffectanchor.h.
csRef<iEngine> psEffectAnchor::engine [protected] |
Reference to CS's iEngine.
Definition at line 463 of file pseffectanchor.h.
bool psEffectAnchor::isReady [protected] |
Definition at line 465 of file pseffectanchor.h.
csRef<psEffectAnchorKeyFrameGroup> psEffectAnchor::keyFrames [protected] |
The next keyframe the anchor will be on.
Stores the keyframes of this anchor (this is shared between all anchor of this type).
Definition at line 460 of file pseffectanchor.h.
float psEffectAnchor::life [protected] |
A unique name identifying this anchor.
Definition at line 421 of file pseffectanchor.h.
csMatrix3 psEffectAnchor::matBase [protected] |
The length of each loop of this anchor.
Definition at line 424 of file pseffectanchor.h.
csRef<iMeshWrapper> psEffectAnchor::mesh [protected] |
The mesh that makes up this anchor.
Definition at line 448 of file pseffectanchor.h.
csString psEffectAnchor::name [protected] |
Definition at line 419 of file pseffectanchor.h.
size_t psEffectAnchor::nextKeyFrame [protected] |
The current keyframe the anchor is on.
Definition at line 457 of file pseffectanchor.h.
csVector3 psEffectAnchor::objBasePos [protected] |
Base pos for the effect anchor, this is used for things like the variable offset from the anchoring mesh.
Definition at line 434 of file pseffectanchor.h.
csVector3 psEffectAnchor::objEffectPos [protected] |
The base transform matrix of this anchor.
objEffectPos is pretty much the position of the effect, (that's not a requirement though). It's the only position vector that can be modified externally (by the effect after creation) and this one shouldn't be modified by the effect anchor in any way.
Definition at line 431 of file pseffectanchor.h.
csVector3 psEffectAnchor::objOffset [protected] |
The complete offset, this gets modified by the position action, generally.
Definition at line 440 of file pseffectanchor.h.
csVector3 psEffectAnchor::objTargetOffset [protected] |
Stores the delta to the effect target.
Definition at line 437 of file pseffectanchor.h.
csMatrix3 psEffectAnchor::posTransf [protected] |
Definition at line 441 of file pseffectanchor.h.
bool psEffectAnchor::rotateWithMesh [protected] |
Whether the anchor should rotate with the mesh. This is so effects can stay aligned, e.g. flame sword.
Definition at line 454 of file pseffectanchor.h.
csVector3 psEffectAnchor::target [protected] |
Stores the target of the effect.
Definition at line 444 of file pseffectanchor.h.
csMatrix3 psEffectAnchor::targetTransf [protected] |
Definition at line 445 of file pseffectanchor.h.