summaryrefslogtreecommitdiff
path: root/src/model_instance.cpp
diff options
context:
space:
mode:
authorElizabeth Hunt <elizabeth.hunt@simponic.xyz>2023-11-28 14:39:20 -0700
committerElizabeth Hunt <elizabeth.hunt@simponic.xyz>2023-11-28 14:39:20 -0700
commit3197f9e40cd7079e19990c64c98de667e2457d75 (patch)
tree2d9eb3fbc17d453ee33e478bafb9936beff12eb3 /src/model_instance.cpp
parent1b96b0211ed98afba515f0ac9880116f79ead2e5 (diff)
downloadgba-cube-3197f9e40cd7079e19990c64c98de667e2457d75.tar.gz
gba-cube-3197f9e40cd7079e19990c64c98de667e2457d75.zip
draw the whole cube
Diffstat (limited to 'src/model_instance.cpp')
-rw-r--r--src/model_instance.cpp7
1 files changed, 4 insertions, 3 deletions
diff --git a/src/model_instance.cpp b/src/model_instance.cpp
index 61204ff..db28243 100644
--- a/src/model_instance.cpp
+++ b/src/model_instance.cpp
@@ -40,9 +40,8 @@ void ModelInstance::render(std::shared_ptr<Scene> scene_context) {
usu::vector<POINT> projected(m_mesh->vertices.size());
for (std::uint32_t i = 0; i < projected.size(); i++) {
- VECTOR transformed =
- m_mesh->vertices[i]; // rotate(m_mesh->vertices[i], m_rot);
- // vec_add(&transformed, &transformed, &m_pos);
+ VECTOR transformed = rotate(m_mesh->vertices[i], m_rot);
+ vec_add(&transformed, &transformed, &m_pos);
projected[i] = scene_context->project_2d(transformed);
}
@@ -57,3 +56,5 @@ void ModelInstance::render(std::shared_ptr<Scene> scene_context) {
scene_context->draw_line(v2, v0, triangle.color_idx);
}
}
+
+void ModelInstance::add_pos(VECTOR d_pos) { vec_add(&m_pos, &m_pos, &d_pos); }