mirror of
https://github.com/minetest/irrlicht.git
synced 2024-11-15 23:10:26 +01:00
Bugfix: CTriangleSelector::getTriangles with bbox no longer ignores transform matrix
So far it only used the inverse of the node transformation to calculate the box used to check Which gave wrong results as soon as one tried to pass an additional matrix transformation Wasn't ever used internally or by examples in Irrlicht, so I guess no one ever noticed (also in some cases this still worked accidentally). git-svn-id: svn://svn.code.sf.net/p/irrlicht/code/trunk@6577 dfc29bdd-3216-0410-991c-e03cc46cb475
This commit is contained in:
parent
952f11f806
commit
66d189ce63
|
@ -1,6 +1,7 @@
|
|||
--------------------------
|
||||
Changes in 1.9 (not yet released)
|
||||
|
||||
- Bugfix: CTriangleSelector::getTriangles with bounding-box parameter no longer ignores an additionally passed matrix transformation in the box check
|
||||
- Fix: CGUITabControl now catching EMIE_LMOUSE_PRESSED_DOWN
|
||||
- Add options for transparency node sorting algorithm.
|
||||
- CImageWriterPNG now also supports the writeImageToFile param to allow setting compressing level. 0 stays default, 1-10 for range increasing compression level.
|
||||
|
|
|
@ -337,12 +337,19 @@ void CTriangleSelector::getTriangles(core::triangle3df* triangles,
|
|||
update();
|
||||
|
||||
core::matrix4 mat(core::matrix4::EM4CONST_NOTHING);
|
||||
core::aabbox3df tBox(box);
|
||||
|
||||
if (transform)
|
||||
mat = *transform;
|
||||
else
|
||||
mat.makeIdentity();
|
||||
if (SceneNode && useNodeTransform)
|
||||
mat *= SceneNode->getAbsoluteTransformation();
|
||||
|
||||
core::aabbox3df tBox(box);
|
||||
core::matrix4 invMat(core::matrix4::EM4CONST_NOTHING);
|
||||
if ( mat.getInverse(invMat) )
|
||||
{
|
||||
if ( SceneNode->getAbsoluteTransformation().getInverse(mat) )
|
||||
mat.transformBoxEx(tBox);
|
||||
invMat.transformBoxEx(tBox);
|
||||
}
|
||||
else
|
||||
{
|
||||
// TODO: else is not yet handled optimally.
|
||||
|
@ -350,13 +357,6 @@ void CTriangleSelector::getTriangles(core::triangle3df* triangles,
|
|||
return getTriangles(triangles, arraySize, outTriangleCount,
|
||||
transform, useNodeTransform, outTriangleInfo );
|
||||
}
|
||||
}
|
||||
if (transform)
|
||||
mat = *transform;
|
||||
else
|
||||
mat.makeIdentity();
|
||||
if (SceneNode && useNodeTransform)
|
||||
mat *= SceneNode->getAbsoluteTransformation();
|
||||
|
||||
outTriangleCount = 0;
|
||||
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
Tests finished. 72 tests of 72 passed.
|
||||
Compiled as DEBUG
|
||||
Test suite pass at GMT Wed Nov 22 14:39:17 2023
|
||||
Test suite pass at GMT Wed Dec 13 14:06:37 2023
|
||||
|
||||
|
|
Loading…
Reference in New Issue
Block a user