Dependency Reconfiguration to support MSVC being picky :/
Some checks failed
Run tests / Explore-Gitea-Actions (push) Failing after 1m10s
Build Docs With Doxygen / Explore-Gitea-Actions (push) Successful in 35s

This commit is contained in:
2024-06-16 23:02:32 -07:00
parent 2573757017
commit a5c96e8cae
13 changed files with 188 additions and 156 deletions

View File

@@ -1,7 +1,7 @@
#pragma once
#include <J3ML/LinearAlgebra/Common.h>
#include <J3ML/LinearAlgebra/Vector2.h>
#include <J3ML/LinearAlgebra/Vector3.h>
#include <J3ML/LinearAlgebra/Quaternion.h>
@@ -13,25 +13,7 @@ using namespace J3ML::Algorithm;
namespace J3ML::LinearAlgebra {
template<typename Matrix>
void SetMatrixRotatePart(Matrix &m, const Quaternion &q) {
// See https://www.geometrictools.com/Documentation/LinearAlgebraicQuaternions.pdf .
assert(q.IsNormalized(1e-3f));
const float x = q.x;
const float y = q.y;
const float z = q.z;
const float w = q.w;
m[0][0] = 1 - 2 * (y * y + z * z);
m[0][1] = 2 * (x * y - z * w);
m[0][2] = 2 * (x * y + y * w);
m[1][0] = 2 * (x * y + z * w);
m[1][1] = 1 - 2 * (x * x + z * z);
m[1][2] = 2 * (y * z - x * w);
m[2][0] = 2 * (x * z - y * w);
m[2][1] = 2 * (y * z + x * w);
m[2][2] = 1 - 2 * (x * x + y * y);
}
/// A 3-by-3 matrix for linear transformations of 3D geometry.
/* This can represent any kind of linear transformations of 3D geometry, which include