+ | Going to start object systems

This commit is contained in:
RedShip
2024-12-23 19:47:34 +01:00
parent ffc26d6078
commit e931b496ee
15 changed files with 172 additions and 22 deletions

View File

@ -6,7 +6,7 @@
/* By: ycontre <ycontre@student.42.fr> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2024/09/27 14:52:10 by TheRed #+# #+# */
/* Updated: 2024/10/13 20:52:17 by ycontre ### ########.fr */
/* Updated: 2024/12/23 19:04:53 by ycontre ### ########.fr */
/* */
/* ************************************************************************** */
@ -28,5 +28,8 @@
# include "Camera.hpp"
# include "Window.hpp"
# include "Shader.hpp"
# include "Scene.hpp"
#endif

30
includes/RT/Object.hpp Normal file
View File

@ -0,0 +1,30 @@
/* ************************************************************************** */
/* */
/* ::: :::::::: */
/* Object.hpp :+: :+: :+: */
/* +:+ +:+ +:+ */
/* By: ycontre <ycontre@student.42.fr> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2024/12/23 18:44:18 by ycontre #+# #+# */
/* Updated: 2024/12/23 19:12:39 by ycontre ### ########.fr */
/* */
/* ************************************************************************** */
#ifndef RT_OBJECT__HPP
# define RT_OBJECT__HPP
class Object
{
public:
glm::vec3 position;
glm::vec3 color;
Object(const glm::vec3& pos, const glm::vec3& col) : position(pos), color(col) {}
virtual ~Object() = default;
// virtual bool hit(const glm::vec3& rayOrigin, const glm::vec3& rayDir, float& t, glm::vec3& hitNormal) const = 0;
};
#endif

34
includes/RT/Scene.hpp Normal file
View File

@ -0,0 +1,34 @@
/* ************************************************************************** */
/* */
/* ::: :::::::: */
/* Scene.hpp :+: :+: :+: */
/* +:+ +:+ +:+ */
/* By: ycontre <ycontre@student.42.fr> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2024/12/23 18:30:18 by ycontre #+# #+# */
/* Updated: 2024/12/23 18:46:13 by ycontre ### ########.fr */
/* */
/* ************************************************************************** */
#ifndef RT_SCENE__HPP
# define RT_SCENE__HPP
# include "RT.hpp"
class Camera;
class Scene
{
public:
Scene();
~Scene();
Camera *getCamera(void) const;
// Object *getObjects(void) const;
private:
// Object *_objects;
Camera *_camera;
};
#endif

View File

@ -6,7 +6,7 @@
/* By: ycontre <ycontre@student.42.fr> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2024/10/13 16:15:41 by TheRed #+# #+# */
/* Updated: 2024/10/13 20:48:46 by ycontre ### ########.fr */
/* Updated: 2024/12/23 18:35:35 by ycontre ### ########.fr */
/* */
/* ************************************************************************** */
@ -15,7 +15,7 @@
# include "RT.hpp"
class Camera;
class Scene;
class Window
{
@ -24,7 +24,7 @@ class Window
~Window(void);
GLFWwindow *getWindow(void) const;
Camera *get_camera(void) const;
Scene *getScene(void) const;
float getFps(void) const;
void display();
@ -37,7 +37,7 @@ class Window
private:
GLFWwindow *_window;
Camera *_camera;
Scene *_scene;
float _fps;

View File

@ -0,0 +1,30 @@
/* ************************************************************************** */
/* */
/* ::: :::::::: */
/* Sphere.hpp :+: :+: :+: */
/* +:+ +:+ +:+ */
/* By: ycontre <ycontre@student.42.fr> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2024/12/23 19:12:51 by ycontre #+# #+# */
/* Updated: 2024/12/23 19:47:09 by ycontre ### ########.fr */
/* */
/* ************************************************************************** */
#ifndef RT_SPHERE__HPP
# define RT_SPHERE__HPP
# include "RT.hpp"
class Sphere : public Object
{
public:
float radius;
glm::vec3 position;
private:
};
#endif