MagnetismComponent2D Class
2D Magnetism.
Constructor
MagnetismComponent2D
-
core
Parameters:
-
core
CoreThe main engine.
Item Index
Methods
Methods
_globalWallMag
-
wall
-
mstate
Applies magnetism on the mouse to align walls
Parameters:
-
wall
WallStructurewall to align with
-
mstate
ObjectMouse state
_magFromAngle
-
mstate
-
target
Applies mouse magnetism when moving a point to favor 90° and 180° angles.
Parameters:
-
mstate
ObjectMouse state.
-
target
PointStructureDragged point.
_magFromPoints
-
mstate
-
[ignorePoint]
Applies magnetism on the mouse according to the existing points on the plan.
Parameters:
-
mstate
ObjectMouse state.
-
[ignorePoint]
PointStructure optionalPoint to ignore.
_magFromWallDir
-
mstate
-
target
Applies mouse magnetism along one of the parent walls' direction when dragging a point.
Parameters:
-
mstate
ObjectMouse state.
-
target
PointStructureDragged point.
_magFromWalls
-
mstate
-
[wallList]
Applies magnetism on the mouse according to existing walls on the plan.
Parameters:
-
mstate
ObjectMouse state.
-
[wallList]
WallStructure[] optionallist of walls to consider for magnetism
_shortCircuitMagnetism
-
mstate
Determines if the magnetism must be turned off (short circuited). It happens when the user presses CTRL.
Parameters:
-
mstate
ObjectMouse state.
Returns:
Returns true
if magnetism should be short circuited, false
otherwise.
destroy
()
disable
()
enable
()
getTargeted
-
vector
Parameters:
-
vector
VectorA position, usually the cursor's one.
Returns:
The targeted element, or null if nothing is found.
initialize
()
onContextChanged
-
context
Parameters:
-
context
StringThe new context