MeasureComponent Class
2D Measures.
Constructor
MeasureComponent
-
core
Parameters:
-
core
CoreThe main engine.
Item Index
Methods
Methods
_addOvertureIntersections
-
wall
-
intersections
Adds the overtures measures to the existing wall measures.
Parameters:
-
wall
WallStructureWall carrying the overtures.
-
intersections
BABYLON.Vector2Current wall measure
points
list.
_drawMeasureSlice
-
ctx
-
translation
-
zoom
-
v1
-
v2
Draws the measure of the distance between two points.
Parameters:
-
ctx
CanvasRenderingContext2D2D canvas context.
-
translation
BABYLON.Vector2The canvas translation.
-
zoom
NumberThe canvas zoom.
-
v1
BABYLON.Vector2Origin point.
-
v2
BABYLON.Vector2Ending point.
Returns:
The rounded value of the measure (in meters).
deleteMeasures
-
measures
Duplicate measures are eliminated
Parameters:
-
measures
MeasureStructure[]Set of measures to merge.
destroy
()
disable
()
draw
-
ctx
-
translation
-
zoom
Draws all measures on the canvas.
Parameters:
-
ctx
CanvasRenderingContext2DThe 2D canvas context.
-
translation
BABYLON.Vector2The canvas translation.
-
zoom
NumberThe canvas zoom.
drawTmpWallMesure
-
ctx
-
translation
-
zoom
Draws the measure on the wall currently being drawn.
Parameters:
-
ctx
CanvasRenderingContext2D2D canvas context.
-
translation
BABYLON.Vector2The canvas translation.
-
zoom
NumberThe canvas zoom.
enable
()
getTargeted
-
vector
Parameters:
-
vector
VectorA position, usually the cursor's one.
Returns:
The targeted element, or null if nothing is found.
initialize
()
mergeMeasures
-
measures
Merges the measures that can be merged (aligned and touching each other)
Parameters:
-
measures
MeasureStructure[]Set of measures to merge.
onContextChanged
-
context
Parameters:
-
context
StringThe new context