#include "glm\glm.hpp"
#include "glm\gtx\transform.hpp"
-#include <glm/gtc/type_ptr.hpp>
+#include "glm\gtc\type_ptr.hpp""
+#include "glm\gtx\rotate_vector.hpp"
using glm::vec3;
using glm::mat4;
//int reset = Events::getAction2();
if (move_x)
- lookat->move(0.03f *move_x * vec3(1.f, 0.f, 0.f));
+ lookat->move(0.03f *move_x * viewPort->rotateDirection(vec3(-1.f, 0.f, 0.f)));
if (move_y)
- lookat->move(0.03f *move_y * vec3(0.f, 0.f, 1.f));
+ lookat->move(0.03f *move_y * viewPort->rotateDirection(vec3(0.f, 0.f, -1.f)));
// XYAchse um den Player
viewPort->rotateView(.3f*Events::getViewX(), .3f*Events::getViewY());
}
+vec3 ViewPort::rotateDirection(const vec3 & direction) const{
+ return glm::rotateY(direction,- view_angle_x / 50);
+}
+
unsigned int ViewPort::getXPos() const
{
return xpos;
void bindView(Shader* shader, vec3 lookat) const;
void rotateView(float angle_x, float angle_y);
+ vec3 rotateDirection(const vec3 & direction) const;
unsigned int getXPos() const;
unsigned int getYPos() const;
void main()
{
- if (visNormal < 0)
+ if (visNormal < -0.2)
{
discard;
}