Package com.skillw.particlelib.utils
Object VectorUtils
-
- All Implemented Interfaces:
public class VectorUtils向量工具类
Zoyn
-
-
Field Summary
Fields Modifier and Type Field Description public final static VectorUtilsINSTANCE
-
Method Summary
Modifier and Type Method Description final VectorcreateVector(Location start, Location end)只通过数字本身相减得到向量, 减少额外克隆的损耗 final VectorgetLeftDirection(Location location)final VectorgetRightDirection(Location location)final VectorgetUpVector()得到一个单位为 1 的向上的向量 final VectorgetUpVector(Double multiply)final VectorrotateAroundAxisX(Vector vec, Double angleValue)final VectorrotateAroundAxisY(Vector vec, Double angleValue)final VectorrotateAroundAxisZ(Vector vec, Double angleValue)final VectorrotateVector(Vector v, Float yawDegrees, Float pitchDegrees)This handles non-unit vectors, with yaw and pitch instead of X,Y,Z angles. -
-
Method Detail
-
createVector
final Vector createVector(Location start, Location end)
只通过数字本身相减得到向量, 减少额外克隆的损耗
- Parameters:
start- 起点end- 终点- Returns:
Vector
-
getLeftDirection
final Vector getLeftDirection(Location location)
-
getRightDirection
final Vector getRightDirection(Location location)
-
getUpVector
final Vector getUpVector()
得到一个单位为 1 的向上的向量
- Returns:
Vector
-
getUpVector
final Vector getUpVector(Double multiply)
-
rotateAroundAxisX
final Vector rotateAroundAxisX(Vector vec, Double angleValue)
-
rotateAroundAxisY
final Vector rotateAroundAxisY(Vector vec, Double angleValue)
-
rotateAroundAxisZ
final Vector rotateAroundAxisZ(Vector vec, Double angleValue)
-
rotateVector
final Vector rotateVector(Vector v, Float yawDegrees, Float pitchDegrees)
This handles non-unit vectors, with yaw and pitch instead of X,Y,Z angles.
Thanks to SexyToad!
将一个非单位向量使用yaw和pitch来代替X, Y, Z的角旋转方式
- Parameters:
v- 向量yawDegrees- yaw的角度pitchDegrees- pitch的角度- Returns:
Vector
-
-
-
-