ChipmunkPhysics2D/RigidBody2D: Add ToLocal/ToWorld methods

This commit is contained in:
SirLynix
2023-08-12 12:11:24 +02:00
parent 1ef61cc5ad
commit 65a1c195ac
4 changed files with 78 additions and 10 deletions

View File

@@ -0,0 +1,20 @@
// Copyright (C) 2023 Jérôme "Lynix" Leclercq (lynix680@gmail.com)
// This file is part of the "Nazara Engine - ChipmunkPhysics2D module"
// For conditions of distribution and use, see copyright notice in Config.hpp
#include <Nazara/ChipmunkPhysics2D/Debug.hpp>
namespace Nz
{
inline Vector2f FromChipmunk(const cpVect& vect)
{
return { float(vect.x), float(vect.y) };
}
inline cpVect ToChipmunk(const Vector2f& vec)
{
return cpv(cpFloat(vec.x), cpFloat(vec.y));
}
}
#include <Nazara/ChipmunkPhysics2D/DebugOff.hpp>