x
Yes
No
Do you want to visit DriveHQ English website?
Inicio
Características
Precios
Prueba gratuita
Software cliente
Acerca de nosotros
Servidor de archivos
|
Solución de copias de seguridad
|
Servidor FTP
|
Servidor de correo electrónico
|
Alojamiento web
|
Software cliente
Servidor de archivos
Solución de copia de seguridad
Servidor FTP
Servidor de correo electrónico
Alojamiento web
Software cliente
Character.h - Hosted on DriveHQ Cloud IT Platform
Arriba
Subir
Descargar
Compartir
Publicar
Nueva carpeta
Nuevo archivo
Copiar
Cortar
Eliminar
Pegar
Clasificación
Actualizar
Ruta de la carpeta: \\game3dprogramming\materials\DarkPuzzle\GameEngine\Character.h
Girar
Efecto
Propiedad
Historial
#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
Dirección de la página
Dirección del archivo
Anterior
5/65
Siguiente
Descargar
( 3 KB )
Comments
Total ratings:
0
Average rating:
No clasificado
of 10
Would you like to comment?
Join now
, or
Logon
if you are already a member.