Cleaned up implicit conversion and code.

pull/3249/head
Hanif Bin Ariffin 2020-05-28 19:22:06 -04:00
parent d4ca91f408
commit eceb8aeed1
1 changed files with 14 additions and 2 deletions

View File

@ -73,9 +73,21 @@ TEST_F(utMatrix3x3Test, FromToMatrixTest) {
aiVector3D from, to; aiVector3D from, to;
auto random_ratio = []() -> float {
return static_cast<float>(rand() / RAND_MAX);
};
for (int i = 0; i < NUM_SAMPLES; ++i) { for (int i = 0; i < NUM_SAMPLES; ++i) {
from = aiVector3D(1.f * rand() / RAND_MAX, 1.f * rand() / RAND_MAX, 1.f * rand() / RAND_MAX).Normalize(); from = aiVector3D(
to = aiVector3D(1.f * rand() / RAND_MAX, 1.f * rand() / RAND_MAX, 1.f * rand() / RAND_MAX).Normalize(); 1.f * random_ratio(),
1.f * random_ratio(),
1.f * random_ratio())
.Normalize();
to = aiVector3D(
1.f * random_ratio(),
1.f * random_ratio(),
1.f * random_ratio())
.Normalize();
aiMatrix3x3::FromToMatrix(from, to, trafo); aiMatrix3x3::FromToMatrix(from, to, trafo);
res = trafo * from; res = trafo * from;