summaryrefslogtreecommitdiff
path: root/src/view_3d.cpp
diff options
context:
space:
mode:
authorFrederico Linhares <fred@linhares.blue>2024-02-06 17:37:20 -0300
committerFrederico Linhares <fred@linhares.blue>2024-03-23 19:12:24 -0300
commitbf240d7eeaa89657462b705849fde56e54e237db (patch)
tree0bd3f9826dd2d4d88f9da1ec77ba8f1b27b41be1 /src/view_3d.cpp
parent8d7e40e0b2b592efc7bcf7101ee362ec61f1989f (diff)
refa Use quaternion for orientation
Diffstat (limited to 'src/view_3d.cpp')
-rw-r--r--src/view_3d.cpp14
1 files changed, 7 insertions, 7 deletions
diff --git a/src/view_3d.cpp b/src/view_3d.cpp
index 8f4f14c..7db0015 100644
--- a/src/view_3d.cpp
+++ b/src/view_3d.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright 2022 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.
@@ -17,7 +17,7 @@
#include "view_3d.hpp"
#include "sprite.hpp"
-#include "rotation_3d.hpp"
+#include "orientation_3d.hpp"
#include "vector_3d.hpp"
#include "vector_4d.hpp"
#include "vk/sprite.hpp"
@@ -69,13 +69,13 @@ cg_cView3D_set_camera_position(mrb_state *mrb, mrb_value self)
}
static mrb_value
-cg_cView3D_set_camera_rotation(mrb_state *mrb, mrb_value self)
+cg_cView3D_set_camera_orientation(mrb_state *mrb, mrb_value self)
{
- std::shared_ptr<glm::vec3> *camera_rotation;
+ std::shared_ptr<glm::quat> *camera_orientation;
auto ptr = (std::shared_ptr<VK::View3D>*)DATA_PTR(self);
- mrb_get_args(mrb, "d", &camera_rotation, &cg_rotation_3d_type);
- (*ptr)->camera_rotation = (*camera_rotation);
+ mrb_get_args(mrb, "d", &camera_orientation, &cg_orientation_3d_type);
+ (*ptr)->camera_orientation = (*camera_orientation);
return self;
}
@@ -116,7 +116,7 @@ cg_view_3d_init(mrb_state *mrb)
mrb, cg_cView3D, "camera_position=", cg_cView3D_set_camera_position,
MRB_ARGS_REQ(1));
mrb_define_method(
- mrb, cg_cView3D, "camera_rotation=", cg_cView3D_set_camera_rotation,
+ mrb, cg_cView3D, "camera_orientation=", cg_cView3D_set_camera_orientation,
MRB_ARGS_REQ(1));
mrb_define_method(
mrb, cg_cView3D, "field_of_view", cg_cView3D_get_field_of_view,