mirror of
https://github.com/rwengine/openrw.git
synced 2024-09-18 16:32:32 +02:00
rwgame: create matrix from vectors (instead of elements)
This commit is contained in:
parent
a9f009f97f
commit
07a5729cef
@ -18,6 +18,7 @@
|
||||
#include <script/ScriptMachine.hpp>
|
||||
|
||||
#include <glm/gtc/constants.hpp>
|
||||
#include <glm/gtx/matrix_major_storage.hpp>
|
||||
|
||||
constexpr float kAutoLookTime = 2.f;
|
||||
constexpr float kAutolookMinVelocity = 0.2f;
|
||||
@ -351,18 +352,7 @@ const ViewCamera& IngameState::getCamera(float alpha) {
|
||||
glm::normalize(glm::cross(glm::vec3(0.f, 0.f, 1.f), direction));
|
||||
auto up = glm::normalize(glm::cross(direction, right));
|
||||
|
||||
glm::mat3 m;
|
||||
m[0][0] = direction.x;
|
||||
m[0][1] = right.x;
|
||||
m[0][2] = up.x;
|
||||
|
||||
m[1][0] = direction.y;
|
||||
m[1][1] = right.y;
|
||||
m[1][2] = up.y;
|
||||
|
||||
m[2][0] = direction.z;
|
||||
m[2][1] = right.z;
|
||||
m[2][2] = up.z;
|
||||
glm::mat3 m = glm::rowMajor3(direction, right, up);
|
||||
|
||||
auto qtilt = glm::angleAxis(glm::radians(tilt), direction);
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user