This commit is contained in:
Lendemor 2016-12-07 19:16:10 +01:00
commit f0cd0fbace
2 changed files with 10 additions and 8 deletions

View File

@ -13,8 +13,8 @@ void CameraNode::update()
{
if(action == m_action_move)
moveCamera(diff.x, diff.y);
else if(action == m_action_move)
else if(action == m_action_rotate)
rotateCamera(diff.x, diff.y);
}
zoom(m_input->getDeltaVerticalScroll());
zoom(m_input->getDeltaVerticalScroll()*120.f);
}

View File

@ -46,6 +46,11 @@ public:
b.key = sf::Keyboard::KeyCount + sf::Mouse::Right;
keys.push_back(b);
}
static std::vector<int> getMap()
{
return {ROTATE_CAMERA, MOVE_CAMERA, TOGGLE_CONSOLE};
}
};
class TestGen : public TerrainGenerator
@ -109,7 +114,7 @@ void generateTerrain(SceneTree *scene)
chunk->mesh->setMaterial(mat);
chunk->mesh->initGL();
MeshNode *node = new MeshNode(chunk->mesh);
node->setTransform(glm::translate(glm::mat4(), pos));
node->setTransform(glm::translate(glm::mat4(), pos*8.f));
scene->addObject(terrainContainer, node);
}
}
@ -205,12 +210,9 @@ int main(){
}
Input* input = engine.getInput();
std::vector<int> v = {myKeysMap::TOGGLE_CONSOLE};
input->addContext(Context("default",v));
IKeysMap km = myKeysMap();
input->setKeysMap(km);
input->setKeysMap(myKeysMap());
input->addContext(Context("default", myKeysMap::getMap()));
input->setCurrentContext("default");
input->updateKeyBindings();
engine.start();