forked from Mirrorlandia_minetest/minetest
Optimize trigonometry out of MapblockMeshGenerator::drawCuboid
This commit is contained in:
parent
c29d897854
commit
d676520526
@ -200,29 +200,29 @@ static std::array<video::S3DVertex, 24> setupCuboidVertices(const aabb3f &box, c
|
|||||||
case 0:
|
case 0:
|
||||||
break;
|
break;
|
||||||
case 1: // R90
|
case 1: // R90
|
||||||
tcoords.rotateBy(90, irr::core::vector2df(0, 0));
|
tcoords.set(-tcoords.Y, tcoords.X);
|
||||||
break;
|
break;
|
||||||
case 2: // R180
|
case 2: // R180
|
||||||
tcoords.rotateBy(180, irr::core::vector2df(0, 0));
|
tcoords.set(-tcoords.X, -tcoords.Y);
|
||||||
break;
|
break;
|
||||||
case 3: // R270
|
case 3: // R270
|
||||||
tcoords.rotateBy(270, irr::core::vector2df(0, 0));
|
tcoords.set(tcoords.Y, -tcoords.X);
|
||||||
break;
|
break;
|
||||||
case 4: // FXR90
|
case 4: // FXR90
|
||||||
tcoords.X = 1.0 - tcoords.X;
|
tcoords.X = 1.0 - tcoords.X;
|
||||||
tcoords.rotateBy(90, irr::core::vector2df(0, 0));
|
tcoords.set(-tcoords.Y, tcoords.X);
|
||||||
break;
|
break;
|
||||||
case 5: // FXR270
|
case 5: // FXR270
|
||||||
tcoords.X = 1.0 - tcoords.X;
|
tcoords.X = 1.0 - tcoords.X;
|
||||||
tcoords.rotateBy(270, irr::core::vector2df(0, 0));
|
tcoords.set(tcoords.Y, -tcoords.X);
|
||||||
break;
|
break;
|
||||||
case 6: // FYR90
|
case 6: // FYR90
|
||||||
tcoords.Y = 1.0 - tcoords.Y;
|
tcoords.Y = 1.0 - tcoords.Y;
|
||||||
tcoords.rotateBy(90, irr::core::vector2df(0, 0));
|
tcoords.set(-tcoords.Y, tcoords.X);
|
||||||
break;
|
break;
|
||||||
case 7: // FYR270
|
case 7: // FYR270
|
||||||
tcoords.Y = 1.0 - tcoords.Y;
|
tcoords.Y = 1.0 - tcoords.Y;
|
||||||
tcoords.rotateBy(270, irr::core::vector2df(0, 0));
|
tcoords.set(tcoords.Y, -tcoords.X);
|
||||||
break;
|
break;
|
||||||
case 8: // FX
|
case 8: // FX
|
||||||
tcoords.X = 1.0 - tcoords.X;
|
tcoords.X = 1.0 - tcoords.X;
|
||||||
|
Loading…
Reference in New Issue
Block a user