2014-10-14 13:11:37 +00:00
|
|
|
/*
|
|
|
|
* This file is part of the Colobot: Gold Edition source code
|
2021-09-11 13:52:34 +00:00
|
|
|
* Copyright (C) 2001-2021, Daniel Roux, EPSITEC SA & TerranovaTeam
|
2015-08-22 14:40:02 +00:00
|
|
|
* http://epsitec.ch; http://colobot.info; http://github.com/colobot
|
2014-10-14 13:11:37 +00:00
|
|
|
*
|
|
|
|
* This program is free software: you can redistribute it and/or modify
|
|
|
|
* it under the terms of the GNU General Public License as published by
|
|
|
|
* the Free Software Foundation, either version 3 of the License, or
|
|
|
|
* (at your option) any later version.
|
|
|
|
*
|
|
|
|
* This program is distributed in the hope that it will be useful,
|
|
|
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
|
|
|
|
* See the GNU General Public License for more details.
|
|
|
|
*
|
|
|
|
* You should have received a copy of the GNU General Public License
|
|
|
|
* along with this program. If not, see http://gnu.org/licenses
|
|
|
|
*/
|
2015-08-22 15:51:39 +00:00
|
|
|
|
2012-06-12 11:48:17 +00:00
|
|
|
/* Unit tests for functions in geometry.h */
|
|
|
|
|
2013-02-03 19:03:36 +00:00
|
|
|
#include "math/func.h"
|
|
|
|
#include "math/geometry.h"
|
2012-06-12 11:48:17 +00:00
|
|
|
|
2013-06-21 23:11:37 +00:00
|
|
|
#include <gtest/gtest.h>
|
2012-06-12 11:48:17 +00:00
|
|
|
|
|
|
|
|
|
|
|
const float TEST_TOLERANCE = 1e-5;
|
|
|
|
|
2012-06-15 14:58:04 +00:00
|
|
|
|
2012-06-12 11:48:17 +00:00
|
|
|
// Test for rewritten function RotateAngle()
|
2012-09-11 19:14:32 +00:00
|
|
|
TEST(GeometryTest, RotateAngleTest)
|
2012-06-12 11:48:17 +00:00
|
|
|
{
|
2012-09-11 19:14:32 +00:00
|
|
|
EXPECT_TRUE(Math::IsEqual(Math::RotateAngle(0.0f, 0.0f), 0.0f, TEST_TOLERANCE));
|
2012-06-12 11:48:17 +00:00
|
|
|
|
2012-09-11 19:14:32 +00:00
|
|
|
EXPECT_TRUE(Math::IsEqual(Math::RotateAngle(1.0f, 0.0f), 0.0f, TEST_TOLERANCE));
|
2012-06-12 11:48:17 +00:00
|
|
|
|
2012-09-11 19:14:32 +00:00
|
|
|
EXPECT_TRUE(Math::IsEqual(Math::RotateAngle(1.0f, 1.0f), 0.25f * Math::PI, TEST_TOLERANCE));
|
2012-06-12 11:48:17 +00:00
|
|
|
|
2012-09-11 19:14:32 +00:00
|
|
|
EXPECT_TRUE(Math::IsEqual(Math::RotateAngle(0.0f, 2.0f), 0.5f * Math::PI, TEST_TOLERANCE));
|
2012-06-12 11:48:17 +00:00
|
|
|
|
2012-09-11 19:14:32 +00:00
|
|
|
EXPECT_TRUE(Math::IsEqual(Math::RotateAngle(-0.5f, 0.5f), 0.75f * Math::PI, TEST_TOLERANCE));
|
2012-06-12 11:48:17 +00:00
|
|
|
|
2012-09-11 19:14:32 +00:00
|
|
|
EXPECT_TRUE(Math::IsEqual(Math::RotateAngle(-1.0f, 0.0f), Math::PI, TEST_TOLERANCE));
|
2012-06-12 11:48:17 +00:00
|
|
|
|
2012-09-11 19:14:32 +00:00
|
|
|
EXPECT_TRUE(Math::IsEqual(Math::RotateAngle(-1.0f, -1.0f), 1.25f * Math::PI, TEST_TOLERANCE));
|
2012-06-12 11:48:17 +00:00
|
|
|
|
2012-09-11 19:14:32 +00:00
|
|
|
EXPECT_TRUE(Math::IsEqual(Math::RotateAngle(0.0f, -2.0f), 1.5f * Math::PI, TEST_TOLERANCE));
|
2012-06-12 11:48:17 +00:00
|
|
|
|
2012-09-11 19:14:32 +00:00
|
|
|
EXPECT_TRUE(Math::IsEqual(Math::RotateAngle(1.0f, -1.0f), 1.75f * Math::PI, TEST_TOLERANCE));
|
2012-06-12 11:48:17 +00:00
|
|
|
}
|
|
|
|
|
2012-06-15 14:58:04 +00:00
|
|
|
// Tests for other altered, complex or uncertain functions
|
|
|
|
|
2012-09-11 19:14:32 +00:00
|
|
|
/*
|
|
|
|
|
|
|
|
TODO: write meaningful tests with proper test values
|
|
|
|
|
2012-06-15 14:58:04 +00:00
|
|
|
int TestAngle()
|
|
|
|
{
|
2022-01-04 00:39:55 +00:00
|
|
|
const glm::vec3 u(-0.0786076246943884, 0.2231249091714256, -1.1601361718477805);
|
|
|
|
const glm::vec3 v(-1.231228742001907, -1.720549809950561, -0.690468438834111);
|
2012-06-15 14:58:04 +00:00
|
|
|
|
2012-06-26 20:23:05 +00:00
|
|
|
float mathResult = Math::Angle(u, v);
|
|
|
|
float oldMathResult = Angle(VEC_TO_D3DVEC(u), VEC_TO_D3DVEC(v));
|
2012-06-15 14:58:04 +00:00
|
|
|
|
2012-06-26 20:23:05 +00:00
|
|
|
if (! Math::IsEqual(mathResult, oldMathResult, TEST_TOLERANCE) )
|
|
|
|
return __LINE__;
|
2012-06-15 14:58:04 +00:00
|
|
|
|
2012-06-26 20:23:05 +00:00
|
|
|
return 0;
|
2012-06-15 14:58:04 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
int TestRotateView()
|
|
|
|
{
|
2022-01-04 00:39:55 +00:00
|
|
|
const glm::vec3 center(0.617909142705555, 0.896939729454538, -0.615041943652284);
|
2012-06-26 20:23:05 +00:00
|
|
|
const float angleH = 44.5;
|
|
|
|
const float angleV = 12.3;
|
|
|
|
const float dist = 34.76;
|
2012-06-15 14:58:04 +00:00
|
|
|
|
2022-01-04 00:39:55 +00:00
|
|
|
glm::vec3 mathResult = Math::RotateView(center, angleH, angleV, dist);
|
|
|
|
glm::vec3 oldMathResult = D3DVEC_TO_VEC(RotateView(VEC_TO_D3DVEC(center), angleH, angleV, dist));
|
2012-06-15 14:58:04 +00:00
|
|
|
|
2012-06-26 20:23:05 +00:00
|
|
|
if (! Math::VectorsEqual(mathResult, oldMathResult, TEST_TOLERANCE))
|
|
|
|
return __LINE__;
|
2012-06-15 14:58:04 +00:00
|
|
|
|
2012-06-26 20:23:05 +00:00
|
|
|
return 0;
|
2012-06-15 14:58:04 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
int TestLookatPoint()
|
|
|
|
{
|
2022-01-04 00:39:55 +00:00
|
|
|
const glm::vec3 eye(-2.451183170579471, 0.241270270546559, -0.490677411454893);
|
2012-06-26 20:23:05 +00:00
|
|
|
const float angleH = 48.4;
|
|
|
|
const float angleV = 32.4;
|
|
|
|
const float length = 74.44;
|
2012-06-15 14:58:04 +00:00
|
|
|
|
2022-01-04 00:39:55 +00:00
|
|
|
glm::vec3 mathResult = Math::LookatPoint(eye, angleH, angleV, length);
|
|
|
|
glm::vec3 oldMathResult = D3DVEC_TO_VEC(LookatPoint(VEC_TO_D3DVEC(eye), angleH, angleV, length));
|
2012-06-15 14:58:04 +00:00
|
|
|
|
2012-06-26 20:23:05 +00:00
|
|
|
if (! Math::VectorsEqual(mathResult, oldMathResult, TEST_TOLERANCE))
|
|
|
|
return __LINE__;
|
2012-06-15 14:58:04 +00:00
|
|
|
|
2012-06-26 20:23:05 +00:00
|
|
|
return 0;
|
2012-06-15 14:58:04 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
int TestProjection()
|
|
|
|
{
|
2022-01-04 00:39:55 +00:00
|
|
|
const glm::vec3 a(0.852064846846319, -0.794279497087496, -0.655779805476688);
|
|
|
|
const glm::vec3 b(-0.245838834102304, -0.841115596038861, 0.470457161487799);
|
|
|
|
const glm::vec3 p(2.289326061164255, -0.505511362271196, 0.660204551169491);
|
2012-06-15 14:58:04 +00:00
|
|
|
|
2022-01-04 00:39:55 +00:00
|
|
|
glm::vec3 mathResult = Math::Projection(a, b, p);
|
|
|
|
glm::vec3 oldMathResult = D3DVEC_TO_VEC(Projection(VEC_TO_D3DVEC(a), VEC_TO_D3DVEC(b), VEC_TO_D3DVEC(p)));
|
2012-06-15 14:58:04 +00:00
|
|
|
|
2012-06-26 20:23:05 +00:00
|
|
|
if (! Math::VectorsEqual(mathResult, oldMathResult, TEST_TOLERANCE))
|
|
|
|
return __LINE__;
|
2012-06-15 14:58:04 +00:00
|
|
|
|
2012-06-26 20:23:05 +00:00
|
|
|
return 0;
|
2012-06-15 14:58:04 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
int TestLoadViewMatrix()
|
|
|
|
{
|
2022-01-04 00:39:55 +00:00
|
|
|
const glm::vec3 from(2.5646013154868874, -0.6058794133917031, -0.0441195127419744);
|
|
|
|
const glm::vec3 at(0.728044925765569, -0.206343977871841, 2.543158236935463);
|
|
|
|
const glm::vec3 worldUp(-1.893738133660711, -1.009584441407070, 0.521745988225582);
|
2012-06-26 20:23:05 +00:00
|
|
|
|
|
|
|
Math::Matrix mathResult;
|
|
|
|
Math::LoadViewMatrix(mathResult, from, at, worldUp);
|
|
|
|
|
|
|
|
Math::Matrix oldMathResult;
|
|
|
|
{
|
|
|
|
D3DMATRIX mat;
|
|
|
|
D3DVECTOR fromD3D = VEC_TO_D3DVEC(from);
|
|
|
|
D3DVECTOR atD3D = VEC_TO_D3DVEC(at);
|
|
|
|
D3DVECTOR worldUpD3D = VEC_TO_D3DVEC(worldUp);
|
|
|
|
D3DUtil_SetViewMatrix(mat, fromD3D, atD3D, worldUpD3D);
|
|
|
|
oldMathResult = D3DMAT_TO_MAT(mat);
|
|
|
|
}
|
|
|
|
|
|
|
|
if (! Math::MatricesEqual(mathResult, oldMathResult, TEST_TOLERANCE))
|
|
|
|
return __LINE__;
|
|
|
|
|
|
|
|
return 0;
|
2012-06-15 14:58:04 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
int TestLoadProjectionMatrix()
|
|
|
|
{
|
2012-06-26 20:23:05 +00:00
|
|
|
const float fov = 76.3f;
|
|
|
|
const float aspect = 0.891f;
|
|
|
|
const float nearPlane = 12.3f;
|
|
|
|
const float farPlane = 1238.9f;
|
2012-06-15 14:58:04 +00:00
|
|
|
|
2012-06-26 20:23:05 +00:00
|
|
|
Math::Matrix mathResult;
|
|
|
|
Math::LoadProjectionMatrix(mathResult, fov, aspect, nearPlane, farPlane);
|
2012-06-15 14:58:04 +00:00
|
|
|
|
2012-06-26 20:23:05 +00:00
|
|
|
Math::Matrix oldMathResult;
|
|
|
|
{
|
|
|
|
D3DMATRIX mat;
|
|
|
|
D3DUtil_SetProjectionMatrix(mat, fov, aspect, nearPlane, farPlane);
|
|
|
|
oldMathResult = D3DMAT_TO_MAT(mat);
|
|
|
|
}
|
2012-06-15 14:58:04 +00:00
|
|
|
|
2012-06-26 20:23:05 +00:00
|
|
|
if (! Math::MatricesEqual(mathResult, oldMathResult, TEST_TOLERANCE))
|
|
|
|
return __LINE__;
|
2012-06-15 14:58:04 +00:00
|
|
|
|
2012-06-26 20:23:05 +00:00
|
|
|
return 0;
|
2012-06-15 14:58:04 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
int TestLoadTranslationMatrix()
|
|
|
|
{
|
2022-01-04 00:39:55 +00:00
|
|
|
const glm::vec3 translation(-0.3631590720995237, 1.6976327614875211, 0.0148815191502145);
|
2012-06-15 14:58:04 +00:00
|
|
|
|
2012-06-26 20:23:05 +00:00
|
|
|
Math::Matrix mathResult;
|
|
|
|
Math::LoadTranslationMatrix(mathResult, translation);
|
2012-06-15 14:58:04 +00:00
|
|
|
|
2012-06-26 20:23:05 +00:00
|
|
|
Math::Matrix oldMathResult;
|
|
|
|
{
|
|
|
|
D3DMATRIX mat;
|
|
|
|
D3DUtil_SetTranslateMatrix(mat, translation.x, translation.y, translation.z);
|
|
|
|
oldMathResult = D3DMAT_TO_MAT(mat);
|
|
|
|
}
|
2012-06-15 14:58:04 +00:00
|
|
|
|
2012-06-26 20:23:05 +00:00
|
|
|
if (! Math::MatricesEqual(mathResult, oldMathResult, TEST_TOLERANCE))
|
|
|
|
return __LINE__;
|
2012-06-15 14:58:04 +00:00
|
|
|
|
2012-06-26 20:23:05 +00:00
|
|
|
return 0;
|
2012-06-15 14:58:04 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
int TestLoadScaleMatrix()
|
|
|
|
{
|
2022-01-04 00:39:55 +00:00
|
|
|
const glm::vec3 scale(0.612236460285503, -0.635566935025364, -0.254321375332065);
|
2012-06-15 14:58:04 +00:00
|
|
|
|
2012-06-26 20:23:05 +00:00
|
|
|
Math::Matrix mathResult;
|
|
|
|
Math::LoadScaleMatrix(mathResult, scale);
|
2012-06-15 14:58:04 +00:00
|
|
|
|
2012-06-26 20:23:05 +00:00
|
|
|
Math::Matrix oldMathResult;
|
|
|
|
{
|
|
|
|
D3DMATRIX mat;
|
|
|
|
D3DUtil_SetScaleMatrix(mat, scale.x, scale.y, scale.z);
|
|
|
|
oldMathResult = D3DMAT_TO_MAT(mat);
|
|
|
|
}
|
2012-06-15 14:58:04 +00:00
|
|
|
|
2012-06-26 20:23:05 +00:00
|
|
|
if (! Math::MatricesEqual(mathResult, oldMathResult, TEST_TOLERANCE))
|
|
|
|
return __LINE__;
|
2012-06-15 14:58:04 +00:00
|
|
|
|
2012-06-26 20:23:05 +00:00
|
|
|
return 0;
|
2012-06-15 14:58:04 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
int TestLoadRotationXMatrix()
|
|
|
|
{
|
2012-06-26 20:23:05 +00:00
|
|
|
const float angle = 0.513790685774275;
|
2012-06-15 14:58:04 +00:00
|
|
|
|
2012-06-26 20:23:05 +00:00
|
|
|
Math::Matrix mathResult;
|
|
|
|
Math::LoadRotationXMatrix(mathResult, angle);
|
2012-06-15 14:58:04 +00:00
|
|
|
|
2012-06-26 20:23:05 +00:00
|
|
|
Math::Matrix oldMathResult;
|
|
|
|
{
|
|
|
|
D3DMATRIX mat;
|
|
|
|
D3DUtil_SetRotateXMatrix(mat, angle);
|
|
|
|
oldMathResult = D3DMAT_TO_MAT(mat);
|
|
|
|
}
|
2012-06-15 14:58:04 +00:00
|
|
|
|
2012-06-26 20:23:05 +00:00
|
|
|
if (! Math::MatricesEqual(mathResult, oldMathResult, TEST_TOLERANCE))
|
|
|
|
return __LINE__;
|
2012-06-15 14:58:04 +00:00
|
|
|
|
2012-06-26 20:23:05 +00:00
|
|
|
return 0;
|
2012-06-15 14:58:04 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
int TestLoadRotationYMatrix()
|
|
|
|
{
|
2012-06-26 20:23:05 +00:00
|
|
|
const float angle = -0.569166650127303;
|
2012-06-15 14:58:04 +00:00
|
|
|
|
2012-06-26 20:23:05 +00:00
|
|
|
Math::Matrix mathResult;
|
|
|
|
Math::LoadRotationYMatrix(mathResult, angle);
|
2012-06-15 14:58:04 +00:00
|
|
|
|
2012-06-26 20:23:05 +00:00
|
|
|
Math::Matrix oldMathResult;
|
|
|
|
{
|
|
|
|
D3DMATRIX mat;
|
|
|
|
D3DUtil_SetRotateYMatrix(mat, angle);
|
|
|
|
oldMathResult = D3DMAT_TO_MAT(mat);
|
|
|
|
}
|
2012-06-15 14:58:04 +00:00
|
|
|
|
2012-06-26 20:23:05 +00:00
|
|
|
if (! Math::MatricesEqual(mathResult, oldMathResult, TEST_TOLERANCE))
|
|
|
|
return __LINE__;
|
2012-06-15 14:58:04 +00:00
|
|
|
|
2012-06-26 20:23:05 +00:00
|
|
|
return 0;
|
2012-06-15 14:58:04 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
int TestLoadRotationZMatrix()
|
|
|
|
{
|
2012-06-26 20:23:05 +00:00
|
|
|
const float angle = 0.380448034347452;
|
2012-06-15 14:58:04 +00:00
|
|
|
|
2012-06-26 20:23:05 +00:00
|
|
|
Math::Matrix mathResult;
|
|
|
|
Math::LoadRotationZMatrix(mathResult, angle);
|
2012-06-15 14:58:04 +00:00
|
|
|
|
2012-06-26 20:23:05 +00:00
|
|
|
Math::Matrix oldMathResult;
|
|
|
|
{
|
|
|
|
D3DMATRIX mat;
|
|
|
|
D3DUtil_SetRotateZMatrix(mat, angle);
|
|
|
|
oldMathResult = D3DMAT_TO_MAT(mat);
|
|
|
|
}
|
2012-06-15 14:58:04 +00:00
|
|
|
|
2012-06-26 20:23:05 +00:00
|
|
|
if (! Math::MatricesEqual(mathResult, oldMathResult, TEST_TOLERANCE))
|
|
|
|
return __LINE__;
|
2012-06-15 14:58:04 +00:00
|
|
|
|
2012-06-26 20:23:05 +00:00
|
|
|
return 0;
|
2012-06-15 14:58:04 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
int TestLoadRotationMatrix()
|
|
|
|
{
|
2012-06-26 20:23:05 +00:00
|
|
|
const float angle = -0.987747190637790;
|
2022-01-04 00:39:55 +00:00
|
|
|
const glm::vec3 dir(-0.113024727688331, -0.781265998072571, 1.838972397076884);
|
2012-06-15 14:58:04 +00:00
|
|
|
|
2012-06-26 20:23:05 +00:00
|
|
|
Math::Matrix mathResult;
|
|
|
|
Math::LoadRotationMatrix(mathResult, dir, angle);
|
2012-06-15 14:58:04 +00:00
|
|
|
|
2012-06-26 20:23:05 +00:00
|
|
|
Math::Matrix oldMathResult;
|
|
|
|
{
|
|
|
|
D3DMATRIX mat;
|
|
|
|
D3DVECTOR dirD3D = VEC_TO_D3DVEC(dir);
|
|
|
|
D3DUtil_SetRotationMatrix(mat, dirD3D, angle);
|
|
|
|
oldMathResult = D3DMAT_TO_MAT(mat);
|
|
|
|
}
|
2012-06-15 14:58:04 +00:00
|
|
|
|
2012-06-26 20:23:05 +00:00
|
|
|
if (! Math::MatricesEqual(mathResult, oldMathResult, TEST_TOLERANCE))
|
|
|
|
return __LINE__;
|
2012-06-15 14:58:04 +00:00
|
|
|
|
2012-06-26 20:23:05 +00:00
|
|
|
return 0;
|
2012-06-15 14:58:04 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
int TestLoadRotationXZYMatrix()
|
|
|
|
{
|
2022-01-04 00:39:55 +00:00
|
|
|
const glm::vec3 angles(-0.841366567984597, -0.100543315396357, 1.610647811559988);
|
2012-06-15 14:58:04 +00:00
|
|
|
|
2012-06-26 20:23:05 +00:00
|
|
|
Math::Matrix mathResult;
|
|
|
|
Math::LoadRotationXZYMatrix(mathResult, angles);
|
2012-06-15 14:58:04 +00:00
|
|
|
|
2012-06-26 20:23:05 +00:00
|
|
|
Math::Matrix oldMathResult;
|
|
|
|
{
|
|
|
|
D3DMATRIX mat;
|
|
|
|
MatRotateXZY(mat, VEC_TO_D3DVEC(angles));
|
|
|
|
oldMathResult = D3DMAT_TO_MAT(mat);
|
|
|
|
}
|
2012-06-15 14:58:04 +00:00
|
|
|
|
2012-06-26 20:23:05 +00:00
|
|
|
if (! Math::MatricesEqual(mathResult, oldMathResult, TEST_TOLERANCE))
|
|
|
|
return __LINE__;
|
2012-06-15 14:58:04 +00:00
|
|
|
|
2012-06-26 20:23:05 +00:00
|
|
|
return 0;
|
2012-06-15 14:58:04 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
int TestLoadRotationZXYMatrix()
|
|
|
|
{
|
2022-01-04 00:39:55 +00:00
|
|
|
const glm::vec3 angles(0.275558495480206, -0.224328265970090, 0.943077216574253);
|
2012-06-15 14:58:04 +00:00
|
|
|
|
2012-06-26 20:23:05 +00:00
|
|
|
Math::Matrix mathResult;
|
|
|
|
Math::LoadRotationZXYMatrix(mathResult, angles);
|
2012-06-15 14:58:04 +00:00
|
|
|
|
2012-06-26 20:23:05 +00:00
|
|
|
Math::Matrix oldMathResult;
|
|
|
|
{
|
|
|
|
D3DMATRIX mat;
|
|
|
|
MatRotateZXY(mat, VEC_TO_D3DVEC(angles));
|
|
|
|
oldMathResult = D3DMAT_TO_MAT(mat);
|
|
|
|
}
|
2012-06-15 14:58:04 +00:00
|
|
|
|
2012-06-26 20:23:05 +00:00
|
|
|
if (! Math::MatricesEqual(mathResult, oldMathResult, TEST_TOLERANCE))
|
|
|
|
return __LINE__;
|
2012-06-15 14:58:04 +00:00
|
|
|
|
2012-06-26 20:23:05 +00:00
|
|
|
return 0;
|
2012-06-15 14:58:04 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
int TestTransform()
|
|
|
|
{
|
2012-06-26 20:23:05 +00:00
|
|
|
Math::Matrix transformMatrix(
|
|
|
|
(float[4][4])
|
|
|
|
{
|
|
|
|
{ -0.9282074720977896, 0.6794734970319730, -1.3234304946882685, 0.0925294727863890 },
|
|
|
|
{ -0.0395527963683484, 0.2897634352353881, 1.9144398570315440, -1.4062267508968478 },
|
|
|
|
{ 0.9133323625282361, -0.6741836434774530, -0.2188812951424338, -1.0089184339952666 },
|
|
|
|
{ 0.0f, 0.0f, 0.0f, 1.0f }
|
|
|
|
}
|
|
|
|
);
|
2022-01-04 00:39:55 +00:00
|
|
|
glm::vec3 vector(-0.314596433318370, -0.622681232583150, -0.371307535743574);
|
2012-06-26 20:23:05 +00:00
|
|
|
|
2022-01-04 00:39:55 +00:00
|
|
|
glm::vec3 mathResult = Math::Transform(transformMatrix, vector);
|
|
|
|
glm::vec3 oldMathResult = Transform(transformMatrix, vector);
|
2012-06-26 20:23:05 +00:00
|
|
|
|
|
|
|
if (! Math::VectorsEqual(mathResult, oldMathResult, TEST_TOLERANCE))
|
|
|
|
return __LINE__;
|
|
|
|
|
|
|
|
return 0;
|
2012-06-15 14:58:04 +00:00
|
|
|
}
|
|
|
|
|
2012-09-11 19:14:32 +00:00
|
|
|
*/
|
2012-06-12 11:48:17 +00:00
|
|
|
|