Repository navigation
Closed
Labels
BugGlobal flag to mark a deviation from expected behaviour
Milestone
Description
The operator[] of matrix4x4 gives me nonsense values, probably from uninitialized memory. According to the comment in matrix4x4.inl:243, that's a known problem.
Code snippet that reproduces the problem:
aiMatrix4x4 transform = node->mTransformation;
std::cout << " BROKEN: " << std::endl
<< std::fixed
<< "[ " << *transform[0] << " \t" << *transform[1] << " \t" << *transform[2] << " \t" << *transform[3] << std::endl
<< " " << *transform[4] << " \t" << *transform[5] << " \t" << *transform[6] << " \t" << *transform[7] << std::endl
<< " " << *transform[8] << " \t" << *transform[9] << " \t" << *transform[10] << " \t" << *transform[11] << std::endl
<< " " << *transform[12] << " \t" << *transform[13] << " \t" << *transform[14] << " \t" << *transform[15] << " ]" << std::endl<std::endl;
std::cout << " WORKING:" << std::endl
<< std::fixed
<< "[ " << transform.a1 << " \t" << transform.a2 << " \t" << transform.a3 << " \t" << transform.a4 << std::endl
<< " " << transform.b1 << " \t" << transform.b2 << " \t" << transform.b3 << " \t" << transform.b4 << std::endl
<< " " << transform.c1 << " \t" << transform.c2 << " \t" << transform.c3 << " \t" << transform.c4 << std::endl
<< " " << transform.d1 << " \t" << transform.d2 << " \t" << transform.d3 << " \t" << transform.d4 << " ]" << std::endl;
Output:
BROKEN:
[ 1.000000 0.000000 0.000000 0.000000
-6383549033750467933401407029248.000000 -6383573212266860225984901152768.000000 -322887.250000 -322887.281250
-322889.093750 -6444387016696754531989320630272.000000 -322887.250000 0.000000
0.000000 0.000000 0.000000 0.000000 ]
WORKING:
[ 1.000000 0.000000 0.000000 0.000000
0.000000 1.000000 0.000000 0.000000
0.000000 0.000000 1.000000 0.000000
0.000000 0.000000 0.000000 1.000000 ]
Metadata
Metadata
Assignees
Labels
BugGlobal flag to mark a deviation from expected behaviour
Activity
mintar commentedon Nov 6, 2015
Some system information:
kimkulling commentedon Nov 6, 2015
Thanks a lot for the report, I will fix that issue!
kimkulling commentedon Nov 7, 2015
Checked this: the []-operator will return a pointer showing to the first entry of the row of the matrix. I added a test to show this.
You can use it as following:
/issues/685: add test for correct usage.
Fix log output of assimp transforms
mintar commentedon Nov 10, 2015
Ah, so the bug was on my side. Thanks for checking!
kimkulling commentedon Nov 10, 2015
You will get a NULL in case of a misuse.
Update CMakeLists.txt
Update CMakeLists.txt (#5379)
Update CMakeLists.txt (#5379)