Creates a PointMass which is displayed as a circle, and adds it to the SimList, for debugging only. The expiration time on temporary SimObjects is set to 'now', so that they are removed right away during the next call to advance().
name of the SimObject that is created
center of the circle
radius of the circle
Optional
expireTime: numberthe time when the DisplayObject will be removed; the default expireTime is 'now'.
Prints the message to console, preceded by the current simulation time. Draws the time in green, the message in black; you can add colors in the message by adding more '%c' symbols in the message string and pass additional colors.
message to print, optionally with '%c' where color changes are desired
Rest
...colors: string[]CSS color or background strings, to change the color in the message at points in the message marked by the string '%c'
Generated using TypeDoc
An interface that allows us to add a circle or line to the display from anywhere in the engine2D code. This interface solves some problems with circular dependencies. The calling code can access the functions via UtilEngine.debugEngine2D, without referring to RigidBodySim (which is what actually implements the functions).
To control the color of the objects that are created: Find the place where the DisplayObjects are created (e.g. DisplayLine, DisplayShape) such as RigidBodyObserver; add code there that looks for objects with particular names, and apply desired color.