Merge remote-tracking branch 'refs/remotes/origin/master' into enet_wip_nothing_to_see_here
This commit is contained in:
commit
658faf3d49
|
|
@ -86,7 +86,7 @@ ACTION.Function = function ()
|
|||
local exeFilterFunc
|
||||
if (os.is("windows")) then
|
||||
binFileMasks = {"**.dll"}
|
||||
libFileMasks = {"**.lib", "**.a"}
|
||||
libFileMasks = {"**.lib", "**.a", "**.pdb"}
|
||||
exeFileExt = ".exe"
|
||||
exeFilterFunc = function (filePath) return true end
|
||||
else
|
||||
|
|
|
|||
|
|
@ -34,6 +34,8 @@ namespace Nz
|
|||
|
||||
void AddForce(const Vector2f& force, CoordSys coordSys = CoordSys_Global);
|
||||
void AddForce(const Vector2f& force, const Vector2f& point, CoordSys coordSys = CoordSys_Global);
|
||||
void AddImpulse(const Vector2f& impulse, CoordSys coordSys = CoordSys_Global);
|
||||
void AddImpulse(const Vector2f& impulse, const Vector2f& point, CoordSys coordSys = CoordSys_Global);
|
||||
void AddTorque(float torque);
|
||||
|
||||
Rectf GetAABB() const;
|
||||
|
|
|
|||
|
|
@ -93,6 +93,25 @@ namespace Nz
|
|||
}
|
||||
}
|
||||
|
||||
void RigidBody2D::AddImpulse(const Vector2f& impulse, CoordSys coordSys)
|
||||
{
|
||||
return AddImpulse(impulse, GetCenterOfGravity(coordSys), coordSys);
|
||||
}
|
||||
|
||||
void RigidBody2D::AddImpulse(const Vector2f& impulse, const Vector2f& point, CoordSys coordSys)
|
||||
{
|
||||
switch (coordSys)
|
||||
{
|
||||
case CoordSys_Global:
|
||||
cpBodyApplyImpulseAtWorldPoint(m_handle, cpv(impulse.x, impulse.y), cpv(point.x, point.y));
|
||||
break;
|
||||
|
||||
case CoordSys_Local:
|
||||
cpBodyApplyImpulseAtLocalPoint(m_handle, cpv(impulse.x, impulse.y), cpv(point.x, point.y));
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
void RigidBody2D::AddTorque(float torque)
|
||||
{
|
||||
cpBodySetTorque(m_handle, cpBodyGetTorque(m_handle) + torque);
|
||||
|
|
|
|||
Loading…
Reference in New Issue