From f4a7739a40c095e0c837d78d00f13a1ef47d3a11 Mon Sep 17 00:00:00 2001 From: Elizabeth Hunt Date: Sat, 25 Nov 2023 17:05:01 -0700 Subject: cube foo init --- inc/mesh.hpp | 6 +++--- inc/model_instance.hpp | 6 +++++- inc/scene.hpp | 21 ++++++++++++--------- 3 files changed, 20 insertions(+), 13 deletions(-) (limited to 'inc') diff --git a/inc/mesh.hpp b/inc/mesh.hpp index db465fb..91fa500 100644 --- a/inc/mesh.hpp +++ b/inc/mesh.hpp @@ -14,9 +14,9 @@ typedef struct TRIANGLE { } TRIANGLE; class Mesh { -protected: - usu::vector m_vertices; - usu::vector m_triangles; +public: + usu::vector vertices; + usu::vector triangles; }; #endif // MESH_HPP diff --git a/inc/model_instance.hpp b/inc/model_instance.hpp index a8bbee0..059d3a5 100644 --- a/inc/model_instance.hpp +++ b/inc/model_instance.hpp @@ -8,10 +8,14 @@ class ModelInstance : Renderable { private: FIXED m_scale; - VECTOR m_rotation; + VECTOR m_rotation; // though technically "FIXED"'s, these are simply s32's + // where [0, 2pi] -> [0, 0xFFFF] in the x,y,z axes VECTOR m_pos; std::shared_ptr m_mesh; + +public: + void render(std::shared_ptr scene_context); }; #endif // MODEL_INSTANCE_HPP diff --git a/inc/scene.hpp b/inc/scene.hpp index f84bcd7..8e286db 100644 --- a/inc/scene.hpp +++ b/inc/scene.hpp @@ -1,20 +1,23 @@ -#ifndef CANVAS_HPP -#define CANVAS_HPP +#ifndef SCENE_HPP +#define SCENE_HPP -#include "mesh.hpp" +#include "model_instance.hpp" #include "vector.hpp" #include +#include class Scene { -private: - usu::vector meshes; - std::uint32_t width; - std::uint32_t height; - public: - Scene(); + usu::vector renderables; + std::tuple + viewport_dimension; // + std::tuple scene_dimension; + VECTOR directional_light; + FIXED z_plane; + Scene(); void render(); + POINT project_2d(VECTOR vertex); }; #endif // SCENE_HPP -- cgit v1.2.3-70-g09d2