Package jsim.forces

Interface ForceGenerator

All Known Implementing Classes:
ActuatorForce, DragForce, GravityForce, MagnusForce
Functional Interface:
This is a functional interface and can therefore be used as the assignment target for a lambda expression or method reference.

@FunctionalInterface public interface ForceGenerator
A source of continuous force or torque applied to one or more bodies each tick.

Implementations call RigidBody.applyForce(double, double, double) and/or RigidBody.applyTorque(double, double, double) directly. The world invokes apply(double) on every registered generator after clearing accumulators and before running broadphase.

  • Method Summary

    Modifier and Type
    Method
    Description
    void
    apply(double dt)
    Apply forces/torques to whichever bodies this generator influences.
  • Method Details

    • apply

      void apply(double dt)
      Apply forces/torques to whichever bodies this generator influences.
      Parameters:
      dt - the fixed simulation timestep in seconds