Class BVector3
A vector calculation tool that integrates the conversion functions of yaw and pitch and coordinate space at the same time
-
Method Summary
Modifier and TypeMethodDescriptionadd
(double x, double y, double z) 向量加法向量加法addToPos()
添加指定模长的方向向量到Vector3(0, 0, 0)
其实就是返回此向量的坐标将此向量的坐标添加到pos上extend
(double length) 增加该向量的模static BVector3
fromAngle
(double yaw, double pitch) 通过传入的yaw与pitch初始化BVector3
此方法返回的BVector3的模长为1static BVector3
fromLocation
(Location location) 通过传入的Location的yaw与pitch初始化BVector3
此方法返回的BVector3的模长为1static BVector3
fromLocation
(Location location, double length) 通过传入的Location的yaw与pitch初始化BVector3
此方法返回的BVector3的模长为传入的length值static BVector3
fromPos
(double x, double y, double z) 通过传入的向量坐标初始化BVector3static BVector3
通过传入的向量坐标初始化BVector3获取单位方向向量static Vector3
getDirectionVector
(double yaw, double pitch) 通过yaw与pitch计算出等价的Vector3方向向量double
getPitch()
static double
getPitchFromVector
(Vector3 vector) 通过方向向量计算出pitch获取未克隆的单位方向向量double
getYaw()
static double
getYawFromVector
(Vector3 vector) 通过方向向量计算出yawrotate
(double yaw, double pitch) 旋转yaw和PitchrotatePitch
(double pitch) 旋转PitchrotateYaw
(double yaw) 旋转YawsetLength
(double length) 设置该向量的模setPitch
(double pitch) 设置 pitch.setYaw
(double yaw) 设置Yaw
-
Method Details
-
fromLocation
通过传入的Location的yaw与pitch初始化BVector3
此方法返回的BVector3的模长为1Initialize BVector3 by passing in the yaw and pitch of Location
The module length of BVector3 returned by this method is 1- Parameters:
location
- the location- Returns:
- the b vector 3
-
fromLocation
通过传入的Location的yaw与pitch初始化BVector3
此方法返回的BVector3的模长为传入的length值Initialize BVector3 by passing in the yaw and pitch of the Location
The module length of the BVector3 returned by this method is the length value passed in- Parameters:
location
- the location- Returns:
- the b vector 3
-
fromAngle
通过传入的yaw与pitch初始化BVector3
此方法返回的BVector3的模长为1Initialize BVector3 by passing in yaw and pitch
The module length of BVector3 returned by this method is 1- Parameters:
yaw
- the yaw (-90 270)pitch
- the pitch- Returns:
- the b vector 3
-
fromPos
通过传入的向量坐标初始化BVector3Initialize B Vector 3 with the vector coordinates passed in
- Parameters:
pos
- 向量坐标- Returns:
- the b vector 3
-
fromPos
通过传入的向量坐标初始化BVector3Initialize B Vector 3 with the vector coordinates passed in
- Parameters:
x
- the xy
- the yz
- the z- Returns:
- the b vector 3
-
setYaw
设置Yaw- Parameters:
yaw
- the yaw- Returns:
- the yaw
-
setPitch
设置 pitch.- Parameters:
pitch
- the pitch- Returns:
- the pitch
-
rotateYaw
旋转YawRotate Yaw
- Parameters:
yaw
- the yaw- Returns:
- the b vector 3
-
rotatePitch
旋转PitchRotate Pitch
- Parameters:
pitch
- the pitch- Returns:
- the b vector 3
-
rotate
旋转yaw和PitchRotate yaw and pitch
- Parameters:
yaw
- the yawpitch
- the pitch- Returns:
- the b vector 3
-
add
向量加法- Returns:
- 结果向量
-
add
向量加法- Returns:
- 结果向量
-
addToPos
添加指定模长的方向向量到Vector3(0, 0, 0)
其实就是返回此向量的坐标Adding the direction vector of the specified modulus length to Vector3(0, 0, 0)
actually returns the coordinates of this vector- Returns:
- the vector 3
-
addToPos
将此向量的坐标添加到pos上- Parameters:
pos
- the pos- Returns:
- the vector 3
-
setLength
设置该向量的模- Parameters:
length
- the length- Returns:
- the length
-
extend
增加该向量的模 当然你也可以传入负数,但请确保最终长度要大于0!- Parameters:
length
- 增加/减少的模- Returns:
- 自身
-
getYaw
public double getYaw() -
getPitch
public double getPitch() -
getDirectionVector
获取单位方向向量- Returns:
- the direction vector
-
getUnclonedDirectionVector
获取未克隆的单位方向向量- Returns:
- the direction vector
-
getDirectionVector
通过yaw与pitch计算出等价的Vector3方向向量- Parameters:
yaw
- yawpitch
- pitch- Returns:
- Vector3方向向量
-
getYawFromVector
通过方向向量计算出yawCalculate yaw from the direction vector
- Parameters:
vector
- 方向向量- Returns:
- yaw
-
getPitchFromVector
通过方向向量计算出pitchCalculate the pitch by the direction vector
- Parameters:
vector
- 方向向量- Returns:
- pitch
-