Switched Utils name back. Converted the current debug text over to ImGui.
This commit is contained in:
@@ -1,7 +1,7 @@
|
||||
#pragma once
|
||||
#include <SFML/System/Vector3.hpp>
|
||||
#include <SFML/System/Vector2.hpp>
|
||||
#include "util.cpp"
|
||||
#include "util.hpp"
|
||||
#include "Pub_Sub.h"
|
||||
|
||||
class Camera : public VrEventSubscriber{
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
#pragma once
|
||||
#include <string>
|
||||
#include <util.cpp>
|
||||
#include <util.hpp>
|
||||
#include <cstring>
|
||||
|
||||
#ifdef _WIN32
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
#pragma once
|
||||
#include <SFML/System/Vector3.hpp>
|
||||
#include <SFML/System/Vector2.hpp>
|
||||
#include "util.cpp"
|
||||
#include "util.hpp"
|
||||
#include "Pub_Sub.h"
|
||||
#include "raycaster/RayCaster.h"
|
||||
#include <list>
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
#pragma once
|
||||
#include <SFML/Graphics.hpp>
|
||||
#include <util.cpp>
|
||||
#include <util.hpp>
|
||||
#include <memory>
|
||||
#include "Pub_Sub.h"
|
||||
|
||||
|
||||
@@ -8,7 +8,7 @@
|
||||
#include <iostream>
|
||||
#include <functional>
|
||||
#include <cmath>
|
||||
#include "util.cpp"
|
||||
#include "util.hpp"
|
||||
#include <deque>
|
||||
#include <unordered_map>
|
||||
#include <bitset>
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
#include <iostream>
|
||||
#include <SFML/System/Vector3.hpp>
|
||||
#include <SFML/System/Vector2.hpp>
|
||||
#include "util.cpp"
|
||||
#include "util.hpp"
|
||||
#include <Old_Map.h>
|
||||
#include <algorithm>
|
||||
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
#include <iostream>
|
||||
#include "Map.h"
|
||||
#include <Ray.h>
|
||||
#include "util.cpp"
|
||||
#include "util.hpp"
|
||||
|
||||
Ray::Ray(
|
||||
Map *map,
|
||||
|
||||
42
src/main.cpp
42
src/main.cpp
@@ -23,7 +23,7 @@
|
||||
#endif
|
||||
|
||||
#pragma once
|
||||
#include "util.cpp"
|
||||
#include "util.hpp"
|
||||
#include <iostream>
|
||||
#include <chrono>
|
||||
#include <SFML/Graphics.hpp>
|
||||
@@ -104,6 +104,7 @@ int main() {
|
||||
sf::RenderWindow window(sf::VideoMode(WINDOW_X, WINDOW_Y), "SFML");
|
||||
window.setMouseCursorVisible(false);
|
||||
window.setKeyRepeatEnabled(false);
|
||||
window.setFramerateLimit(60);
|
||||
|
||||
ImGui::SFML::Init(window);
|
||||
window.resetGLStates();
|
||||
@@ -168,14 +169,6 @@ int main() {
|
||||
|
||||
// ========== DEBUG ==========
|
||||
fps_counter fps;
|
||||
fps.set_position(sf::Vector2f(WINDOW_X - 200, WINDOW_Y - 100));
|
||||
|
||||
sf::Vector2f *dp = camera->get_direction_pointer();
|
||||
debug_text cam_text_x(1, 30, &dp->x, "incli: ");
|
||||
debug_text cam_text_y(2, 30, &dp->y, "asmth: ");
|
||||
debug_text cam_text_pos_x(3, 30, &camera->get_position_pointer()->x, "x: ");
|
||||
debug_text cam_text_pos_y(4, 30, &camera->get_position_pointer()->y, "y: ");
|
||||
debug_text cam_text_pos_z(5, 30, &camera->get_position_pointer()->z, "z: ");
|
||||
// ===========================
|
||||
|
||||
Input input_handler;
|
||||
@@ -246,23 +239,40 @@ int main() {
|
||||
// Run the raycast
|
||||
raycaster->compute();
|
||||
|
||||
|
||||
window.clear(sf::Color::Black);
|
||||
|
||||
raycaster->draw(&window);
|
||||
|
||||
// Give the frame counter the frame time and draw the average frame time
|
||||
fps.frame(delta_time);
|
||||
fps.draw();
|
||||
|
||||
cam_text_x.draw(&window);
|
||||
cam_text_y.draw(&window);
|
||||
ImGui::Begin("Camera");
|
||||
|
||||
cam_text_pos_x.draw(&window);
|
||||
cam_text_pos_y.draw(&window);
|
||||
cam_text_pos_z.draw(&window);
|
||||
ImGui::Columns(2);
|
||||
|
||||
ImGui::Text("Camera Inclination");
|
||||
ImGui::Text("Camera Azimuth");
|
||||
ImGui::Text("Camera Pos_X");
|
||||
ImGui::Text("Camera Poz_Y");
|
||||
ImGui::Text("Camera Poz_Z");
|
||||
|
||||
ImGui::NextColumn();
|
||||
|
||||
sf::Vector2f dir = camera->get_direction();
|
||||
sf::Vector3f pos = camera->get_position();
|
||||
|
||||
ImGui::Text(std::to_string(dir.x).c_str());
|
||||
ImGui::Text(std::to_string(dir.y).c_str());
|
||||
ImGui::Text(std::to_string(pos.x).c_str());
|
||||
ImGui::Text(std::to_string(pos.y).c_str());
|
||||
ImGui::Text(std::to_string(pos.z).c_str());
|
||||
|
||||
ImGui::End();
|
||||
|
||||
ImGui::Render();
|
||||
|
||||
|
||||
window.draw(sf::CircleShape(0));
|
||||
window.display();
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user