Merge branch 'master' into 2d-angles
This commit is contained in:
commit
702b0cb7a4
|
|
@ -126,7 +126,7 @@ SCENARIO("RigidBody2D", "[PHYSICS2D][RIGIDBODY2D]")
|
|||
{
|
||||
CHECK(body.GetAABB() == aabb);
|
||||
CHECK(body.GetAngularVelocity() == Approx(0.f));
|
||||
CHECK(body.GetCenterOfGravity() == Nz::Vector2f::Zero());
|
||||
CHECK(body.GetMassCenter() == Nz::Vector2f::Zero());
|
||||
CHECK(body.GetGeom() == box);
|
||||
CHECK(body.GetMass() == Approx(mass));
|
||||
CHECK(body.GetPosition() == position);
|
||||
|
|
@ -150,7 +150,7 @@ SCENARIO("RigidBody2D", "[PHYSICS2D][RIGIDBODY2D]")
|
|||
{
|
||||
aabb.Translate(velocity);
|
||||
CHECK(body.GetAABB() == aabb);
|
||||
CHECK(body.GetCenterOfGravity() == Nz::Vector2f::Zero());
|
||||
CHECK(body.GetMassCenter() == Nz::Vector2f::Zero());
|
||||
CHECK(body.GetPosition() == position);
|
||||
CHECK(body.GetVelocity() == velocity);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -38,7 +38,7 @@ SCENARIO("PhysicsSystem2D", "[NDK][PHYSICSSYSTEM2D]")
|
|||
WHEN("We make it collide with a wall")
|
||||
{
|
||||
int rawDistance = 3;
|
||||
Nz::Vector2f distance(rawDistance, 0.f);
|
||||
Nz::Vector2f distance(float(rawDistance), 0.f);
|
||||
Nz::Vector2f wallPosition = position + Nz::Vector2f(movingAABB.width, 0.f) + distance;
|
||||
Nz::Rectf wallAABB(0.f, 0.f, 100.f, 100.f);
|
||||
Ndk::EntityHandle wallEntity = CreateBaseEntity(world, wallPosition, wallAABB);
|
||||
|
|
|
|||
|
|
@ -6,7 +6,7 @@
|
|||
#include <Nazara/Graphics/Sprite.hpp>
|
||||
#include <Catch/catch.hpp>
|
||||
|
||||
void CompareAABB(const Nz::Rectf& aabb, const Nz::BoundingVolumef& boundingVolume);
|
||||
void CompareAABB(const Nz::Rectf& aabb, const Nz::Boxf& box);
|
||||
|
||||
SCENARIO("RenderSystem", "[NDK][RenderSystem]")
|
||||
{
|
||||
|
|
@ -110,9 +110,8 @@ SCENARIO("RenderSystem", "[NDK][RenderSystem]")
|
|||
}
|
||||
}
|
||||
|
||||
void CompareAABB(const Nz::Rectf& aabb, const Nz::BoundingVolumef& boundingVolume)
|
||||
void CompareAABB(const Nz::Rectf& aabb, const Nz::Boxf& box)
|
||||
{
|
||||
Nz::Boxf box = boundingVolume.aabb;
|
||||
CHECK(aabb.x == Approx(box.x));
|
||||
CHECK(aabb.y == Approx(box.y));
|
||||
CHECK(aabb.width == Approx(box.width));
|
||||
|
|
|
|||
Loading…
Reference in New Issue