My Project
BipedController.h
1 #pragma once
2 #include "KeyFrame.h"
3 
4 namespace ParaEngine
5 {
6  /* forward declarition */
7  class CAIBase;
8  class CBaseObject;
9  class CBipedObject;
10  class IGameObject;
11 
19  {
20  public:
22  CBipedController(void);
23  virtual ~CBipedController(void);
24  private:
26  bool m_bSuspended;
28  CAIBase* m_pAI;
29 
30  protected:
33 
34  public:
36  bool IsActive();
38  virtual void Suspend();
40  virtual void Resume();
42  virtual void SetTime(float fTime);
44  float GetTime();
49 
54  IGameObject* FindBiped(IGameObject* pInput, const std::string& searchString);
55 
59  void SetAI(CAIBase* pAI);
60 
64  virtual void FrameMove(float fDeltaTime);
65  };
66 
71  {
72  public:
73  CFollowCtrler(void);
74  CFollowCtrler(CAIBase* pAI);
75  virtual ~CFollowCtrler(void);
76  private:
78  std::string m_sFollowTarget;
80  float m_fRadius;
83  float m_fAngleShift;
84  public:
85  /*
86  * Follow a biped at a specified circle position.
87  * @param obj: format "sName radius angle" | "sName"
88  * sName: it is the name of the biped to follow,
89  * radius: [optional, default to 2.5f] it is the default radius around the target biped. it will control the biped to try it best to stand on this circle.
90  * angle: [optional, default to Pi] it will control the biped to stand beside the target with the target facing shifted by this value.
91  * note that +-Pi means behind the biped.
92  * e.g. "lixizhi", "lixizhi 2.5 3.14", "lixizhi 3.0 0", "lixizhi 3.0 1.57", "lixizhi 3.0 -1.57"
93  */
94  void SetFollowTarget(const std::string& obj);
95  const std::string& GetFollowTarget();
96 
101  virtual void FrameMove(float fDeltaTime);
102  };
103 }
float m_fTimeElapsed
total time elapsed since the controller is active(not suspended).
Definition: BipedController.h:32
Definition: combase.h:159
different physics engine has different winding order.
Definition: EventBinding.h:32
void SetAI(CAIBase *pAI)
set the AI object to which this object is associated.
Definition: BipedController.cpp:73
float GetTime()
get the current movie time
Definition: BipedController.cpp:60
virtual void FrameMove(float fDeltaTime)
a virtual function which is called every frame to process the controller.
Definition: BipedController.cpp:119
virtual void Suspend()
suspend the controller, so it does not take effects on the next frame move.
Definition: BipedController.cpp:47
IGameObject * FindBiped(IGameObject *pInput, const std::string &searchString)
Find a biped with a matching name.
Definition: BipedController.cpp:102
this is an interface class for game objects, such as NPC, OPC and players.
Definition: IGameObject.h:15
Base Interface for Biped controller.
Definition: BipedController.h:18
bool IsActive()
check whether the controller is active(not suspended).
Definition: BipedController.cpp:43
CBipedObject * GetBiped()
get the biped, to which this biped controller is associated.
Definition: BipedController.cpp:65
virtual void SetTime(float fTime)
set the internal timer.
Definition: BipedController.cpp:55
base class for all AI objects
Definition: AIBase.h:9
virtual void Resume()
resume the controller.
Definition: BipedController.cpp:51
a follow controller it will follow a given target or another biped.
Definition: BipedController.h:70
IGameObject * GetClosestBiped(IGameObject *pInput)
get the biped in the perceived biped list, which is closet to the current biped.
Definition: BipedController.cpp:78
It can be used to represent biped object(like human, re spawning monsters) in the scene without inher...
Definition: BipedObject.h:60