An object that provides information about its energy state via an EnergyInfo instance.

Potential Energy Offset

It is only changes in potential energy that are meaningful. We can add a constant to the potential energy of a system, and still see the same pattern of changes.

It is often desirable that potential energy be in a specific numerical range. For example, we might want an object resting on the ground to have zero potential energy.

The potential energy reported in getEnergyInfo is the sum of the calculated potential energy and the constant potential energy offset. See setPEOffset.

interface EnergySystem {
    getEnergyInfo(): EnergyInfo;
    getPEOffset(): number;
    setPEOffset(value): void;
    toStringShort(): string;
}

Hierarchy (view full)

Implemented by

Methods

  • Sets the potential energy offset.

    Parameters

    • value: number

      the potential energy offset

    Returns void

  • Returns a minimal string representation of this object, usually giving just identity information like the class name and name of the object.

    For an object whose main purpose is to represent another Printable object, it is recommended to include the result of calling toStringShort on that other object. For example, calling toStringShort() on a DisplayShape might return something like this:

    DisplayShape{polygon:Polygon{'chain3'}}
    

    Returns string

    a minimal string representation of this object.

Generated using TypeDoc