Curved translation path options, that defineds the control
point of a quadratic bezier curve.
Use controlPoint to define the control point directly. This
will override all other properties.
Otherwise direction, magnitude and offset can be used
to calculate the control point based on the start and end
points of the curve.
The control point is calculated by:
Define a line from start to target - it will have length d
Define a point P on the line
Define a control line from point P with length d and some
angle delta from the original line.
The properties then customize this calculation:
magnitude will scale the distance d
offset will define where on the line point P is where 0.5 is
the midpoint and 0.1 is 10% along the line from the start location
direction will define which side of the line the control line should be
drawn
angle defines the angle delta between the line and the control line - by
default this a right angle (Math.PI / 2)
The directions 'up', 'down', 'left', 'right' all reference the side
of the line. The 'positive'
direction is the side of the line that the line would move toward when
rotated in the positive direction around the start point. The
'negative' side of the line is then the opposite side.
These directions only work when the angle is between 0 and Math.PI.
Curved translation path options, that defineds the control point of a quadratic bezier curve.
Use
controlPointto define the control point directly. This will override all other properties.Otherwise
direction,magnitudeandoffsetcan be used to calculate the control point based on the start and end points of the curve.The control point is calculated by:
dPon the linePwith lengthdand some angle delta from the original line.The properties then customize this calculation:
magnitudewill scale the distance doffsetwill define where on the line pointPis where0.5is the midpoint and0.1is 10% along the line from the start locationdirectionwill define which side of the line the control line should be drawnangledefines the angle delta between the line and the control line - by default this a right angle (Math.PI / 2)The directions
'up','down','left','right'all reference the side of the line. The'positive'direction is the side of the line that the line would move toward when rotated in the positive direction around the start point. The 'negative' side of the line is then the opposite side.These directions only work when the
angleis between0andMath.PI.