Planeshift
psEffectAnchorBasic Class Reference

#include <pseffectanchorbasic.h>

Public Member Functions

psEffectAnchorClone () const
 Clones the effect anchor. More...
 
bool Create (const csVector3 &offset, iMeshWrapper *posAttach, bool rotateWithMesh=false)
 Creates the effect anchor. More...
 
bool Load (iDocumentNode *node)
 Loads the effect anchors from an xml node. More...
 
 psEffectAnchorBasic ()
 
bool Update (csTicks elapsed)
 Updates the effect anchor – called every frame. More...
 
 ~psEffectAnchorBasic ()
 
- Public Member Functions inherited from psEffectAnchor
size_t AddKeyFrame (float time)
 Creates a new keyframe and attaches it to this movable. More...
 
void CloneBase (psEffectAnchor *newAnchor) const
 Convenience function to clone the base member variables. More...
 
void FillInLerps ()
 Interpolates keyFrame actions for ones that weren't specified in each keyframe. More...
 
float GetAnimGetSize ()
 Gets the animation length of the effect anchor. More...
 
const char * GetDirectionType () const
 Gets the direction type of this anchor. More...
 
psEffectAnchorKeyFrameGetKeyFrame (size_t idx) const
 Returns the keyframe at the given index. More...
 
size_t GetKeyFrameCount () const
 Returns the number of keyframes in this anchor. More...
 
iMeshWrapper * GetMesh () const
 Returns the mesh that's associated with this effect anchor (almost always a nullmesh). More...
 
const csString & GetName () const
 Returns the name of this effect anchor. More...
 
bool IsReady () const
 Check to see if this anchor is ready. More...
 
 psEffectAnchor ()
 
void SetAnimLength (float newAnimLength)
 Sets the animation length of the effect anchor. More...
 
void SetDirectionType (const char *newDir)
 Sets the direction type of this anchor. More...
 
void SetName (const csString &newName)
 Sets the name of this effect anchor. More...
 
virtual void SetPosition (const csVector3 &basePos, iSector *sector, const csMatrix3 &transf)
 Sets a new position for the effect anchor. More...
 
virtual void SetPosition (const csVector3 &basePos, iSectorList *sectors, const csMatrix3 &transf)
 Sets a new position for the effect anchor. More...
 
virtual void SetRotBase (const csMatrix3 &newRotBase)
 Sets the base rotation matrix of the effect anchor. More...
 
void SetTarget (const csVector3 &newTarget, const csMatrix3 &transf)
 Sets the target of the effect anchor. More...
 
void TransformOffset (csVector3 &offset)
 Transforms the offset according to the mesh's settings, like abs_dir, etc. More...
 
virtual ~psEffectAnchor ()
 

Additional Inherited Members

- Public Types inherited from psEffectAnchor
enum  DIR_TYPE { DT_NONE = 0, DT_ORIGIN, DT_TARGET, DT_COUNT }
 
- Protected Member Functions inherited from psEffectAnchor
size_t FindKeyFrameByTime (float 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 t1, float t2, float t)
 Linear interpolation function for a floating point. More...
 
csVector3 lerpVec (const csVector3 &v1, const csVector3 &v2, float t1, float t2, float t)
 Linear interpolation function for a 3D vector. More...
 
- Protected Attributes inherited from psEffectAnchor
float animLength
 The amount of time this anchor has been alive (gets reset on loop). More...
 
size_t currKeyFrame
 
int dir
 What type of direction does this movable have. More...
 
csRef< iEngine > engine
 Reference to CS's iEngine. More...
 
bool isReady
 
csRef< psEffectAnchorKeyFrameGroupkeyFrames
 The next keyframe the anchor will be on. More...
 
float life
 A unique name identifying this anchor. More...
 
csMatrix3 matBase
 The length of each loop of this anchor. More...
 
csRef< iMeshWrapper > mesh
 The mesh that makes up this anchor. More...
 
csString name
 
size_t nextKeyFrame
 The current keyframe the anchor is on. More...
 
csVector3 objBasePos
 Base pos for the effect anchor, this is used for things like the variable offset from the anchoring mesh. More...
 
csVector3 objEffectPos
 The base transform matrix of this anchor. More...
 
csVector3 objOffset
 The complete offset, this gets modified by the position action, generally. More...
 
csVector3 objTargetOffset
 Stores the delta to the effect target. More...
 
csMatrix3 posTransf
 
bool rotateWithMesh
 Whether the anchor should rotate with the mesh. This is so effects can stay aligned, e.g. flame sword. More...
 
csVector3 target
 Stores the target of the effect. More...
 
csMatrix3 targetTransf
 

Detailed Description

Definition at line 29 of file pseffectanchorbasic.h.

Constructor & Destructor Documentation

psEffectAnchorBasic::psEffectAnchorBasic ( )
psEffectAnchorBasic::~psEffectAnchorBasic ( )

Member Function Documentation

psEffectAnchor* psEffectAnchorBasic::Clone ( ) const
virtual

Clones the effect anchor.

This will almost always be overloaded.

Reimplemented from psEffectAnchor.

bool psEffectAnchorBasic::Create ( const csVector3 &  offset,
iMeshWrapper *  posAttach,
bool  rotateWithMesh = false 
)
virtual

Creates the effect anchor.

Parameters
offsetthe offset of the position of the obj.
posAttachthe mesh to attach this anchor to.
rotateWithMeshRotate the anchor with the mesh.
Returns
true on success.

Reimplemented from psEffectAnchor.

bool psEffectAnchorBasic::Load ( iDocumentNode *  node)
virtual

Loads the effect anchors from an xml node.

Parameters
nodethe xml node containing the effect anchor, must be valid.
Returns
true on success, false otherwise.

Reimplemented from psEffectAnchor.

bool psEffectAnchorBasic::Update ( csTicks  elapsed)
virtual

Updates the effect anchor – called every frame.

Parameters
elapsedthe ticks elapsed since last update.
Returns
false if the anchor is useless and can be removed by its parent effect.

Reimplemented from psEffectAnchor.


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