本文整理了Java中org.bukkit.util.Vector.copy()
方法的一些代码示例,展示了Vector.copy()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Vector.copy()
方法的具体详情如下:
包路径:org.bukkit.util.Vector
类名称:Vector
方法名:copy
[英]Copies another vector
[中]复制另一个向量
代码示例来源:origin: GlowstoneMC/Glowstone
@Override
public void setVelocity(Vector velocity) {
this.velocity.copy(velocity);
velocityChanged = true;
}
代码示例来源:origin: GlowstoneMC/Glowstone
/**
* Returns a deep copy of a BoundingBox.
* @param original the BoundingBox to copy
* @return a copy of {@code original}
*/
public static BoundingBox copyOf(BoundingBox original) {
BoundingBox box = new BoundingBox();
box.minCorner.copy(original.minCorner);
box.maxCorner.copy(original.maxCorner);
return box;
}
代码示例来源:origin: GlowstoneMC/Glowstone
/**
* Creates a bounding box given its minimum corner and its size.
* @param pos the minimum corner
* @param size the displacement of the maximum corner from the minimum corner
* @return a bounding box from {@code pos} to {@code pos.clone().add(size)}
*/
public static BoundingBox fromPositionAndSize(Vector pos, Vector size) {
BoundingBox box = new BoundingBox();
box.minCorner.copy(pos);
box.maxCorner.copy(pos.clone().add(size));
return box;
}
代码示例来源:origin: Slikey/EffectLib
@Override
public void onRun() {
Location location = getLocation();
if (firstStep) {
velocity.copy(location.getDirection().setY(0).normalize().multiply(0.2));
invalidate(location);
}
location.add(velocity);
for (Vector v : cloudCache) {
location.add(v);
display(cloudParticle, location, cloudColor, 0, 1);
location.subtract(v);
}
for (Vector v : waterCache) {
location.add(v);
display(particle, location);
location.subtract(v);
}
}
}
代码示例来源:origin: elBukkit/MagicPlugin
Vector up = new Vector(0, 1, 0);
Vector perp = new Vector();
perp.copy(direction);
perp.crossProduct(up);
内容来源于网络,如有侵权,请联系作者删除!