summaryrefslogtreecommitdiff
path: root/src/static_model.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/static_model.cpp')
-rw-r--r--src/static_model.cpp24
1 files changed, 12 insertions, 12 deletions
diff --git a/src/static_model.cpp b/src/static_model.cpp
index 5873792..eb9e4c9 100644
--- a/src/static_model.cpp
+++ b/src/static_model.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright 2022-2023 Frederico de Oliveira Linhares
+ * Copyright 2022-2024 Frederico de Oliveira Linhares
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -16,10 +16,10 @@
#include "static_model.hpp"
-#include "vector_3d.hpp"
-#include "rotation_3d.hpp"
+#include "orientation_3d.hpp"
#include "static_mesh.hpp"
#include "texture.hpp"
+#include "vector_3d.hpp"
#include "vk/static_model.hpp"
void
@@ -40,13 +40,13 @@ cg_cStaticModel_initialize(mrb_state *mrb, mrb_value self)
std::shared_ptr<VK::StaticMesh> *static_mesh;
std::shared_ptr<VK::Texture> *texture;
std::shared_ptr<glm::vec3> *position;
- std::shared_ptr<glm::vec3> *rotation;
+ std::shared_ptr<glm::quat> *orientation;
std::shared_ptr<VK::StaticModel> *ptr;
mrb_get_args(
mrb, "dddd", &static_mesh, &cg_static_mesh_type, &texture,
- &cg_texture_type, &position, &cg_vector_3d_type, &rotation,
- &cg_rotation_3d_type);
+ &cg_texture_type, &position, &cg_vector_3d_type, &orientation,
+ &cg_orientation_3d_type);
ptr = (std::shared_ptr<VK::StaticModel>*)DATA_PTR(self);
if(ptr) mrb_free(mrb, ptr);
ptr = (std::shared_ptr<VK::StaticModel>*)mrb_malloc(
@@ -54,20 +54,20 @@ cg_cStaticModel_initialize(mrb_state *mrb, mrb_value self)
new(ptr)std::shared_ptr<VK::StaticModel>(
std::make_shared<VK::StaticModel>(
- *static_mesh, *texture, *position, *rotation));
+ *static_mesh, *texture, *position, *orientation));
mrb_data_init(self, ptr, &cg_static_model_type);
return self;
}
static mrb_value
-cg_cStaticModel_set_rotation(mrb_state *mrb, mrb_value self)
+cg_cStaticModel_set_orientation(mrb_state *mrb, mrb_value self)
{
auto ptr = (std::shared_ptr<VK::StaticModel>*)DATA_PTR(self);
- std::shared_ptr<glm::vec3> *rotation;
+ std::shared_ptr<glm::quat> *orientation;
- mrb_get_args(mrb, "d", &rotation, &cg_rotation_3d_type);
- (*ptr)->rotation = *rotation;
+ mrb_get_args(mrb, "d", &orientation, &cg_orientation_3d_type);
+ (*ptr)->orientation = *orientation;
return self;
}
@@ -124,7 +124,7 @@ cg_static_model_init(mrb_state *mrb)
mrb, cg_cStaticModel, "position=", cg_cStaticModel_set_position,
MRB_ARGS_REQ(1));
mrb_define_method(
- mrb, cg_cStaticModel, "rotation=", cg_cStaticModel_set_rotation,
+ mrb, cg_cStaticModel, "orientation=", cg_cStaticModel_set_orientation,
MRB_ARGS_REQ(1));
mrb_define_method(
mrb, cg_cStaticModel, "texture=", cg_cStaticModel_set_texture,