birb stab
This commit is contained in:
parent
00b76b6b25
commit
96bec5a6b7
11 changed files with 309 additions and 120 deletions
25
src/physics/Physics.cs
Normal file
25
src/physics/Physics.cs
Normal file
|
|
@ -0,0 +1,25 @@
|
|||
namespace Dancer;
|
||||
|
||||
public static class Physics
|
||||
{
|
||||
public const float PixelsPerMeter = 8f;
|
||||
public const float PixelsPerMeterSquared = PixelsPerMeter * PixelsPerMeter;
|
||||
|
||||
public static Vector2 DragForce(Vector2 flowVelocity, float dragAmount = 0.01f)
|
||||
{
|
||||
return flowVelocity * flowVelocity.Abs() * dragAmount;
|
||||
}
|
||||
|
||||
public static float DragAmount(float area = 1f, float dragCoefficient = 1.17f,
|
||||
float fluidMassDensity = 1.2f / PixelsPerMeterSquared)
|
||||
{
|
||||
return 0.5f * fluidMassDensity * area * dragCoefficient;
|
||||
}
|
||||
}
|
||||
|
||||
public static class Extensions
|
||||
{
|
||||
extension(CharacterBody2D body)
|
||||
{
|
||||
}
|
||||
}
|
||||
1
src/physics/Physics.cs.uid
Normal file
1
src/physics/Physics.cs.uid
Normal file
|
|
@ -0,0 +1 @@
|
|||
uid://cxqgafpm35er5
|
||||
Loading…
Add table
Add a link
Reference in a new issue