new $.oPoint(x, y, z)
openHarmony/openHarmony_math.js, line 67
The $.oPoint helper class - representing a 3D point.
Name | Type | Description |
---|---|---|
x |
float | Horizontal coordinate |
y |
float | Vertical coordinate |
z |
float | optional Depth Coordinate |
Properties:
Name | Type | Description |
---|---|---|
x |
float | Horizontal coordinate |
y |
float | Vertical coordinate |
z |
float | Depth Coordinate |
Methods
-
add(x, y, z)
openHarmony/openHarmony_math.js, line 127 -
Translate the point by the provided values.
Name Type Description x
int the x value to move the point by. y
int the y value to move the point by. z
int the z value to move the point by. -
addPoint(oPoint){$.oPoint}
openHarmony/openHarmony_math.js, line 170 -
Adds the point to the coordinates of the current oPoint and returns a new oPoint with the result.
Name Type Description oPoint
$.oPoint The point to add to this point. Returns:
Type Description $.oPoint -
convertToDrawingSpace(){$.oPoint}
openHarmony/openHarmony_math.js, line 264 -
Converts a scene coordinate point into a Drawing space coordinate, as used by Drawing tools and $.oShape (since drawings are 2D, z is untouched)
Returns:
Type Description $.oPoint -
convertToOpenGL()
openHarmony/openHarmony_math.js, line 274 -
Uses the scene settings to convert this as a worldspace point into an OpenGL point, used in underlying transformation operations in Harmony. OpenGL units have a square aspect ratio and go from -1 to 1 vertically in the camera field.
Returns:
nothing -
convertToSceneCoordinates(){$.oPoint}
openHarmony/openHarmony_math.js, line 255 -
Converts a Drawing point coordinate into a scene coordinate, as used by pegs (since drawings are 2D, z is untouched)
Returns:
Type Description $.oPoint -
convertToWorldspace()
openHarmony/openHarmony_math.js, line 289 -
Uses the scene settings to convert this as an OpenGL point into a Harmony worldspace point.
Returns:
nothing -
distance(point){float}
openHarmony/openHarmony_math.js, line 144 -
The distance between two points.
Name Type Description point
$.oPoint the other point to calculate the distance from. Returns:
Type Description float -
divide(float_val){$.oPoint}
openHarmony/openHarmony_math.js, line 226 -
Divides all coordinates by this value.
Name Type Description float_val
float Divide all coordinates by this value. Returns:
Type Description $.oPoint Returns itself (for inline addition). -
lerp(point, perc)
openHarmony/openHarmony_math.js, line 307 -
Linearily Interpolate between this (0.0) and the provided point (1.0)
Name Type Description point
$.oPoint The target point at 100% perc
double 0-1.0 value to linearily interp -
multiply(float_val){$.oPoint}
openHarmony/openHarmony_math.js, line 212 -
Multiply all coordinates by this value.
Name Type Description float_val
float Multiply all coordinates by this value. Returns:
Type Description $.oPoint Returns itself (for inline addition). -
pointAdd(add_pt){$.oPoint}
openHarmony/openHarmony_math.js, line 157 -
Adds the point to the coordinates of the current oPoint.
Name Type Description add_pt
$.oPoint The point to add to this point. Returns:
Type Description $.oPoint Returns itself (for inline addition). -
pointAverage(point_array){$.oPoint}
openHarmony/openHarmony_math.js, line 240 -
Find average of provided points.
Name Type Description point_array
Array.<$.oPoint> The array of points to get the average. Returns:
Type Description $.oPoint Returns the $.oPoint average of provided points. -
pointSubtract(sub_pt){$.oPoint}
openHarmony/openHarmony_math.js, line 184 -
Subtracts the point to the coordinates of the current oPoint.
Name Type Description sub_pt
$.oPoint The point to subtract to this point. Returns:
Type Description $.oPoint Returns itself (for inline addition). -
subtractPoint(point){$.oPoint}
openHarmony/openHarmony_math.js, line 198 -
Subtracts the point to the coordinates of the current oPoint and returns a new oPoint with the result.
Name Type Description point
$.oPoint The point to subtract to this point. Returns:
Type Description $.oPoint a new independant oPoint. -
translate(x, y, z){$.oPoint}
openHarmony/openHarmony_math.js, line 107 -
Translate the point by the provided values.
Name Type Description x
int the x value to move the point by. y
int the y value to move the point by. z
int the z value to move the point by. Returns:
Type Description $.oPoint Returns self (for inline addition).