diff options
Diffstat (limited to 'inc')
-rw-r--r-- | inc/mesh.hpp | 6 | ||||
-rw-r--r-- | inc/model_instance.hpp | 6 | ||||
-rw-r--r-- | inc/scene.hpp | 21 |
3 files changed, 20 insertions, 13 deletions
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<VECTOR> m_vertices; - usu::vector<TRIANGLE> m_triangles; +public: + usu::vector<VECTOR> vertices; + usu::vector<TRIANGLE> 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<Mesh> m_mesh; + +public: + void render(std::shared_ptr<Scene> 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 <cstdint> +#include <tonc.h> class Scene { -private: - usu::vector<Mesh> meshes; - std::uint32_t width; - std::uint32_t height; - public: - Scene(); + usu::vector<Renderable> renderables; + std::tuple<std::uint16_t, std::uint16_t> + viewport_dimension; // <width, height> + std::tuple<std::uint16_t, std::uint16_t> scene_dimension; + VECTOR directional_light; + FIXED z_plane; + Scene(); void render(); + POINT project_2d(VECTOR vertex); }; #endif // SCENE_HPP |