Package com.fastasyncworldedit.core.math
Class DelegateBlockVector3
java.lang.Object
com.sk89q.worldedit.math.BlockVector3
com.fastasyncworldedit.core.math.DelegateBlockVector3
- Direct Known Subclasses:
OffsetBlockVector3
-
Field Summary
Fields inherited from class com.sk89q.worldedit.math.BlockVector3
ONE, UNIT_MINUS_X, UNIT_MINUS_Y, UNIT_MINUS_Z, UNIT_X, UNIT_Y, UNIT_Z, ZERO
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionabs()
Returns a vector with the absolute values of the components of this vector.add
(int x, int y, int z) Add another vector to this vector and return the result as a new vector.add
(BlockVector3 other) Add another vector to this vector and return the result as a new vector.add
(BlockVector3... others) Add a list of vectors to this vector and return the result as a new vector.static BlockVector3
at
(double x, double y, double z) static BlockVector3
at
(int x, int y, int z) ceil()
Rounds all components up.static void
checkLongPackable
(BlockVector3 location) clampY
(int min, int max) Clamp the Y component.boolean
containedWithin
(BlockVector3 min, BlockVector3 max) Checks to see if a vector is contained with another.cross
(BlockVector3 other) Gets the cross product of this and another vector.double
distance
(BlockVector3 other) Get the distance between this vector and another vector.int
distanceSq
(BlockVector3 other) Get the distance between this vector and another vector, squared.divide
(int n) Perform scalar division and return a new vector.divide
(int x, int y, int z) Divide this vector by another vector on each component.divide
(BlockVector3 other) Divide this vector by another vector on each component.double
dot
(BlockVector3 other) Gets the dot product of this and another vector.boolean
floor()
Floors the values of all components.static BlockVector3
fromLongPackedForm
(long packed) int
Get the X coordinate.int
Get the Y coordinate.int
Get the Z coordinate.getFullBlock
(Extent orDefault) Gets the maximum components of two vectors.Gets the minimum components of two vectors.getNbtData
(Extent orDefault) int
getOrdinal
(Extent orDefault) getOrdinalBelow
(Extent orDefault) char
getOrdinalChar
(Extent orDefault) getStateAbove
(Extent orDefault) getStateRelativeY
(Extent orDefault, int y) int
getX()
Get the X coordinate.int
getY()
Get the Y coordinate.int
getZ()
Get the Z coordinate.int
hashCode()
init
(BlockVector3 parent) static boolean
isLongPackable
(BlockVector3 location) double
length()
Get the length of the vector.int
lengthSq()
Get the length, squared, of the vector.multiply
(int n) Perform scalar multiplication and return a new vector.multiply
(int x, int y, int z) Multiply this vector by another vector on each component.multiply
(BlockVector3 other) Multiply this vector by another vector on each component.multiply
(BlockVector3... others) Multiply this vector by zero or more vectors on each component.mutX
(double x) mutX
(int x) mutY
(double y) mutY
(int y) mutZ
(double z) mutZ
(int z) Get the normalized vector, which is the vector divided by its length, as a new vector.plus
(BlockVector3 other) round()
Rounds all components to the closest integer.boolean
setBlock
(Extent orDefault, BlockState state) setComponents
(double x, double y, double z) setComponents
(int x, int y, int z) boolean
setFullBlock
(Extent orDefault, BaseBlock block) boolean
setOrdinal
(Extent orDefault, int ordinal) shl
(int n) Shift all components left byn
.shl
(int x, int y, int z) Shift all components left.shr
(int n) Shift all components right byn
.shr
(int x, int y, int z) Shift all components right.static Comparator<BlockVector3>
subtract
(int x, int y, int z) Subtract another vector from this vector and return the result as a new vector.subtract
(BlockVector3 other) Subtract another vector from this vector and return the result as a new vector.subtract
(BlockVector3... others) Subtract a list of vectors from this vector and return the result as a new vector.Creates a 2D vector by dropping the Y component from this vector.long
double
toPitch()
Get this vector's pitch as used within the game.toString()
double
toYaw()
Get this vector's yaw as used within the game.transform2D
(double angle, double aboutX, double aboutZ, double translateX, double translateZ) Perform a 2D transformation on this vector and return a new one.withX
(int x) Set the X coordinate.withY
(int y) Set the Y coordinate.withZ
(int z) Set the Z coordinate.Methods inherited from class com.sk89q.worldedit.math.BlockVector3
equals, toParserString
-
Constructor Details
-
DelegateBlockVector3
public DelegateBlockVector3()
-
-
Method Details
-
init
-
at
-
at
-
isLongPackable
-
checkLongPackable
-
fromLongPackedForm
-
sortByCoordsYzx
-
setComponents
- Overrides:
setComponents
in classBlockVector3
-
setComponents
- Overrides:
setComponents
in classBlockVector3
-
mutX
- Overrides:
mutX
in classBlockVector3
-
mutY
- Overrides:
mutY
in classBlockVector3
-
mutZ
- Overrides:
mutZ
in classBlockVector3
-
mutX
- Overrides:
mutX
in classBlockVector3
-
mutY
- Overrides:
mutY
in classBlockVector3
-
mutZ
- Overrides:
mutZ
in classBlockVector3
-
toImmutable
- Overrides:
toImmutable
in classBlockVector3
-
toLongPackedForm
public long toLongPackedForm()- Overrides:
toLongPackedForm
in classBlockVector3
-
getX
public int getX()Description copied from class:BlockVector3
Get the X coordinate.- Specified by:
getX
in classBlockVector3
- Returns:
- the x coordinate
-
getBlockX
public int getBlockX()Description copied from class:BlockVector3
Get the X coordinate.- Overrides:
getBlockX
in classBlockVector3
- Returns:
- the x coordinate
-
withX
Description copied from class:BlockVector3
Set the X coordinate.- Overrides:
withX
in classBlockVector3
- Parameters:
x
- the new X- Returns:
- a new vector
-
getY
public int getY()Description copied from class:BlockVector3
Get the Y coordinate.- Specified by:
getY
in classBlockVector3
- Returns:
- the y coordinate
-
getBlockY
public int getBlockY()Description copied from class:BlockVector3
Get the Y coordinate.- Overrides:
getBlockY
in classBlockVector3
- Returns:
- the y coordinate
-
withY
Description copied from class:BlockVector3
Set the Y coordinate.- Overrides:
withY
in classBlockVector3
- Parameters:
y
- the new Y- Returns:
- a new vector
-
getZ
public int getZ()Description copied from class:BlockVector3
Get the Z coordinate.- Specified by:
getZ
in classBlockVector3
- Returns:
- the z coordinate
-
getBlockZ
public int getBlockZ()Description copied from class:BlockVector3
Get the Z coordinate.- Overrides:
getBlockZ
in classBlockVector3
- Returns:
- the z coordinate
-
withZ
Description copied from class:BlockVector3
Set the Z coordinate.- Overrides:
withZ
in classBlockVector3
- Parameters:
z
- the new Z- Returns:
- a new vector
-
add
Description copied from class:BlockVector3
Add another vector to this vector and return the result as a new vector.- Overrides:
add
in classBlockVector3
- Parameters:
other
- the other vector- Returns:
- a new vector
-
add
Description copied from class:BlockVector3
Add another vector to this vector and return the result as a new vector.- Overrides:
add
in classBlockVector3
- Parameters:
x
- the value to addy
- the value to addz
- the value to add- Returns:
- a new vector
-
add
Description copied from class:BlockVector3
Add a list of vectors to this vector and return the result as a new vector.- Overrides:
add
in classBlockVector3
- Parameters:
others
- an array of vectors- Returns:
- a new vector
-
subtract
Description copied from class:BlockVector3
Subtract another vector from this vector and return the result as a new vector.- Overrides:
subtract
in classBlockVector3
- Parameters:
other
- the other vector- Returns:
- a new vector
-
subtract
Description copied from class:BlockVector3
Subtract another vector from this vector and return the result as a new vector.- Overrides:
subtract
in classBlockVector3
- Parameters:
x
- the value to subtracty
- the value to subtractz
- the value to subtract- Returns:
- a new vector
-
subtract
Description copied from class:BlockVector3
Subtract a list of vectors from this vector and return the result as a new vector.- Overrides:
subtract
in classBlockVector3
- Parameters:
others
- an array of vectors- Returns:
- a new vector
-
multiply
Description copied from class:BlockVector3
Multiply this vector by another vector on each component.- Overrides:
multiply
in classBlockVector3
- Parameters:
other
- the other vector- Returns:
- a new vector
-
multiply
Description copied from class:BlockVector3
Multiply this vector by another vector on each component.- Overrides:
multiply
in classBlockVector3
- Parameters:
x
- the value to multiplyy
- the value to multiplyz
- the value to multiply- Returns:
- a new vector
-
multiply
Description copied from class:BlockVector3
Multiply this vector by zero or more vectors on each component.- Overrides:
multiply
in classBlockVector3
- Parameters:
others
- an array of vectors- Returns:
- a new vector
-
multiply
Description copied from class:BlockVector3
Perform scalar multiplication and return a new vector.- Overrides:
multiply
in classBlockVector3
- Parameters:
n
- the value to multiply- Returns:
- a new vector
-
divide
Description copied from class:BlockVector3
Divide this vector by another vector on each component.- Overrides:
divide
in classBlockVector3
- Parameters:
other
- the other vector- Returns:
- a new vector
-
divide
Description copied from class:BlockVector3
Divide this vector by another vector on each component.- Overrides:
divide
in classBlockVector3
- Parameters:
x
- the value to divide byy
- the value to divide byz
- the value to divide by- Returns:
- a new vector
-
divide
Description copied from class:BlockVector3
Perform scalar division and return a new vector.- Overrides:
divide
in classBlockVector3
- Parameters:
n
- the value to divide by- Returns:
- a new vector
-
shr
Description copied from class:BlockVector3
Shift all components right.- Overrides:
shr
in classBlockVector3
- Parameters:
x
- the value to shift x byy
- the value to shift y byz
- the value to shift z by- Returns:
- a new vector
-
shr
Description copied from class:BlockVector3
Shift all components right byn
.- Overrides:
shr
in classBlockVector3
- Parameters:
n
- the value to shift by- Returns:
- a new vector
-
shl
Description copied from class:BlockVector3
Shift all components left.- Overrides:
shl
in classBlockVector3
- Parameters:
x
- the value to shift x byy
- the value to shift y byz
- the value to shift z by- Returns:
- a new vector
-
shl
Description copied from class:BlockVector3
Shift all components left byn
.- Overrides:
shl
in classBlockVector3
- Parameters:
n
- the value to shift by- Returns:
- a new vector
-
length
public double length()Description copied from class:BlockVector3
Get the length of the vector.- Overrides:
length
in classBlockVector3
- Returns:
- length
-
lengthSq
public int lengthSq()Description copied from class:BlockVector3
Get the length, squared, of the vector.- Overrides:
lengthSq
in classBlockVector3
- Returns:
- length, squared
-
distance
Description copied from class:BlockVector3
Get the distance between this vector and another vector.- Overrides:
distance
in classBlockVector3
- Parameters:
other
- the other vector- Returns:
- distance
-
distanceSq
Description copied from class:BlockVector3
Get the distance between this vector and another vector, squared.- Overrides:
distanceSq
in classBlockVector3
- Parameters:
other
- the other vector- Returns:
- distance
-
normalize
Description copied from class:BlockVector3
Get the normalized vector, which is the vector divided by its length, as a new vector.- Overrides:
normalize
in classBlockVector3
- Returns:
- a new vector
-
dot
Description copied from class:BlockVector3
Gets the dot product of this and another vector.- Overrides:
dot
in classBlockVector3
- Parameters:
other
- the other vector- Returns:
- the dot product of this and the other vector
-
cross
Description copied from class:BlockVector3
Gets the cross product of this and another vector.- Overrides:
cross
in classBlockVector3
- Parameters:
other
- the other vector- Returns:
- the cross product of this and the other vector
-
containedWithin
Description copied from class:BlockVector3
Checks to see if a vector is contained with another.- Overrides:
containedWithin
in classBlockVector3
- Parameters:
min
- the minimum point (X, Y, and Z are the lowest)max
- the maximum point (X, Y, and Z are the lowest)- Returns:
- true if the vector is contained
-
clampY
Description copied from class:BlockVector3
Clamp the Y component.- Overrides:
clampY
in classBlockVector3
- Parameters:
min
- the minimum valuemax
- the maximum value- Returns:
- a new vector
-
floor
Description copied from class:BlockVector3
Floors the values of all components.- Overrides:
floor
in classBlockVector3
- Returns:
- a new vector
-
ceil
Description copied from class:BlockVector3
Rounds all components up.- Overrides:
ceil
in classBlockVector3
- Returns:
- a new vector
-
round
Description copied from class:BlockVector3
Rounds all components to the closest integer.Components < 0.5 are rounded down, otherwise up.
- Overrides:
round
in classBlockVector3
- Returns:
- a new vector
-
abs
Description copied from class:BlockVector3
Returns a vector with the absolute values of the components of this vector.- Overrides:
abs
in classBlockVector3
- Returns:
- a new vector
-
transform2D
public BlockVector3 transform2D(double angle, double aboutX, double aboutZ, double translateX, double translateZ) Description copied from class:BlockVector3
Perform a 2D transformation on this vector and return a new one.- Overrides:
transform2D
in classBlockVector3
- Parameters:
angle
- in degreesaboutX
- about which x coordinate to rotateaboutZ
- about which z coordinate to rotatetranslateX
- what to add after rotationtranslateZ
- what to add after rotation- Returns:
- a new vector
- See Also:
-
toPitch
public double toPitch()Description copied from class:BlockVector3
Get this vector's pitch as used within the game.- Overrides:
toPitch
in classBlockVector3
- Returns:
- pitch in radians
-
toYaw
public double toYaw()Description copied from class:BlockVector3
Get this vector's yaw as used within the game.- Overrides:
toYaw
in classBlockVector3
- Returns:
- yaw in radians
-
getMinimum
Description copied from class:BlockVector3
Gets the minimum components of two vectors.- Overrides:
getMinimum
in classBlockVector3
- Parameters:
v2
- the second vector- Returns:
- minimum
-
getMaximum
Description copied from class:BlockVector3
Gets the maximum components of two vectors.- Overrides:
getMaximum
in classBlockVector3
- Parameters:
v2
- the second vector- Returns:
- maximum
-
setOrdinal
- Overrides:
setOrdinal
in classBlockVector3
-
setBlock
- Overrides:
setBlock
in classBlockVector3
-
setFullBlock
- Overrides:
setFullBlock
in classBlockVector3
-
getOrdinal
- Overrides:
getOrdinal
in classBlockVector3
-
getOrdinalChar
- Overrides:
getOrdinalChar
in classBlockVector3
-
getBlock
- Overrides:
getBlock
in classBlockVector3
-
getFullBlock
- Overrides:
getFullBlock
in classBlockVector3
-
getNbtData
- Overrides:
getNbtData
in classBlockVector3
-
getOrdinalBelow
- Overrides:
getOrdinalBelow
in classBlockVector3
-
getStateAbove
- Overrides:
getStateAbove
in classBlockVector3
-
getStateRelativeY
- Overrides:
getStateRelativeY
in classBlockVector3
-
toBlockVector2
Description copied from class:BlockVector3
Creates a 2D vector by dropping the Y component from this vector.- Overrides:
toBlockVector2
in classBlockVector3
- Returns:
- a new
BlockVector2
-
toVector3
- Overrides:
toVector3
in classBlockVector3
-
equals
- Overrides:
equals
in classBlockVector3
-
hashCode
public int hashCode()- Overrides:
hashCode
in classBlockVector3
-
toString
- Overrides:
toString
in classBlockVector3
-
plus
- Overrides:
plus
in classBlockVector3
-