Adding debug key to print the position.
This commit is contained in:
parent
7b80f34f4f
commit
e06eea7c5d
@ -344,3 +344,8 @@ void Level::setWaterPlane(Object* water) {
|
||||
void Level::setTerrain(Terrain terrain) {
|
||||
this->terrain = terrain;
|
||||
}
|
||||
|
||||
void Level::printPosition() {
|
||||
printf("Player position: %2.2f, %2.2f, %2.2f\n", cameraCenter->getPosition().x,
|
||||
cameraCenter->getPosition().y, cameraCenter->getPosition().z);
|
||||
}
|
||||
|
@ -74,6 +74,7 @@ class Level {
|
||||
void forceMove(float x, float y, float z, unsigned indice);
|
||||
void activateEndgame();
|
||||
void setTerrain(Terrain terrain);
|
||||
void printPosition();
|
||||
private:
|
||||
lua_State* luaState=nullptr;
|
||||
std::vector<Object*> objects;
|
||||
|
@ -36,6 +36,9 @@ static void keyCallback(GLFWwindow* _window, int _key, int, int _action, int)
|
||||
if (_key == GLFW_KEY_F8 && _action == GLFW_PRESS) {
|
||||
app.getGraphics()->setRenderWorld(!app.getGraphics()->getRenderWorld());
|
||||
}
|
||||
if (_key == GLFW_KEY_F9 && _action == GLFW_PRESS) {
|
||||
app.getLevel()->printPosition();
|
||||
}
|
||||
#endif
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user