PointComponent2D
Summary
Class managing the 2D wall points.
Constructor
PointComponent2D
Syntax
PointComponent2D
-
core
Summary
Parameters:
-
coreCoreThe main engine.
Item Index
Methods
Properties
Methods
destroy
Syntax
destroy
()
Summary
Method called when the component is destroyeddisable
Syntax
disable
()
Summary
Disables the componentdrawAngle
Syntax
drawAngle
-
ctx -
translation -
zoom
Summary
Draws the angle between the two parent walls of a point.
Parameters:
-
ctxCanvasRenderingContext2D2D canvas context.
-
translationBABYLON.vector2The canvas translation.
-
zoomNumberThe canvas zoom.
enable
Syntax
enable
()
Summary
Enables the componentgetTargeted
Syntax
Summary
Finds out if the given position is over an element handled by the componentParameters:
-
vectorVectorA position, usually the cursor's one.
Returns:
The targeted element, or null if nothing is found.
initialize
Syntax
initialize
()
Summary
Method called when Wanaplan is initialized. You don't need to call this method manually.onContextChanged
Syntax
onContextChanged
-
context
Summary
Method called when the context is switched (2D -> 3D or 3D -> 2D)Parameters:
-
contextStringThe new context
onDoubleClick
Syntax
onDoubleClick
-
event -
target -
mstate -
data
Summary
Called when the mouse double clicks on a point.
Parameters:
-
eventEventThe JS event.
-
targetPointStructureThe point structure dragged by the mouse.
-
mstateObjectThe state of the mouse.
-
dataObjectData used for drawing. Can be null or something else if you wish to override the function.
onDragEnd
Syntax
onDragEnd
-
event -
target -
mstate -
data
Summary
Called when the mouse releases the point.
Parameters:
-
eventEventThe JS event.
-
targetPointStructureThe point structure dragged by the mouse.
-
mstateObjectThe state of the mouse.
-
dataObjectData used for drawing. Can be null or something else if you wish to override the function.
onDragging
Syntax
onDragging
-
event -
target -
mstate -
data
Summary
Called when the mouse is dragging the point.
Parameters:
-
eventEventThe JS event.
-
targetPointStructureThe point structure dragged by the mouse.
-
mstateObjectThe state of the mouse.
-
dataObjectData used for drawing. Can be null or something else if you wish to override the function.
onDragStart
Syntax
onDragStart
-
event -
target -
mstate -
data
Summary
Called when the mouse starts dragging a point.
Parameters:
-
eventEventThe JS event.
-
targetPointStructureThe point structure dragged by the mouse.
-
mstateObjectThe state of the mouse.
-
dataObjectData used for drawing. Can be null or something else if you wish to override the function.
onHover
Syntax
onHover
-
event -
target -
mstate -
data
Summary
Called when the mouse hovers over a point.
Parameters:
-
eventEventThe JS event.
-
targetPointStructureThe point structure dragged by the mouse.
-
mstateObjectThe state of the mouse.
-
dataObjectData used for drawing. Can be null or something else if you wish to override the function.
onLeave
Syntax
onLeave
-
event -
target -
mstate -
data
Summary
Called when the mouse leaves the point.
Parameters:
-
eventEventThe JS event.
-
targetPointStructureThe point structure dragged by the mouse.
-
mstateObjectThe state of the mouse.
-
dataObjectData used for drawing. Can be null or something else if you wish to override the function.
startListening
Syntax
startListening
()
Summary
Calls all the event listeners.stopListening
Syntax
stopListening
()
Summary
Removes all the event listeners.tryMergeAttachAll
Syntax
tryMergeAttachAll
-
[force]
Summary
Processes all points which have the needsUpdate flag set to true.
This method tries to merge points or attach them to surrounding walls.
Parameters:
-
[force]Boolean optionalForces the update of all points.
update
Syntax
update
()
Summary
Generic update method, called on every frameProperties
_ANGLERADIUS
Syntax
_ANGLERADIUS
Number
Summary
Radius of the angle when drawn on the 2D canvas.
Default: 55
anglePointList
Syntax
anglePointList
PointStructure[]
Summary
Which points need their angle to be displayed.
dragging
Syntax
Summary
Flag that indicates if a point is currently dragged.
priority
Syntax
Summary
Priority of the component for update callbacks.
Default: 90