1
This commit is contained in:
parent
3e5ad07a23
commit
9b63b8fee2
31
a8/vec3.cc
31
a8/vec3.cc
@ -5,9 +5,40 @@
|
||||
#include <glm/gtc/matrix_transform.hpp>
|
||||
#include <glm/vec3.hpp>
|
||||
|
||||
#include <Eigen/Core>
|
||||
#include <Eigen/Dense>
|
||||
|
||||
|
||||
#include <a8/vec3.h>
|
||||
|
||||
namespace a8
|
||||
{
|
||||
|
||||
void Vec3::RotateX(float angle)
|
||||
{
|
||||
Eigen::Vector3f v(x, y, z);
|
||||
v = Eigen::AngleAxisf(angle * 3.1415926f, Eigen::Vector3f::UnitX()) * v;
|
||||
x = v[0];
|
||||
y = v[1];
|
||||
z = v[2];
|
||||
}
|
||||
|
||||
void Vec3::RotateY(float angle)
|
||||
{
|
||||
Eigen::Vector3f v(x, y, z);
|
||||
v = Eigen::AngleAxisf(angle * 3.1415926f, Eigen::Vector3f::UnitY()) * v;
|
||||
x = v[0];
|
||||
y = v[1];
|
||||
z = v[2];
|
||||
}
|
||||
|
||||
void Vec3::RotateZ(float angle)
|
||||
{
|
||||
Eigen::Vector3f v(x, y, z);
|
||||
v = Eigen::AngleAxisf(angle * 3.1415926f, Eigen::Vector3f::UnitZ()) * v;
|
||||
x = v[0];
|
||||
y = v[1];
|
||||
z = v[2];
|
||||
}
|
||||
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user