Namespace: Query

PhSim. Query

Source:

Methods


<static> chkWidgetType(widget)

Check widget type and return the widget type

Parameters:
Name Type Description
widget WidgetOptions
Source:

<static> deepClone(o)

Deep clone a JavaScript object.

Parameters:
Name Type Description
o Object
Source:

<static> getCollidingSensorObjects(phSim, dynObject)

Get objects colliding some object that share the same sensor classes.

Parameters:
Name Type Description
phSim PhSim

PhSim instance

dynObject PhSim.DynObject

Object to check for colliding sensor objects

Source:
Returns:
Type
Array.<PhSim.DynObject>

<static> getCollisionClasses(dynObject)

Get collision classes

Parameters:
Name Type Description
dynObject PhSim.DynObject

Dynamic Object

Source:
Returns:
Type
Array.<String>

<static> getObjectByName(o, str)

Get Object By Name

Parameters:
Name Type Description
o Simulation | Layer | Array.<PhSimObject>
str string

Name of Object

Source:

<static> getSensorClasses(dynObject)

Get senor classes

Parameters:
Name Type Description
dynObject PhSim.DynObject
Source:
Returns:
Type
Array.<String>

<static> getSpecialRectanglePoints(rectangle)

Get the special points of a rectangle

Parameters:
Name Type Description
rectangle Object
Source:

<static> getStatusStr(dynObject)

Get the status string of a PhSim instance.

Parameters:
Name Type Description
dynObject PhSim
Source:

<static> intersectionExists(array1, array2)

Sees if array1 and array2 share at least one element.

Parameters:
Name Type Description
array1 Array
array2 Array
Source:
Returns:
Type
Boolean

<static> isPointInRawRectangle(cx, cy, cw, ch, px, py)

Parameters:
Name Type Description
cx Number

x-coordinate of upper left corner.

cy Number

y-coordinate of upper left corner.

cw Number

width of rectangle

ch Number

height of rectangle

px Number

x-coordinate of point to be checked.

py Number

y-coordinate of point to be checked.

Source:
Returns:
Type
Boolean

<static> pointInObject(dynObject, x, y)

Check if a point (x,y) is in a dynamic object

Parameters:
Name Type Description
dynObject PhSim.DynObject

Dynamic Object

x Number

x-coordinate

y Number

y-coordinate

Source:
Returns:
Type
Boolean

<static> pointInRectangle(o, x, y)

Parameters:
Name Type Description
o *
x *
y *
Source:

<static> pointInVerts(a, v)

See if point is contained in shape defined by vertices set.

Parameters:
Name Type Description
a Array.<Vector>

Set of vertices

v Vector

The vertex to be checked.

Source:
Returns:
  • Returns true if v is contained in the shape defined by a and false if otherwise.
Type
Boolean

<static> pointInVertsBorder(a, v, width)

See if point is in vertices border

Parameters:
Name Type Description
a Array.<Vector>

Vertices to check

v Vector

Point to check.

width Number

Width of vertices border

Source:
Returns:
  • Returns true if v is in the border of the polygon defined by a and false otherwise.
Type
Boolean

<static> sameSensorClasses(dynObjectA, dynObjectB)

Check if two objects share at least one sensor class

Parameters:
Name Type Description
dynObjectA PhSim.DynObject
dynObjectB PhSim.DynObject
Source:
Returns:
Type
Boolean