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:
@@ -117,7 +117,7 @@ namespace Nz
|
||||
|
||||
StackArray<Vector2f> nVertices = NazaraStackArray(Vector2f, vertexCount);
|
||||
for (int i = 0; i < vertexCount; ++i)
|
||||
nVertices[i].Set(float(vertices[i].x), float(vertices[i].y));
|
||||
nVertices[i] = Vector2f(float(vertices[i].x), float(vertices[i].y));
|
||||
|
||||
callback(nVertices.data(), nVertices.size());
|
||||
};
|
||||
@@ -282,7 +282,7 @@ namespace Nz
|
||||
{
|
||||
m_vertices.resize(vertexCount);
|
||||
for (std::size_t i = 0; i < vertexCount; ++i)
|
||||
m_vertices[i].Set(*vertices++);
|
||||
m_vertices[i] = Vector2<cpFloat>(*vertices++);
|
||||
}
|
||||
|
||||
Vector2f ChipmunkConvexCollider2D::ComputeCenterOfMass() const
|
||||
|
||||
Reference in New Issue
Block a user