x
Yes
No
Do you want to visit DriveHQ English website?
首页
产品服务
价格
免费试用
下载客户端
关于我们
云文件服务
|
云备份服务
|
FTP服务
|
企业邮箱服务
|
网站托管
|
客户端软件
云文件服务
云备份服务
FTP服务
企业级邮箱服务
网站托管
客户端软件
Character.h - Hosted on DriveHQ Cloud IT Platform
返回上层目录
上传
下载
共享
发布
新建文件夹
新建文件
复制
剪切
删除
粘贴
评论
升级服务
路径: \\game3dprogramming\materials\DarkPuzzle\GameEngine\Character.h
旋转
特效
属性
历史版本
#pragma once #include "Game3DInstance.h" #include "Light.h" #include "Map.h" #include "DataTypes.h" namespace DarkBattle{ /* #define CHARACTER_MOVEUP 0 #define CHARACTER_MOVEDOWN 1 #define CHARACTER_MOVELEFT 2 #define CHARACTER_MOVERIGHT 3*/ //typedef float float3[3];//tolua_export class Light; class Character: public Game3DInstance{//tolua_export private: float hitPoint; Light* light; byte type; static Character* theHero; //path finding data Vec2Queue wayPoints; Vec3Queue smoothWP; DistanceMap distanceMap; CloseList closeList; OpenListPriority openList; //action evaluation data Matrix
isCovered; Vec2Queue visitedPos; char* name; static MyHashTable
pool; bool isMoving; Vec2 bestSoFar;//use in all evaluate step bool bestCovered; int bestDistance; bool found; Vec3 evaluatedPos; //use in all action evaluation bool evaluatedThisFrame; Vec2 curPathPos;//use in MakePathStep Vec3 smoothRefPos, smoothPrePos; //use in MakeSmoothPath bool forceStop; public: enum Direction{UP,DOWN,LEFT,RIGHT}; Character(Game3DObject* pObjectResource, btRigidBody* pRigidBody, const char* name); static Character* Add(char* modelName, const char* name);//tolua_export static Character* Get(char* name);//tolua_export #define CHARACTER_NOTCHARACTER -1 #define CHARACTER_TYPES 2 #define CHARACTER_HERO 0 #define CHARACTER_SOLDIER 1 static const char* characterNames[CHARACTER_TYPES]; static int identifyCharacterType(const char* name); void MoveTo(Vec3 pos);//tolua_export void SetPos(Vec3 pos);//tolua_export Vec3 GetPos();//tolua_export bool IsAt(Vec3 pos);//tolua_export btVector3 GetCenter(); void Move(Direction direction); void Stop();//tolua_export inline bool IsWayPointEmpty(){return smoothWP.IsEmpty();};//tolua_export inline Vec3 WayPointPop(){return smoothWP.Pop();};//tolua_export //step functions void InitComputeDistanceMap();//tolua_export void InitComputeDistanceMapBreath();//tolua_export bool ComputeDistanceMapStep(Vec3 to);//tolua_export bool ComputeDistanceMapBreathStep();//tolua_export void InitMakePath(Vec3 to);//tolua_export bool MakePathStep();//tolua_export void InitMakeSmoothPath(Vec3 to);//tolua_export bool MakeSmoothPathStep(Vec3 to);//tolua_export bool InitEvaluateEvadeStep();//tolua_export bool EvaluateEvadeStep();//tolua_export inline Vec3 GetEvaluatedPos(){return evaluatedPos;};//tolua_export inline bool IsEvaluateSuccess(){return found;};//tolua_export void MakePath(Vec3 to);//must not export void MakeSmoothPath(Vec3 to);//must not export void ThinkStep(); static bool IsCovered(const Vec3 &from, const Vec3 &to);//tolua_export static Character* GetHero();//tolua_export static void SetHero(Character* hero);//tolua_export void Jump(); void FrameMove(float elapsedTime); static bool CheckNameBelongToThisClass(const char* name); void FireToHero();//tolua_export inline Vec2Queue& GetWayPoints(){return wayPoints;}; inline DistanceMap& GetDistanceMap(){return distanceMap;}; inline char* GetName(){return name;}//tolua_export inline static MyHashTable
& GetPool(){return pool;}; //tolua_begin static float FireRange; static float FireHeight; static int EvaluateRange; static int WayPointQueueLength; //tolua_end };//tolua_export }
Character.h
网页地址
文件地址
上一页
5/65
下一页
下载
( 3 KB )
Comments
Total ratings:
0
Average rating:
无评论
of 10
Would you like to comment?
Join now
, or
Logon
if you are already a member.