added light controls
This commit is contained in:
29
src/main.cpp
29
src/main.cpp
@@ -40,9 +40,9 @@ const int WINDOW_X = 1000;
|
||||
const int WINDOW_Y = 1000;
|
||||
const int WORK_SIZE = WINDOW_X * WINDOW_Y;
|
||||
|
||||
const int MAP_X = 128;
|
||||
const int MAP_Y = 128;
|
||||
const int MAP_Z = 128;
|
||||
const int MAP_X = 256;
|
||||
const int MAP_Y = 256;
|
||||
const int MAP_Z = 256;
|
||||
|
||||
float elap_time(){
|
||||
static std::chrono::time_point<std::chrono::system_clock> start;
|
||||
@@ -186,12 +186,33 @@ int main() {
|
||||
//if (sf::Keyboard::isKeyPressed(sf::Keyboard::Dash)) {
|
||||
// raycaster->test_edit_viewport(WINDOW_X, WINDOW_Y, w -= 5, h -= 5);
|
||||
//}
|
||||
if (sf::Keyboard::isKeyPressed(sf::Keyboard::Left)) {
|
||||
light_vec.at(0).position.x -= delta_time * 10;
|
||||
}
|
||||
if (sf::Keyboard::isKeyPressed(sf::Keyboard::Right)) {
|
||||
light_vec.at(0).position.x += delta_time * 10;
|
||||
}
|
||||
if (sf::Keyboard::isKeyPressed(sf::Keyboard::Up)) {
|
||||
light_vec.at(0).position.y += delta_time * 10;
|
||||
}
|
||||
if (sf::Keyboard::isKeyPressed(sf::Keyboard::Down)) {
|
||||
light_vec.at(0).position.y -= delta_time * 10;
|
||||
}
|
||||
if (sf::Keyboard::isKeyPressed(sf::Keyboard::Home)) {
|
||||
light_vec.at(0).position.z += delta_time * 10;
|
||||
}
|
||||
if (sf::Keyboard::isKeyPressed(sf::Keyboard::End)) {
|
||||
light_vec.at(0).position.z -= delta_time * 10;
|
||||
}
|
||||
|
||||
|
||||
|
||||
if (sf::Keyboard::isKeyPressed(sf::Keyboard::LAlt)) {
|
||||
light_vec.at(0).position = camera->get_position();
|
||||
light_vec.at(0).direction_cartesian = SphereToCart(camera->get_direction());
|
||||
}
|
||||
if (sf::Keyboard::isKeyPressed(sf::Keyboard::O)) {
|
||||
light_vec.at(0).orbit_around_center(timer_accumulator += delta_time);
|
||||
light_vec.at(0).orbit_around_center(fmod(timer_accumulator += delta_time, 3));
|
||||
}
|
||||
|
||||
if (sf::Keyboard::isKeyPressed(sf::Keyboard::M)) {
|
||||
|
||||
Reference in New Issue
Block a user