General bug fixes (#142)

* Core/Bitset: Fix TestAll method

* Fix documentation

* Fix color and their conversions

* Core/ByteStream: Fix return of Write

* Fix compiler warnings

* Math/Algorithm: Fix angle normalization

* Math/BoundingVolume: Fix lerp

* Math: Fix relation between Matrix4 and Quaternion

* More tests

* X11/Window: Fix mouse moved event generated when doing Mouse::SetPosition

* Update ChangeLog

* Should fix compilation on Windows

* Should fix compilation on Windows

Forgot to include array for Windows
This commit is contained in:
Gawaboumga
2017-11-21 12:16:46 +01:00
committed by Jérôme Leclercq
parent f2506ee918
commit f991a9529e
52 changed files with 1287 additions and 272 deletions

View File

@@ -26,14 +26,14 @@ namespace Nz
auto drawOptions = static_cast<PhysWorld2D::DebugDrawOptions*>(userdata);
if (drawOptions->circleCallback)
drawOptions->circleCallback(Vector2f(float(pos.x), float(pos.y)), float(angle), float(radius), CpDebugColorToColor(outlineColor), CpDebugColorToColor(fillColor), drawOptions->userdata);
};
}
void DrawDot(cpFloat size, cpVect pos, cpSpaceDebugColor color, cpDataPointer userdata)
{
auto drawOptions = static_cast<PhysWorld2D::DebugDrawOptions*>(userdata);
if (drawOptions->dotCallback)
drawOptions->dotCallback(Vector2f(float(pos.x), float(pos.y)), float(size), CpDebugColorToColor(color), drawOptions->userdata);
};
}
using DebugDrawPolygonCallback = std::function<void(const Vector2f* vertices, std::size_t vertexCount, float radius, Color outlineColor, Color fillColor, void* userdata)>;
@@ -50,21 +50,21 @@ namespace Nz
drawOptions->polygonCallback(nVertices.data(), vertexCount, float(radius), CpDebugColorToColor(outlineColor), CpDebugColorToColor(fillColor), drawOptions->userdata);
}
};
}
void DrawSegment(cpVect a, cpVect b, cpSpaceDebugColor color, cpDataPointer userdata)
{
auto drawOptions = static_cast<PhysWorld2D::DebugDrawOptions*>(userdata);
if (drawOptions->segmentCallback)
drawOptions->segmentCallback(Vector2f(float(a.x), float(a.y)), Vector2f(float(b.x), float(b.y)), CpDebugColorToColor(color), drawOptions->userdata);
};
}
void DrawThickSegment(cpVect a, cpVect b, cpFloat radius, cpSpaceDebugColor outlineColor, cpSpaceDebugColor fillColor, cpDataPointer userdata)
{
auto drawOptions = static_cast<PhysWorld2D::DebugDrawOptions*>(userdata);
if (drawOptions->thickSegmentCallback)
drawOptions->thickSegmentCallback(Vector2f(float(a.x), float(a.y)), Vector2f(float(b.x), float(b.y)), float(radius), CpDebugColorToColor(outlineColor), CpDebugColorToColor(fillColor), drawOptions->userdata);
};
}
cpSpaceDebugColor GetColorForShape(cpShape* shape, cpDataPointer userdata)
{
@@ -76,7 +76,7 @@ namespace Nz
}
else
return cpSpaceDebugColor{255.f, 0.f, 0.f, 255.f};
};
}
}
PhysWorld2D::PhysWorld2D() :

View File

@@ -55,8 +55,8 @@ namespace Nz
OnRigidBody2DRelease(std::move(object.OnRigidBody2DRelease)),
m_shapes(std::move(object.m_shapes)),
m_geom(std::move(object.m_geom)),
m_userData(object.m_userData),
m_handle(object.m_handle),
m_userData(object.m_userData),
m_world(object.m_world),
m_isStatic(object.m_isStatic),
m_gravityFactor(object.m_gravityFactor),