Class Engine<T>

A generic Physics Engine that may be specialized to a metric.

Type Parameters

  • T

Hierarchy (view full)

Constructors

  • Type Parameters

    • T

    Parameters

    • metric: Metric<T>
    • kinematics: Kinematics<T>
    • Optional options: Partial<EngineOptions>

    Returns Engine<T>

Accessors

  • get speedOfLight(): T
  • The speed of light. For dimensionless simulations this will default to 1. For S.I. Units, the speed of light may be set.

    Returns T

  • set speedOfLight(speedOfLight): void
  • Parameters

    • speedOfLight: T

    Returns void

Methods

  • Adds a body to the system. The state variables of the body will become part of the state vector of the system. The state variables of the body will be updated each time the system is advanced in time.

    Parameters

    • body: ForceBody<T>

      The body to be added to the system

    Returns void

  • Adds a geometric constraint to the system. Geometric constraints are applied after the force and torques have been computed and before drift forces and torques.

    Parameters

    • geometry: GeometricConstraint<T>

      The geometric constraint to be added to the system.

    Returns void

  • Adds a force law that is designed to compensate for numerical drift in the system. A drift law is usually small and may take the form of a spring and/or damping force. The drift laws are applied after any geometric constraints have been applied.

    Parameters

    • driftLaw: ForceLaw<T>

      The drift force law to be applied.

    Returns void

  • Adds a force law to the system.

    Parameters

    • forceLaw: ForceLaw<T>

      The force law to be added to the system.

    Returns void

  • Adds a torque law to the system.

    Parameters

    • torqueLaw: TorqueLaw<T>

      The torque law to be added to the system.

    Returns void

  • Advances the Physics model by the specified time interval, Δt * uomTime.

    Parameters

    • Δt: number

      The time interval.

    • Optional uomTime: Unit

      The optional unit of measure for the time interval.

    Returns void

  • Removes a body from the system.

    Parameters

    • body: ForceBody<T>

      The body to be removed from the system.

    Returns void

  • Removes a geometric constraint from the system.

    Parameters

    • geometry: GeometricConstraint<T>

      The geometric constraint to be removed from the system.

    Returns void

  • Removes a force law that is designed to compensate for numerical drift in the system.

    Parameters

    • driftLaw: ForceLaw<T>

      The drift force law to be removed.

    Returns void

  • Removes a force law from the system.

    Parameters

    • forceLaw: ForceLaw<T>

      The force law to be removed.

    Returns void

  • Removes a torque law from the system.

    Parameters

    • torqueLaw: TorqueLaw<T>

      The torque law to be removed from the system.

    Returns void

  • Updates the state vector of the simulation from the states of the bodies in the system. It is necessary to call this method after an intervention which changes the state of a body in the system.

    Returns void

Generated using TypeDoc