载入中...
搜索中...
未找到
Mat4.h
浏览该文件的文档.
1#pragma once
2#include "common/Export.h"
3
4
5#include <glm/mat4x4.hpp>
6
7namespace eve::math {
8
9class Vec2;
10class Vec3;
11
14public:
15 Mat4();
17 explicit Mat4(const glm::mat4 &m);
18
20 void identity();
22 void translate(float x, float y, float z);
24 void rotateX(float radians);
26 void rotateY(float radians);
28 void rotateZ(float radians);
30 void scale(float sx, float sy, float sz);
31
34 void multiply(const Mat4 *other);
35 Mat4 *multiplied(const Mat4 *other) const;
36
37 Vec3 *transformVec3(const Vec3 *v) const;
38 Vec2 *transformPoint2(const Vec2 *v) const;
39
41 float get(int index) const;
43 void set(int index, float value);
44
45 Mat4 *clone() const;
46
47 const glm::mat4 &raw() const { return m_; }
48 glm::mat4 &raw() { return m_; }
49
50private:
51 glm::mat4 m_{1.f};
52};
53
54} // namespace eve::math
double value
float y
Definition AnimClip.cpp:738
float x
Definition AnimClip.cpp:738
float z
Definition AnimClip.cpp:738
#define EVENGINE_API_FOUNDATION
每个链接组(link group)各自的导出宏。
Definition Export.h:106
float v
std::array< float, 3 > scale
uint32_t index
float m[16]
Column-major 4x4 matrix wrapping glm::mat4.
Definition Mat4.h:13
const glm::mat4 & raw() const
Definition Mat4.h:47
glm::mat4 & raw()
Definition Mat4.h:48
2D float vector (script-facing math module value).
Definition Vec2.h:10
3D float vector (script-facing math module value).
Definition Vec3.h:10