fixed camera inputs
This commit is contained in:
parent
ef7d2ff0a2
commit
adda0d477b
@ -13,8 +13,8 @@ void CameraNode::update()
|
|||||||
{
|
{
|
||||||
if(action == m_action_move)
|
if(action == m_action_move)
|
||||||
moveCamera(diff.x, diff.y);
|
moveCamera(diff.x, diff.y);
|
||||||
else if(action == m_action_move)
|
else if(action == m_action_rotate)
|
||||||
rotateCamera(diff.x, diff.y);
|
rotateCamera(diff.x, diff.y);
|
||||||
}
|
}
|
||||||
zoom(m_input->getDeltaVerticalScroll());
|
zoom(m_input->getDeltaVerticalScroll()*120.f);
|
||||||
}
|
}
|
||||||
|
@ -46,6 +46,11 @@ public:
|
|||||||
b.key = sf::Keyboard::KeyCount + sf::Mouse::Right;
|
b.key = sf::Keyboard::KeyCount + sf::Mouse::Right;
|
||||||
keys.push_back(b);
|
keys.push_back(b);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static std::vector<int> getMap()
|
||||||
|
{
|
||||||
|
return {ROTATE_CAMERA, MOVE_CAMERA, TOGGLE_CONSOLE};
|
||||||
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
class TestGen : public TerrainGenerator
|
class TestGen : public TerrainGenerator
|
||||||
@ -109,7 +114,7 @@ void generateTerrain(SceneTree *scene)
|
|||||||
chunk->mesh->setMaterial(mat);
|
chunk->mesh->setMaterial(mat);
|
||||||
chunk->mesh->initGL();
|
chunk->mesh->initGL();
|
||||||
MeshNode *node = new MeshNode(chunk->mesh);
|
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);
|
scene->addObject(terrainContainer, node);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -206,12 +211,9 @@ int main(){
|
|||||||
|
|
||||||
|
|
||||||
Input* input = engine.getInput();
|
Input* input = engine.getInput();
|
||||||
std::vector<int> v = {myKeysMap::TOGGLE_CONSOLE};
|
|
||||||
input->addContext(Context("default",v));
|
|
||||||
|
|
||||||
IKeysMap km = myKeysMap();
|
input->setKeysMap(myKeysMap());
|
||||||
|
input->addContext(Context("default", myKeysMap::getMap()));
|
||||||
input->setKeysMap(km);
|
|
||||||
input->setCurrentContext("default");
|
input->setCurrentContext("default");
|
||||||
input->updateKeyBindings();
|
input->updateKeyBindings();
|
||||||
engine.start();
|
engine.start();
|
||||||
|
Loading…
x
Reference in New Issue
Block a user