search

Interface myphysicslab.lab.model.SimObject

Provided By
All Extended Interfaces
All Known Subinterfaces
All Known Implementations

An object in a Simulation which can be displayed. The purpose of SimObjects is two-fold:

  1. to give the outside world a view of what is going on in the Simulation.

  2. SimObjects are often used in a Simulation's internal calculations.

A set of SimObjects are usually stored in a myphysicslab.lab.model.SimList; the SimObjects represent the current state of the Simulation. For an ODESim the current state is dictated by the VarsList and the SimObjects reflect that state in their positions. The SimObjects give additional information that is not in the VarsList, such as size, shape, and mass of objects, or they can show forces or anchor objects. SimObjects only reflect the current state after the myphysicslab.lab.model.Simulation#modifyObjects method is called.

See myphysicslab.lab.view.DisplayObject for a discussion of how SimObjects are made visible to the user.

A SimObject has an expiration time so that we can add temporary objects, representing things like forces or collision impact, and set the time at which they should be removed from the simulation display. Permanent SimObjects have infinite expiration time. See #getExpireTime.

Although SimObject has the method #getMass defined on it, all SimObjects should return zero for their mass unless they implement the MassObject interface.

Instance Methods