Merge branch 'developer' into heightmapTrees
# Conflicts: # CrystalPoint.cpp # HeightMap.cpp
This commit is contained in:
+9
-18
@@ -6,10 +6,14 @@
|
||||
#include "WorldHandler.h"
|
||||
#include "Player.h"
|
||||
|
||||
int CrystalPoint::width = 0;
|
||||
int CrystalPoint::height = 0;
|
||||
|
||||
void CrystalPoint::init()
|
||||
{
|
||||
player = Player::getInstance();
|
||||
worldhandler = WorldHandler::getInstance();
|
||||
//cursor = Cursor::getInstance();
|
||||
|
||||
lastFrameTime = 0;
|
||||
|
||||
@@ -34,23 +38,8 @@ void CrystalPoint::draw()
|
||||
glLoadIdentity();
|
||||
|
||||
worldhandler->draw();
|
||||
|
||||
//Draw Cursor
|
||||
glMatrixMode(GL_PROJECTION);
|
||||
glLoadIdentity();
|
||||
glOrtho(0,width, height,0,-10,10);
|
||||
glMatrixMode(GL_MODELVIEW);
|
||||
glLoadIdentity();
|
||||
|
||||
glDisable(GL_LIGHTING);
|
||||
glDisable(GL_DEPTH_TEST);
|
||||
glColor4f(1, cos(glutGet(GLUT_ELAPSED_TIME) / 1000.0f), sin(glutGet(GLUT_ELAPSED_TIME) / 1000.0f), 1);
|
||||
|
||||
glBegin(GL_TRIANGLES);
|
||||
glVertex2f(mousePosition.x, mousePosition.y);
|
||||
glVertex2f(mousePosition.x+15, mousePosition.y+15);
|
||||
glVertex2f(mousePosition.x+5, mousePosition.y+20);
|
||||
glEnd();
|
||||
//cursor->draw();
|
||||
|
||||
glutSwapBuffers();
|
||||
}
|
||||
@@ -78,7 +67,7 @@ void CrystalPoint::update()
|
||||
if (player->rotation.x < -90)
|
||||
player->rotation.x = -90;
|
||||
|
||||
float speed = 2;
|
||||
float speed = 1;
|
||||
|
||||
Vec3f oldPosition = player->position;
|
||||
if (keyboardState.keys['a']) player->setPosition(0, deltaTime*speed, false);
|
||||
@@ -91,11 +80,13 @@ void CrystalPoint::update()
|
||||
if (!worldhandler->isPlayerPositionValid())
|
||||
player->position = oldPosition;
|
||||
|
||||
player->position.y = worldhandler->getHeight(player->position.x, player->position.z) + 2.5f;
|
||||
player->position.y = worldhandler->getHeight(player->position.x, player->position.z) + 1.7f;
|
||||
|
||||
|
||||
worldhandler->update(deltaTime);
|
||||
|
||||
mousePosition = mousePosition + mouseOffset;
|
||||
//cursor->update(mousePosition);
|
||||
|
||||
mouseOffset = Vec2f(0, 0);
|
||||
prevKeyboardState = keyboardState;
|
||||
|
||||
Reference in New Issue
Block a user