My Project
Public Member Functions | Static Public Member Functions | List of all members
ParaEngine::CSequenceCtler Class Reference

A sequence controller is a biped controller which moves the biped according to some predefined sequence. More...

#include <SequenceCtler.h>

Inheritance diagram for ParaEngine::CSequenceCtler:
ParaEngine::CBipedController

Public Member Functions

 CSequenceCtler (CAIBase *pAI)
 
virtual void FrameMove (float fDeltaTime)
 a virtual function which is called every frame to process the controller. More...
 
bool Save (bool bOverride)
 
bool Load (int nSequenceID)
 
bool Load (const string &fileName)
 
int Create (const string &name, const string &description, const char *pData, bool bInMemory)
 
string ToString ()
 
int GetKeyPos ()
 Get the current absolute playing cursor position.
 
void SetKeyPos (int nPos)
 set the current absolute playing cursor position
 
int GetTotalKeys ()
 get total key count
 
int AdvanceKey (int nOffset)
 offset the key index according to the current play mode. More...
 
void BeginAddKeys ()
 call the command functions(RunTo, MoveTo, etc) only between the matching pair of BeginAddKeys() and EndAddKeys()
 
void EndAddKeys ()
 call the command functions(RunTo, MoveTo, etc) only between the matching pair of BeginAddKeys() and EndAddKeys()
 
int GetSequenceID ()
 get sequence ID
 
bool DeleteKeysRange (int nFrom, int nTo)
 delete keys range More...
 
bool GetPlayDirection ()
 get the play direction. More...
 
void SetPlayDirection (bool bForward)
 set the play direction. More...
 
float GetInterval ()
 the minimum time between two successive calls. More...
 
void SetInterval (float fInterval)
 the minimum time between two successive calls. More...
 
Vector3 GetStartPos ()
 get the starting position. More...
 
void SetStartPos (const Vector3 &vPos)
 set the starting position. More...
 
float GetStartFacing ()
 get the start facing. More...
 
void SetStartFacing (float facing)
 Set the start facing. More...
 
int GetPlayMode ()
 get the current play mode
 
void SetPlayMode (int mode)
 set the current play mode
 
float GetMovingTimeout ()
 get the number of seconds after which all move commands will be treated as finished. More...
 
void SetMovingTimeout (float fTimeout)
 set the number of seconds after which all move commands will be treated as finished. More...
 
void RunTo (double x, double y, double z)
 run to a position relative to the current position. More...
 
void WalkTo (double x, double y, double z)
 walk to a position relative to the current position. More...
 
