程序包 cn.nukkit.math
类 Vector3
java.lang.Object
cn.nukkit.math.Vector3
- 所有已实现的接口:
Cloneable
- 直接已知子类:
NamedPosition
,Particle
- 作者:
- MagicDroidX (Nukkit Project)
-
字段概要
-
构造器概要
-
方法概要
修饰符和类型方法说明abs()
add
(double x) add
(double x, double y) add
(double x, double y, double z) ceil()
clone()
Calculates the cross product of this Vector and the given Vectordouble
distance
(double x, double y, double z) double
int
distanceManhattan
(Vector3 pos) double
distanceSquared
(double x, double y, double z) double
distanceSquared
(Vector3 pos) divide
(double number) double
Scalar Product of this Vector and the Vector supplied.down()
down
(int step) east()
east
(int step) boolean
floor()
double
getAxis
(BlockFace.Axis axis) int
int
int
int
int
int
double
getIntermediateWithXValue
(Vector3 v, double x) Returns a new vector with x value equal to the second parameter, along the line between this vector and the passed in vector, or null if not possible.getIntermediateWithYValue
(Vector3 v, double y) Returns a new vector with y value equal to the second parameter, along the line between this vector and the passed in vector, or null if not possible.getIntermediateWithZValue
(Vector3 v, double z) Returns a new vector with z value equal to the second parameter, along the line between this vector and the passed in vector, or null if not possible.double
getRight()
getSideVec
(BlockFace face) double
getSouth()
double
getUp()
double
getWest()
double
getX()
double
getY()
double
getZ()
int
hashCode()
double
length()
Calculates the Length of this Vectordouble
double
double
maxPlainDistance
(double x) double
maxPlainDistance
(double x, double z) double
maxPlainDistance
(Vector2 vector) double
multiply
(double number) north()
north
(int step) int
round()
setComponents
(double x, double y, double z) setComponents
(Vector3 pos) setComponentsAdding
(double x, double y, double z, double ax, double ay, double az) setComponentsAdding
(Vector3 pos, BlockFace face) setX
(double x) setY
(double y) setZ
(double z) south()
south
(int step) subtract()
已过时。subtract
(double x) subtract
(double x, double y) subtract
(double x, double y, double z) toString()
up()
up
(int step) west()
west
(int step)
-
字段详细资料
-
x
public double x -
y
public double y -
z
public double z
-
-
构造器详细资料
-
Vector3
public Vector3() -
Vector3
public Vector3(double x) -
Vector3
public Vector3(double x, double y) -
Vector3
public Vector3(double x, double y, double z)
-
-
方法详细资料
-
getX
public double getX() -
getY
public double getY() -
getZ
public double getZ() -
setX
-
setY
-
setZ
-
getFloorX
public int getFloorX() -
getFloorY
public int getFloorY() -
getFloorZ
public int getFloorZ() -
getChunkX
public int getChunkX() -
getChunkZ
public int getChunkZ() -
getChunkSectionY
-
getChunkVector
-
getRight
public double getRight() -
getUp
public double getUp() -
getForward
public double getForward() -
getSouth
public double getSouth() -
getWest
public double getWest() -
add
-
add
-
add
-
add
-
subtract
@Deprecated @DeprecationDetails(since="1.4.0.0-PN", reason="Makes no sense", replaceWith="clone()") public Vector3 subtract()已过时。 -
subtract
-
subtract
-
subtract
-
subtract
-
multiply
-
divide
-
ceil
-
floor
-
round
-
abs
-
getSide
-
getSide
-
getSideVec
-
up
-
up
-
down
-
down
-
north
-
north
-
south
-
south
-
east
-
east
-
west
-
west
-
distanceManhattan
-
distance
-
distanceSquared
-
distance
-
distanceSquared
-
maxPlainDistance
public double maxPlainDistance() -
maxPlainDistance
public double maxPlainDistance(double x) -
maxPlainDistance
public double maxPlainDistance(double x, double z) -
maxPlainDistance
-
maxPlainDistance
-
length
public double length()Calculates the Length of this Vector- 返回:
- The Length of this Vector.
-
lengthSquared
public double lengthSquared() -
normalize
-
dot
Scalar Product of this Vector and the Vector supplied.- 参数:
v
- Vector to calculate the scalar product to.- 返回:
- Scalar Product
-
cross
Calculates the cross product of this Vector and the given Vector- 参数:
v
- the vector to calculate the cross product with.- 返回:
- a Vector at right angle to this and other
-
getIntermediateWithXValue
Returns a new vector with x value equal to the second parameter, along the line between this vector and the passed in vector, or null if not possible.- 参数:
v
- vectorx
- x value- 返回:
- intermediate vector
-
getIntermediateWithYValue
Returns a new vector with y value equal to the second parameter, along the line between this vector and the passed in vector, or null if not possible.- 参数:
v
- vectory
- y value- 返回:
- intermediate vector
-
getIntermediateWithZValue
Returns a new vector with z value equal to the second parameter, along the line between this vector and the passed in vector, or null if not possible.- 参数:
v
- vectorz
- z value- 返回:
- intermediate vector
-
setComponents
-
setComponentsAdding
@PowerNukkitOnly @Since("1.4.0.0-PN") @Nonnull public Vector3 setComponentsAdding(double x, double y, double z, double ax, double ay, double az) -
setComponentsAdding
@PowerNukkitOnly @Since("1.4.0.0-PN") @Nonnull public Vector3 setComponentsAdding(@Nonnull Vector3 pos, @Nonnull BlockFace face) -
setComponents
-
getAxis
-
toString
-
equals
-
hashCode
public int hashCode() -
rawHashCode
public int rawHashCode() -
clone
-
asVector3f
-
asBlockVector3
-