Using newer simplemathv2, compiles fine but crashes :/)
parent
09db06fbfd
commit
2bd2a99f29
File diff suppressed because it is too large
Load Diff
|
@ -3,24 +3,24 @@
|
||||||
|
|
||||||
#include "SimpleMath/SimpleMath.h"
|
#include "SimpleMath/SimpleMath.h"
|
||||||
|
|
||||||
typedef SimpleMath::Fixed<float, 2, 1> Vector2f;
|
typedef SimpleMath::Matrix<float, 2, 1> Vector2f;
|
||||||
typedef SimpleMath::Fixed<float, 2, 2> Matrix22f;
|
typedef SimpleMath::Matrix<float, 2, 2> Matrix22f;
|
||||||
|
|
||||||
typedef SimpleMath::Fixed<float, 3, 1> Vector3f;
|
typedef SimpleMath::Matrix<float, 3, 1> Vector3f;
|
||||||
typedef SimpleMath::Fixed<float, 3, 3> Matrix33f;
|
typedef SimpleMath::Matrix<float, 3, 3> Matrix33f;
|
||||||
|
|
||||||
typedef SimpleMath::Fixed<float, 4, 1> Vector4f;
|
typedef SimpleMath::Matrix<float, 4, 1> Vector4f;
|
||||||
typedef SimpleMath::Fixed<float, 4, 4> Matrix44f;
|
typedef SimpleMath::Matrix<float, 4, 4> Matrix44f;
|
||||||
|
|
||||||
typedef SimpleMath::Quaternion Quaternion;
|
typedef SimpleMath::GL::Quaternion Quaternion;
|
||||||
|
|
||||||
typedef SimpleMath::Dynamic<float> VectorNf;
|
typedef SimpleMath::Matrix<float> VectorNf;
|
||||||
typedef SimpleMath::Dynamic<float> MatrixNNf;
|
typedef SimpleMath::Matrix<float> MatrixNNf;
|
||||||
|
|
||||||
typedef SimpleMath::Fixed<double, 3, 1> Vector3d;
|
typedef SimpleMath::Matrix<double, 3, 1> Vector3d;
|
||||||
typedef SimpleMath::Fixed<double, 3, 3> Matrix33d;
|
typedef SimpleMath::Matrix<double, 3, 3> Matrix33d;
|
||||||
|
|
||||||
typedef SimpleMath::Dynamic<double> VectorNd;
|
typedef SimpleMath::Matrix<double> VectorNd;
|
||||||
typedef SimpleMath::Dynamic<double> MatrixNNd;
|
typedef SimpleMath::Matrix<double> MatrixNNd;
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|
|
@ -10,7 +10,7 @@
|
||||||
#include "imgui/imgui.h"
|
#include "imgui/imgui.h"
|
||||||
#include "imgui_dock.h"
|
#include "imgui_dock.h"
|
||||||
|
|
||||||
using namespace SimpleMath;
|
using namespace SimpleMath::GL;
|
||||||
|
|
||||||
struct Renderer;
|
struct Renderer;
|
||||||
|
|
||||||
|
|
|
@ -12,7 +12,7 @@
|
||||||
#include "imgui/imgui.h"
|
#include "imgui/imgui.h"
|
||||||
#include "imgui_dock.h"
|
#include "imgui_dock.h"
|
||||||
|
|
||||||
using namespace SimpleMath;
|
using namespace SimpleMath::GL;
|
||||||
|
|
||||||
typedef tinygltf::TinyGLTF GLTFLoader;
|
typedef tinygltf::TinyGLTF GLTFLoader;
|
||||||
|
|
||||||
|
|
|
@ -46,10 +46,10 @@ void handle_mouse (struct module_state *state) {
|
||||||
view_dir = (poi - eye).normalized();
|
view_dir = (poi - eye).normalized();
|
||||||
Vector3f right = camera_rot_inv.block<1,3>(0,0).transpose();
|
Vector3f right = camera_rot_inv.block<1,3>(0,0).transpose();
|
||||||
right = view_dir.cross (Vector3f (0.f, 1.f, 0.f));
|
right = view_dir.cross (Vector3f (0.f, 1.f, 0.f));
|
||||||
Matrix33f rot_matrix_y = SimpleMath::RotateMat33(
|
Matrix33f rot_matrix_y = SimpleMath::GL::RotateMat33(
|
||||||
gGuiInputState->mousedY * 0.4f,
|
gGuiInputState->mousedY * 0.4f,
|
||||||
right[0], right[1], right[2]);
|
right[0], right[1], right[2]);
|
||||||
Matrix33f rot_matrix_x = SimpleMath::RotateMat33(
|
Matrix33f rot_matrix_x = SimpleMath::GL::RotateMat33(
|
||||||
gGuiInputState->mousedX * 0.4f,
|
gGuiInputState->mousedX * 0.4f,
|
||||||
0.f, 1.f, 0.f);
|
0.f, 1.f, 0.f);
|
||||||
poi = eye + rot_matrix_x * rot_matrix_y * view_dir;
|
poi = eye + rot_matrix_x * rot_matrix_y * view_dir;
|
||||||
|
|
Loading…
Reference in New Issue