void MoveTo (double x, double y, double z)
 move (using the current style i.e. More...
 
void MoveAndTurn (double x, double y, double z, float facing)
 move to a given position and turn to a given facing. More...
 
void PlayAnim (const string &sAnim)
 play an animation by animation name
 
void PlayAnim (int nAnimID)
 play an animation by animation id
 
void Wait (float fSeconds)
 wait the specified seconds, without further processing commands
 
void Exec (const string &sCmd)
 execute a given script command
 
void Pause ()
 pause the sequence infinitely until some one resumes it. More...
 
void Turn (float fAngleAbsolute)
 turn the character to face a given absolute direction in radian value. More...
 
void MoveForward (float fDistance)
 move forward using the current facing a given distance
 
void MoveBack (float fDistance)
 move backward using the current facing a given distance
 
void MoveLeft (float fDistance)
 move left using the current facing a given distance
 
void MoveRight (float fDistance)
 move right using the current facing a given distance
 
void Jump ()
 Jump once.
 
void Goto (int nOffset)
 offset the current sequence commands by a given steps. More...
 
void Goto (const string &sLable)
 offset to a label, if label not found, it will wrap to the beginning. More...
 
void Lable (const string &sLable)
 add a new label at the current position. More...
 
- Public Member Functions inherited from ParaEngine::CBipedController
 CBipedController (CAIBase *pAI)
 
bool IsActive ()
 check whether the controller is active(not suspended). More...
 
virtual void Suspend ()
 suspend the controller, so it does not take effects on the next frame move. More...
 
virtual void Resume ()
 resume the controller. More...
 
virtual void SetTime (float fTime)
 set the internal timer. More...
 
float GetTime ()
 get the current movie time
 
IGameObjectGetClosestBiped (IGameObject *pInput)
 get the biped in the perceived biped list, which is closet to the current biped. More...
 
IGameObjectFindBiped (IGameObject *pInput, const std::string &searchString)
 Find a biped with a matching name. More...
 
CBipedObjectGetBiped ()
 get the biped, to which this biped controller is associated. More...
 
void SetAI (CAIBase *pAI)
 set the AI object to which this object is associated. More...
 

Static Public Member Functions

static void MoveCommand (CBipedObject *pBiped, const DVector3 &vDest, bool bForceRun=false, bool bForceWalk=false, float *pFacing=NULL)
 execute a move command More...
 
static void Stop (CBipedObject *pBiped)
 stop a biped if it is moving. More...
 

Additional Inherited Members

- Protected Attributes inherited from ParaEngine::CBipedController
float m_fTimeElapsed
 total time elapsed since the controller is active(not suspended). More...
 

Detailed Description

A sequence controller is a biped controller which moves the biped according to some predefined sequence.

Member Function Documentation

§ AdvanceKey()

int CSequenceCtler::AdvanceKey ( int  nOffset)

offset the key index according to the current play mode.

i.e. it will automatically wrap to the beginning if looping.

Parameters
nOffsetnumber of keys to advance.
Returns
: the number of keys that have been successfully offseted. Usually if the returned value is not equal to the input value, it means that the sequence should be paused.

§ DeleteKeysRange()

bool CSequenceCtler::DeleteKeysRange ( int  nFrom,
int  nTo 
)

delete keys range

Parameters
nFrom0 based index.
nTo0 based index, if -1, it means the last one.

§ FrameMove()

void CSequenceCtler::FrameMove ( float  fDeltaTime)
virtual

a virtual function which is called every frame to process the controller.

Parameters
fDeltaTimethe time elapsed since the last frame move is called.

Reimplemented from ParaEngine::CBipedController.

§ GetInterval()

float ParaEngine::CSequenceCtler::GetInterval ( )
inline

the minimum time between two successive calls.

§ GetMovingTimeout()

float ParaEngine::CSequenceCtler::GetMovingTimeout ( )
inline

get the number of seconds after which all move commands will be treated as finished.

default value is 30 seconds.

§ GetPlayDirection()

bool ParaEngine::CSequenceCtler::GetPlayDirection ( )
inline

get the play direction.

§ GetStartFacing()

float ParaEngine::CSequenceCtler::GetStartFacing ( )
inline

get the start facing.

usually default to 0.

§ GetStartPos()

Vector3 ParaEngine::CSequenceCtler::GetStartPos ( )
inline

get the starting position.

§ Goto() [1/2]

void CSequenceCtler::Goto ( int  nOffset)

offset the current sequence commands by a given steps.

§ Goto() [2/2]

void CSequenceCtler::Goto ( const string &  sLable)

offset to a label, if label not found, it will wrap to the beginning.

§ Lable()

void CSequenceCtler::Lable ( const string &  sLable)

add a new label at the current position.

§ MoveAndTurn()

void ParaEngine::CSequenceCtler::MoveAndTurn ( double  x,
double  y,
double  z,
float  facing 
)

move to a given position and turn to a given facing.

§ MoveCommand()

void CSequenceCtler::MoveCommand ( CBipedObject pBiped,
const DVector3 vDest,
bool  bForceRun = false,
bool  bForceWalk = false,
float *  pFacing = NULL 
)
static

execute a move command

Parameters
pBipedthe biped to move
vDestrelative position to the current position.
bForceRunforce using running animation.
bForceWalkforce using walking animation.
pFacingif it is not NULL, we will face the new target, after reaching the position.

§ MoveTo()

void CSequenceCtler::MoveTo ( double  x,
double  y,
double  z 
)

move (using the current style i.e.

walk or run) to a position relative to the current position.

§ Pause()

void CSequenceCtler::Pause ( )

pause the sequence infinitely until some one resumes it.

§ RunTo()

void CSequenceCtler::RunTo ( double  x,
double  y,
double  z 
)

run to a position relative to the current position.

§ SetInterval()

void ParaEngine::CSequenceCtler::SetInterval ( float  fInterval)
inline

the minimum time between two successive calls.

§ SetMovingTimeout()

void ParaEngine::CSequenceCtler::SetMovingTimeout ( float  fTimeout)
inline

set the number of seconds after which all move commands will be treated as finished.

default value is 30 seconds.

§ SetPlayDirection()

void ParaEngine::CSequenceCtler::SetPlayDirection ( bool  bForward)
inline

set the play direction.

§ SetStartFacing()

void ParaEngine::CSequenceCtler::SetStartFacing ( float  facing)
inline

Set the start facing.

usually default to 0.

§ SetStartPos()

void ParaEngine::CSequenceCtler::SetStartPos ( const Vector3 vPos)
inline

set the starting position.

§ Stop()

void CSequenceCtler::Stop ( CBipedObject pBiped)
static

stop a biped if it is moving.

Parameters
pBipedthe biped to stop

§ Turn()

void CSequenceCtler::Turn ( float  fAngleAbsolute)

turn the character to face a given absolute direction in radian value.

§ WalkTo()

void CSequenceCtler::WalkTo ( double  x,
double  y,
double  z 
)

walk to a position relative to the current position.


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