本文整理了Java中org.bukkit.util.Vector.crossProduct()
方法的一些代码示例,展示了Vector.crossProduct()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Vector.crossProduct()
方法的具体详情如下:
包路径:org.bukkit.util.Vector
类名称:Vector
方法名:crossProduct
[英]Calculates the cross product of this vector with another. The cross product is defined as:
代码示例来源:origin: ProjectKorra/ProjectKorra
public static Vector rotateVectorAroundVector(final Vector axis, final Vector rotator, final double degrees) {
final double angle = Math.toRadians(degrees);
Vector rotation = axis.clone();
final Vector rotate = rotator.clone();
rotation = rotation.normalize();
final Vector thirdaxis = rotation.crossProduct(rotate).normalize().multiply(rotate.length());
return rotate.multiply(Math.cos(angle)).add(thirdaxis.multiply(Math.sin(angle)));
}
代码示例来源:origin: ProjectKorra/ProjectKorra
public static double getDistanceFromLine(final Vector line, final Location pointonline, final Location point) {
final Vector AP = new Vector();
double Ax, Ay, Az;
Ax = pointonline.getX();
Ay = pointonline.getY();
Az = pointonline.getZ();
double Px, Py, Pz;
Px = point.getX();
Py = point.getY();
Pz = point.getZ();
AP.setX(Px - Ax);
AP.setY(Py - Ay);
AP.setZ(Pz - Az);
return (AP.crossProduct(line).length()) / (line.length());
}
代码示例来源:origin: NoCheatPlus/NoCheatPlus
final double distance = blockEyes.crossProduct(context.direction).length() / context.lengthDirection;
context.minViolation = Math.min(context.minViolation, distance);
cancel = true;
代码示例来源:origin: elBukkit/MagicPlugin
if (aim.getY() > 0.7) {
Vector axis = new Vector(1, 0, 0);
Vector perp = aim.clone().crossProduct(axis).multiply(dr);
} else if (aim.getX() > 0.7) {
Vector axis = new Vector(0, 1, 0);
Vector perp = aim.clone().crossProduct(axis).multiply(dr);
} else {
Vector axis = new Vector(0, 1, 0);
Vector perp = aim.clone().crossProduct(axis).multiply(dr);
代码示例来源:origin: elBukkit/MagicPlugin
Vector perp = new Vector();
perp.copy(direction);
perp.crossProduct(up);
代码示例来源:origin: NoCheatPlus/NoCheatPlus
final double distance = blockEyes.crossProduct(direction).length() / direction.length();
内容来源于网络,如有侵权,请联系作者删除!