Improve math module (#396)
* Improve math module - Mark almost everything constexpr - Equality (a == b) is now exact, down to the bit level. If you want approximate equality use the new ApproxEqual method/static method - Rename Nz::Extend to Nz::Extent - Removed Make[] and Set[] methods in favor of their static counterpart and operator=
This commit is contained in:
@@ -206,7 +206,7 @@ namespace Nz
|
||||
m_vertices[offset].position = glyph.corners[cornerIndex];
|
||||
m_vertices[offset].position.y = bounds.height - m_vertices[offset].position.y;
|
||||
m_vertices[offset].position *= scale;
|
||||
m_vertices[offset].uv.Set(uvRect.GetCorner((glyph.flipped) ? flippedCorners[cornerIndex] : normalCorners[cornerIndex]));
|
||||
m_vertices[offset].uv = uvRect.GetCorner((glyph.flipped) ? flippedCorners[cornerIndex] : normalCorners[cornerIndex]);
|
||||
offset++;
|
||||
}
|
||||
|
||||
|
||||
@@ -143,9 +143,9 @@ namespace Nz
|
||||
|
||||
Vector3f tileLeftBottom;
|
||||
if (m_isometricModeEnabled)
|
||||
tileLeftBottom.Set(x * m_tileSize.x + m_tileSize.x / 2.f * (y % 2), topCorner - y / 2.f * m_tileSize.y, 0.f);
|
||||
tileLeftBottom = Vector3f(x * m_tileSize.x + m_tileSize.x / 2.f * (y % 2), topCorner - y / 2.f * m_tileSize.y, 0.f);
|
||||
else
|
||||
tileLeftBottom.Set(x * m_tileSize.x, topCorner - y * m_tileSize.y, 0.f);
|
||||
tileLeftBottom = Vector3f(x * m_tileSize.x, topCorner - y * m_tileSize.y, 0.f);
|
||||
|
||||
for (RectCorner corner : { RectCorner::LeftBottom, RectCorner::RightBottom, RectCorner::LeftTop, RectCorner::RightTop })
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user