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
DebugFuncs.cpp - 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\DebugFuncs.cpp
Girar
Efecto
Propiedad
Historial
#include "DarkPuzzle.h" #include "DebugFuncs.h" #include "Character.h" #include "Map.h" #include "ScriptEngine.h" //#ifdef _DEBUG //Input functions //void InputMouseMove();//tolua_export //void InputMouseCamera();//tolua_export //void InputKeyboardMove();//tolua_export //void InputKeyboardCamera();//tolua_export //#define level GameLevel::GetInstance() inline Character* hero(){return Character::GetHero();} inline Map* map(){return GameLevel::GetInstance()->GetMap();} inline ScriptEngine* script(){return ScriptEngine::GetInstance();}; //#define hero Character::GetHero() //#define map GameLevel::GetInstance()->GetMap() void MouseHitMove(GameLevel* level){ if (level->IsMouseHit()){ Character::GetHero()->MoveTo(level->GetMouseHitPos()); } } void MouseHitDraw(GameLevel* level){ if (level->IsMouseHit()){ level->DrawDebugLineDelta(level->GetMouseHitPos(),level->GetMouseHitNorm()*20); } } void DrawDistanceMap(Character* character){ DistanceMap distanceMap = character->GetDistanceMap(); for (int x=0;x
SizeX();x++) for (int y=0;y
SizeY();y++){ if (distanceMap.get(x,y)!=Map::InfiniteDistance){ GameLevel::GetInstance()->DrawDebugLineDelta(map()->GetPosition(x,y),Vec3(0,0,distanceMap.get(x,y))); } } } void DrawWayPoints(Character* character){ Vec2Queue wayPoints = character->GetWayPoints(); while (!wayPoints.IsEmpty()){ Vec2 wp = wayPoints.Pop(); GameLevel::GetInstance()->DrawDebugLineDelta(map()->GetPosition(wp.x,wp.y),Vec3(0,0,30),Vec3(0,1,0)); } } void MouseFindPath(GameLevel* level){ if(level->IsMouseHit()){ hero()->MakePath(level->GetMouseHitPos()); DrawWayPoints(hero()); //DrawDistanceMap(hero()); } } void MouseFindPathSmooth(GameLevel* level){ if(level->IsMouseHit()){ //if (!hero()->IsWayPointEmpty()) return; //Vec2Queue wayPoints; //DistanceMap dmap(map()->SizeX(),map()->SizeY()); //OpenListPriority openList; //CloseList closeList(map()->SizeX(),map()->SizeY()); //bool found = level->GetMap()->MakePath(hero()->GetPos(), // level->GetMouseHitPos(),wayPoints,dmap,openList,closeList); //if (!found) return; //Vec3Queue wpSmooth; //map()->MakeSmoothPathStep(hero()->GetPos(),level->GetMouseHitPos(),wayPoints,wpSmooth); //Vec3 wp; //while(!wpSmooth.IsEmpty()){ // wp = wpSmooth.Pop(); // level->DrawDebugLineDelta(wp,Vec3(0,0,10)); //} } } void MouseMoveWayPoint(GameLevel* level){ if (level->IsMouseHit()){ hero()->MakeSmoothPath(level->GetMouseHitPos()); } } void DrawMapConnection(GameLevel* level){ for (int x=0;x
SizeX()-1;x++) for (int y=0;y
SizeY();y++){ if (!map()->IsConnectX(x,y)){ level->DrawDebugLine(map()->GetPosition(x,y),map()->GetPosition(x+1,y)); } } for (int x=0;x
SizeX();x++) for (int y=0;y
SizeY()-1;y++){ if (!map()->IsConnectY(x,y)){ level->DrawDebugLine(map()->GetPosition(x,y),map()->GetPosition(x,y+1)); } } } //#endif // _DEBUG
DebugFuncs.cpp
Dirección de la página
Dirección del archivo
Anterior
17/65
Siguiente
Descargar
( 2 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.