Class ClipboardSpline
Spline
using a Clipboard as source for the structure.-
Field Summary
Fields inherited from class com.fastasyncworldedit.core.command.tool.sweep.Spline
editSession
-
Constructor Summary
ConstructorDescriptionClipboardSpline
(EditSession editSession, ClipboardHolder clipboardHolder, Interpolation interpolation) Constructor without position-correction.ClipboardSpline
(EditSession editSession, ClipboardHolder clipboardHolder, Interpolation interpolation, Transform transform, int nodeCount) Constructor with position-correction. -
Method Summary
Modifier and TypeMethodDescriptionprotected int
pasteBlocks
(BlockVector3 target, Vector3 offset, double angle) Methods inherited from class com.fastasyncworldedit.core.command.tool.sweep.Spline
getDirection, pastePosition, pastePositionDirect, setDirection
-
Constructor Details
-
ClipboardSpline
public ClipboardSpline(EditSession editSession, ClipboardHolder clipboardHolder, Interpolation interpolation) Constructor without position-correction. Use this constructor for an interpolation implementation which does not need position-correction.- Parameters:
editSession
- The EditSession which will be used when pasting the clipboard contentclipboardHolder
- The clipboard that will be pasted along the splineinterpolation
- An implementation of the interpolation algorithm used to calculate the curve
-
ClipboardSpline
public ClipboardSpline(EditSession editSession, ClipboardHolder clipboardHolder, Interpolation interpolation, Transform transform, int nodeCount) Constructor with position-correction. Use this constructor for an interpolation implementation that needs position-correction.Some interpolation implementations calculate the position on the curve (used by
Spline.pastePosition(double)
) based on an equidistant distribution of the nodes on the curve. For example: on a spline with 5 nodes position 0.0 would refer to the first node, 0.25 to the second, 0.5 to the third, ... .
By providing this method with the amount of nodes used by the interpolation implementation the distribution of the nodes is converted to a proportional distribution based on the length between two adjacent nodes calculated byInterpolation.arcLength(double, double)
.
This means that the distance between two positions used to paste the clipboard (e.g., 0.75 - 0.5 = 0.25) on the curve will always amount to that part of the length (e.g., 40 units) of the curve. In this example it would amount to 0.25 × 40 = 10 units of curve length between these two positions.- Parameters:
editSession
- The EditSession which will be used when pasting the clipboard contentclipboardHolder
- The clipboard that will be pasted along the splineinterpolation
- An implementation of the interpolation algorithm used to calculate the curvenodeCount
- The number of nodes provided to the interpolation object
-
-
Method Details
-
pasteBlocks
protected int pasteBlocks(BlockVector3 target, Vector3 offset, double angle) throws MaxChangedBlocksException - Specified by:
pasteBlocks
in classSpline
- Throws:
MaxChangedBlocksException
-