Methods
-
setImgSrc(dynObject, widget)
-
Widget for changing image sources for sprites.
This:
Parameters:
Name Type Description dynObjectPhSim.DynObject widgetObject Widget Object
Properties
Name Type Description srcString New Source
- Source:
-
transformAgainstCamera(dynObject)
-
Widget to transform object by camera.
This:
Parameters:
Name Type Description dynObjectObject
Type Definitions
-
Circle
-
A circle is a set all points equidistant from some point known as the center.
In PhSim, a circle is any object
objsuch that the following are all true:obj.shape === "circle";typeof obj.x === number;typeof obj.y === number;typeof obj.radius === number;typeof obj.cycle === number || obj.cycle;Type:
- Source:
-
DynSimOptions
-
The options that can be used to create a dynamic simulation could be a CompositeSimulation object, a simulation object or an array of static objects.
If an array is chosen, then it is used to create
Type:
- PhSim.Static | PhSim.Static.Simulation | Array.<StaticObject>
- Source:
Properties:
Name Type Description canvasHTMLCanvas Simulation canvas
initSimIndexNumber The inital simulation index. If undefined, the simulation index is 0.
containerHTMLElement The container
-
Layer
-
Type:
- Object
- Source:
Properties:
Name Type Description objUniverseArray.<PhSimObjects> The array of objects.
nameString The name of the layer
-
LOAddress
-
Specify object location by layer and object indexes.
- Source:
Properties:
Name Type Description LNumber layer
ONumber object
-
LOStr
-
A Layer-Object string (LOStr) is a string specifying the layer and object indexes of an object in the DynTree.'
The form of the LOStr is:
<layer_index>,<object_index>Type:
- String
- Source:
-
PhSimEventCall(phEvent)
-
Parameters:
Name Type Description phEventPhSim.Events.PhSimEvent - Source:
-
PhSimObject
-
A PhSimObject is either a static object or a dynamic object.
Type:
- Source:
-
PhSimObjectArr
-
A PhSimObject array is an array of PhSimObject objects
Type:
- Array.<PhSimObject>
- Source:
-
Polygon
-
A path is defined by vertices. They can be used as a regular polygon. Any object that contains an array of vectors and has the boolean property
pathset totrueis reconized as a path. Paths can be used to define any polygon in general.In PhSim, a path is any object
objsuch that the following is true:Array.isArray(obj) === trueobj.shape === "polygon"If a path is used as a polygon, it must have at least three vectors in the
vertsproperty.Type:
- Source:
-
Simulation
-
Type:
- Object
- Source:
Properties:
Name Type Description layersArray.<Layer> An array of layers
worldObject World Object
simulationBoolean Boolean indicating a simulation
widgetsWidgetOptions Array of array options
-
SLOAddress
-
Specify object location by superlayer, layer and object indexes.
- Source:
Properties:
Name Type Description SNumber superlayer
LNumber layer
ONumber object
-
StaticObject
-
Static Object Type
Type:
- Source:
Properties:
Name Type Argument Description massNumber <optional>
The mass of the object.
densityNumber <optional>
The density of the object
lockedBoolean <optional>
A boolean deterimining the lock status of the object
semiLockedBoolean <optional>
A boolean deteriming the semi-lock status of the object
nameString <optional>
The name of the object
fillStyleString <optional>
Fill Color
strokeStyleString <optional>
Stroke Color
lineWidthString <optional>
Stroke Width
spritePhSim.Sprites.Sprite <optional>
Sprite Object
widgetsArray <optional>
-
Vector
-
In PhSim, a vector is any object with the properties
xandysuch that both are of the Number type.In a Circle, the
xandycoordinates refer to the center of the circle and the same goes for the Regular Polygon. In a Rectangle, it refers to the upper left corner of the rectangle.Type:
- PhSim.Vector | Circle | Rectangle | RegPolygon
- Source:
-
WidgetOptions
-
Type:
- WFunctionOptions | Object
- Source:
Properties:
Name Type Description typeString Name of widget.
Events
-
mousedown
-
PhSim
mousedownevent.Type: PhSim.Events.PhSimMouseEvent
- Source:
-
mousemove
-
- Source: