search

Class myphysicslab.sims.engine2D.Engine2DApp

Provided By
Extends
All Implemented Interfaces
All Known Direct Subclasses

Abstract base class that creates the standard set of views, graphs and controls which are common to applications that run a RigidBodySim, ImpulseSim, or ContactSim,

Creates instance objects such as the simulation and display objects; defines regular expressions for easy Terminal scripting of these objects using short names instead of fully qualified property names.

The constructor takes an argument that specifies the names of the HTML elementId's to look for in the HTML document; these elements are where the user interface of the simulation is created. This allows for having two separate simulation apps running concurrently on a single page.

No global variables are created other than two root global variables: the myphysicslab global holds all of the myPhysicsLab classes; and a global variable is created for this application instance. This application global is created outside of this file in the HTML where the constructor is called. The name of that global variable holding the application is passed to #defineNames method so that short-names in scripts can be properly expanded.

new Engine2DApp( elem_ids, simRect, sim, advance, opt_name )

Parameters
elem_ids{container: string, div_graph: string, div_terminal: string, div_time_graph: string, graph_controls: string, images_dir: string, label_terminal: string, show_sim: string, show_terminal: string, sim_applet: string, sim_controls: string, tab_list: string, term_input: string, term_output: string, time_graph_controls: string}

specifies the names of the HTML elementId's to look for in the HTML document; these elements are where the user interface of the simulation is created.

simRectmyphysicslab.lab.util.DoubleRect

the dimensions of the simulation view; this also sets the aspect ratio (width to height) of the canvas

simmyphysicslab.lab.engine2D.RigidBodySim
advancemyphysicslab.lab.model.ODEAdvance
opt_name(string|undefined)

name of this Subject

Instance Methods

Instance Properties