nocontrolco / elso

Electric Lightning Soccer Overdrive
GNU General Public License v3.0
0 stars 0 forks source link

Implement ball physics #1

Open diasssavio opened 2 months ago

diasssavio commented 2 months ago

One should implement the Free Body motion physics into the ball object interacting with the arena.

diasssavio commented 2 months ago
  1. Force and Moment Equations:

    • Apply Newton's second law (ΣF = ma) to the center of mass: ΣF = m * (d²x/dt², d²y/dt², d²z/dt²) (sum of forces equals mass times acceleration)
    • Apply Euler's equation (Στ = I α) for rotational motion: Στ = I (dω/dt + ω x ω) (sum of moments equals inertia tensor times angular acceleration, with ω x ω representing the centrifugal and Coriolis terms)
  2. Contact Forces and Impulses:

    • Introduce contact force (Fc) acting at the contact point between the sphere and the wall.
    • Depending on the nature of the collision (elastic/inelastic), you might need to consider impulse-momentum equations.
  3. Friction:

    • If there's friction between the sphere and the wall, a tangential force (Ff) needs to be included that opposes the relative motion. The magnitude of Ff depends on the normal force (Fc) and the coefficient of friction (μ).