Physics System Documentation

Detailed technical documentation for AetherEngine's advanced physics simulation.

Aerodynamic Force Calculation

                
AeroForces Aerodynamics::ComputeForces(
    const Vec3& v,
    const Vec3& n,
    float area,
    float density,
    float flex)
{
    float speed = v.Length();
    float angle = acos(Clamp(Dot(Normalize(v), n), -1.0f, 1.0f));

    // Classic aerodynamic lift model
    float liftCoeff = sin(angle * 2.0f) * (1.0f + flex);
    float dragCoeff = 0.02f + 0.3f * pow(sin(angle), 2.0f);

    Vec3 lift = Cross(Cross(v, n), v).Normalized() * liftCoeff * speed * speed * area * density;
    Vec3 drag = -Normalize(v) * dragCoeff * speed * speed * area * density;

    // Turbulence: procedural noise + thermal updrafts
    Vec3 turbulence = Vec3(
        PerlinNoise3D(v * 0.1f),
        PerlinNoise3D(v * 0.1f + 10),
        PerlinNoise3D(v * 0.1f + 20)
    ) * flex * 0.5f;

    return { lift, drag, turbulence };
}
            

Parameters

  • v: Velocity vector (m/s)
  • n: Surface normal vector
  • area: Wing area (m²)
  • density: Air density (kg/m³)
  • flex: Wing flexibility coefficient

Returns

  • lift: Lift force vector (N)
  • drag: Drag force vector (N)
  • turbulence: Turbulence vector (N)

Key Concepts

Lift Calculation

Lift is calculated using the cross product of velocity and surface normal vectors, scaled by the sine of the angle of attack and wing flexibility. The classic aerodynamic equation (L = ½ρv²ACₗ) is implemented with real-world coefficients.

Drag Modeling

The drag model combines parasitic and induced drag components, with coefficients that vary based on angle of attack. The equation (D = ½ρv²ACₔ) includes both form drag and skin friction components.

Turbulence Simulation

Procedural Perlin noise generates realistic turbulence patterns that affect flight stability. The intensity scales with wing flexibility and includes simulated thermal updrafts for dynamic soaring behavior.

Live Demos