rigidbody, forces and collision testing
This commit is contained in:
10
PhysicsEngine/Physics/Forces/DragForce.cs
Normal file
10
PhysicsEngine/Physics/Forces/DragForce.cs
Normal file
@@ -0,0 +1,10 @@
|
||||
namespace PhysicsEngine
|
||||
{
|
||||
public static class DragForce
|
||||
{
|
||||
public static void Apply(Body body, float dt)
|
||||
{
|
||||
body.ApplyAerodynamicDrag(dt);
|
||||
}
|
||||
}
|
||||
}
|
||||
4
PhysicsEngine/Physics/Forces/GlobalForce.cs
Normal file
4
PhysicsEngine/Physics/Forces/GlobalForce.cs
Normal file
@@ -0,0 +1,4 @@
|
||||
namespace PhysicsEngine
|
||||
{
|
||||
public delegate void GlobalForce(Body body, float dt);
|
||||
}
|
||||
12
PhysicsEngine/Physics/Forces/GravityForce.cs
Normal file
12
PhysicsEngine/Physics/Forces/GravityForce.cs
Normal file
@@ -0,0 +1,12 @@
|
||||
using System.Numerics;
|
||||
|
||||
namespace PhysicsEngine
|
||||
{
|
||||
public static class GravityForce
|
||||
{
|
||||
public static void Apply(Body body, float dt)
|
||||
{
|
||||
body.ApplyForce(Vector2.UnitY * 9.81f * body.Mass);
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user