mirror of
https://github.com/minetest/irrlicht.git
synced 2024-12-26 02:30:31 +01:00
Can often copy instead of multiply matrix in CTriangleSelector
If we already know we start with an identity matrix (which is usually the case) then copy will do. Also unifying code to create matrix of different CTriangleSelector::getTriangles functions git-svn-id: svn://svn.code.sf.net/p/irrlicht/code/trunk@6578 dfc29bdd-3216-0410-991c-e03cc46cb475
This commit is contained in:
parent
66d189ce63
commit
70b2e3a255
@ -272,11 +272,17 @@ void CTriangleSelector::getTriangles(core::triangle3df* triangles,
|
|||||||
if (cnt > (u32)arraySize)
|
if (cnt > (u32)arraySize)
|
||||||
cnt = (u32)arraySize;
|
cnt = (u32)arraySize;
|
||||||
|
|
||||||
core::matrix4 mat;
|
core::matrix4 mat(core::matrix4::EM4CONST_NOTHING);
|
||||||
if (transform)
|
if (transform)
|
||||||
|
{
|
||||||
mat = *transform;
|
mat = *transform;
|
||||||
if (SceneNode&&useNodeTransform)
|
if (SceneNode && useNodeTransform)
|
||||||
mat *= SceneNode->getAbsoluteTransformation();
|
mat *= SceneNode->getAbsoluteTransformation();
|
||||||
|
}
|
||||||
|
else if (SceneNode && useNodeTransform)
|
||||||
|
mat = SceneNode->getAbsoluteTransformation();
|
||||||
|
else
|
||||||
|
mat.makeIdentity();
|
||||||
|
|
||||||
for (u32 i=0; i<cnt; ++i)
|
for (u32 i=0; i<cnt; ++i)
|
||||||
{
|
{
|
||||||
@ -338,11 +344,15 @@ void CTriangleSelector::getTriangles(core::triangle3df* triangles,
|
|||||||
|
|
||||||
core::matrix4 mat(core::matrix4::EM4CONST_NOTHING);
|
core::matrix4 mat(core::matrix4::EM4CONST_NOTHING);
|
||||||
if (transform)
|
if (transform)
|
||||||
|
{
|
||||||
mat = *transform;
|
mat = *transform;
|
||||||
|
if (SceneNode && useNodeTransform)
|
||||||
|
mat *= SceneNode->getAbsoluteTransformation();
|
||||||
|
}
|
||||||
|
else if (SceneNode && useNodeTransform)
|
||||||
|
mat = SceneNode->getAbsoluteTransformation();
|
||||||
else
|
else
|
||||||
mat.makeIdentity();
|
mat.makeIdentity();
|
||||||
if (SceneNode && useNodeTransform)
|
|
||||||
mat *= SceneNode->getAbsoluteTransformation();
|
|
||||||
|
|
||||||
core::aabbox3df tBox(box);
|
core::aabbox3df tBox(box);
|
||||||
core::matrix4 invMat(core::matrix4::EM4CONST_NOTHING);
|
core::matrix4 invMat(core::matrix4::EM4CONST_NOTHING);
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
Tests finished. 72 tests of 72 passed.
|
Tests finished. 72 tests of 72 passed.
|
||||||
Compiled as DEBUG
|
Compiled as DEBUG
|
||||||
Test suite pass at GMT Wed Dec 13 14:06:37 2023
|
Test suite pass at GMT Wed Dec 13 15:00:54 2023
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user