mirror of
https://github.com/minetest/irrlicht.git
synced 2024-12-25 18:20:30 +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)
|
||||
cnt = (u32)arraySize;
|
||||
|
||||
core::matrix4 mat;
|
||||
core::matrix4 mat(core::matrix4::EM4CONST_NOTHING);
|
||||
if (transform)
|
||||
{
|
||||
mat = *transform;
|
||||
if (SceneNode&&useNodeTransform)
|
||||
mat *= SceneNode->getAbsoluteTransformation();
|
||||
if (SceneNode && useNodeTransform)
|
||||
mat *= SceneNode->getAbsoluteTransformation();
|
||||
}
|
||||
else if (SceneNode && useNodeTransform)
|
||||
mat = SceneNode->getAbsoluteTransformation();
|
||||
else
|
||||
mat.makeIdentity();
|
||||
|
||||
for (u32 i=0; i<cnt; ++i)
|
||||
{
|
||||
@ -338,11 +344,15 @@ void CTriangleSelector::getTriangles(core::triangle3df* triangles,
|
||||
|
||||
core::matrix4 mat(core::matrix4::EM4CONST_NOTHING);
|
||||
if (transform)
|
||||
{
|
||||
mat = *transform;
|
||||
if (SceneNode && useNodeTransform)
|
||||
mat *= SceneNode->getAbsoluteTransformation();
|
||||
}
|
||||
else if (SceneNode && useNodeTransform)
|
||||
mat = SceneNode->getAbsoluteTransformation();
|
||||
else
|
||||
mat.makeIdentity();
|
||||
if (SceneNode && useNodeTransform)
|
||||
mat *= SceneNode->getAbsoluteTransformation();
|
||||
|
||||
core::aabbox3df tBox(box);
|
||||
core::matrix4 invMat(core::matrix4::EM4CONST_NOTHING);
|
||||
|
@ -1,4 +1,4 @@
|
||||
Tests finished. 72 tests of 72 passed.
|
||||
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