PointComponent2D
Summary
Class managing the 2D wall points.
Constructor
PointComponent2D
Syntax
PointComponent2D
-
core
Summary
Parameters:
-
core
CoreThe 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:
-
ctx
CanvasRenderingContext2D2D canvas context.
-
translation
BABYLON.vector2The canvas translation.
-
zoom
NumberThe 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:
-
vector
VectorA 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:
-
context
StringThe new context
onDoubleClick
Syntax
onDoubleClick
-
event
-
target
-
mstate
-
data
Summary
Called when the mouse double clicks on a point.
Parameters:
-
event
EventThe JS event.
-
target
PointStructureThe point structure dragged by the mouse.
-
mstate
ObjectThe state of the mouse.
-
data
ObjectData 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:
-
event
EventThe JS event.
-
target
PointStructureThe point structure dragged by the mouse.
-
mstate
ObjectThe state of the mouse.
-
data
ObjectData 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:
-
event
EventThe JS event.
-
target
PointStructureThe point structure dragged by the mouse.
-
mstate
ObjectThe state of the mouse.
-
data
ObjectData 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:
-
event
EventThe JS event.
-
target
PointStructureThe point structure dragged by the mouse.
-
mstate
ObjectThe state of the mouse.
-
data
ObjectData 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:
-
event
EventThe JS event.
-
target
PointStructureThe point structure dragged by the mouse.
-
mstate
ObjectThe state of the mouse.
-
data
ObjectData 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:
-
event
EventThe JS event.
-
target
PointStructureThe point structure dragged by the mouse.
-
mstate
ObjectThe state of the mouse.
-
data
ObjectData 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