Procházet zdrojové kódy

fixed camera movement bug

testing
Michael Porter před 5 roky
rodič
revize
8fba882f71
  1. 2
      include/inputhandler.h
  2. 2
      res/config.conf
  3. 2
      src/inputhandler.cpp
  4. 6
      src/scenes/testscene.cpp

2
include/inputhandler.h

@ -44,6 +44,8 @@ protected: @@ -44,6 +44,8 @@ protected:
Uint32 mouseButtons;
const Uint8* keys;
SDL_Event event;
Sint32 mMouseXRel;
Sint32 mMouseYRel;
};
}

2
res/config.conf

@ -11,7 +11,7 @@ graphics { @@ -11,7 +11,7 @@ graphics {
controls {
mouse {
sensitivity = 8
sensitivity = 2
}
bindings {
movement {

2
src/inputhandler.cpp

@ -17,7 +17,7 @@ @@ -17,7 +17,7 @@
*/
#include "inputhandler.h"
#include <iostream>
namespace vtk {
void InputHandler::update() {

6
src/scenes/testscene.cpp

@ -133,9 +133,9 @@ void TestScene::init() { @@ -133,9 +133,9 @@ void TestScene::init() {
std::cout << std::endl;
int chunkCount = 1;
for (int i = 0; i < 16; i++) {
for (int i = 0; i < 8; i++) {
for (int j = 0; j < 8; j++) {
for (int k = 0; k < 16; k++) {
for (int k = 0; k < 8; k++) {
std::cout << "\rGenerating chunks (" << chunkCount << "/" << 8*8*8 << ")" << std::flush;
world.generateChunk(i,j,k);
chunkCount++;
@ -223,7 +223,7 @@ void TestScene::draw() { @@ -223,7 +223,7 @@ void TestScene::draw() {
void TestScene::look() {
int x, y; //mouse change
SDL_GetRelativeMouseState(&x, &y);
camera.rotate((float)x * dTime * sensitivity * 0.01f, (float)y * dTime * sensitivity * 0.01f);
camera.rotate((float)x * sensitivity * 0.001f, (float)y * sensitivity * 0.001f);
//camera.rotate((float)x, (float)y);
}

Načítá se…
Zrušit
Uložit