rigidbody, forces and collision testing
This commit is contained in:
24
PhysicsEngine/Physics/Constraints/Constraint.cs
Normal file
24
PhysicsEngine/Physics/Constraints/Constraint.cs
Normal file
@@ -0,0 +1,24 @@
|
||||
using System.Numerics;
|
||||
|
||||
namespace PhysicsEngine
|
||||
{
|
||||
public abstract class Constraint
|
||||
{
|
||||
public Body BodyA;
|
||||
public Body BodyB;
|
||||
public Vector2 LocalAnchorA;
|
||||
public Vector2 LocalAnchorB;
|
||||
|
||||
public Vector2 GetWorldAnchorA()
|
||||
{
|
||||
return BodyA.Position + LocalAnchorA;
|
||||
}
|
||||
|
||||
public Vector2 GetWorldAnchorB()
|
||||
{
|
||||
return BodyB.Position + LocalAnchorB;
|
||||
}
|
||||
|
||||
public abstract void Solve();
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user