List of usage examples for org.apache.commons.math3.geometry.euclidean.threed Vector3D getX
public double getX()
From source file:nova.core.network.handler.BlockPacket.java
@Override public void write(Block block, Packet packet) { if (block instanceof Syncable) { Vector3D position = block.position(); packet.writeInt((int) position.getX()); packet.writeInt((int) position.getY()); packet.writeInt((int) position.getZ()); ((Syncable) block).write(packet); return;//from w w w .j a va 2s . c o m } throw new NetworkException("Failed to send packet for block: " + block); }
From source file:nova.core.util.math.MatrixStack.java
/** * Translates current transformation matrix. * * @param translateVector vector of translation. * @return The tranformed matrix/* w w w. j a va 2s . c om*/ */ public MatrixStack translate(Vector3D translateVector) { translate(translateVector.getX(), translateVector.getY(), translateVector.getZ()); return this; }
From source file:nova.core.util.math.MatrixStack.java
/** * Scales current transformation matrix. * * @param scaleVector scale vector./* ww w .j a va 2 s .c o m*/ * @return The current matrix */ public MatrixStack scale(Vector3D scaleVector) { scale(scaleVector.getX(), scaleVector.getY(), scaleVector.getZ()); return this; }
From source file:nova.core.util.math.Vector3DUtil.java
/** * Calculates maximum of each coordinate. * * @param a first vector./* w w w.jav a 2 s .c o m*/ * @param b second vector. * @return new vector that's each coordinate is maximum of coordinates of a and b. */ public static Vector3D max(Vector3D a, Vector3D b) { return new Vector3D(FastMath.max(a.getX(), b.getX()), FastMath.max(a.getY(), b.getY()), FastMath.max(a.getZ(), b.getZ())); }
From source file:nova.core.util.math.Vector3DUtil.java
/** * Calculates minimum of each coordinate. * @param a first vector.//from ww w .j a v a 2s. c o m * @param b second vector. * @return new vector that's each coordinate is minimum of coordinates of a and b. */ public static Vector3D min(Vector3D a, Vector3D b) { return new Vector3D(FastMath.min(a.getX(), b.getX()), FastMath.min(a.getY(), b.getY()), FastMath.min(a.getZ(), b.getZ())); }
From source file:nova.core.util.math.Vector3DUtil.java
public static Vector3D cartesianProduct(Vector3D a, Vector3D b) { return new Vector3D(a.getX() * b.getX(), a.getY() * b.getY(), a.getZ() * b.getZ()); }
From source file:nova.core.util.math.Vector3DUtil.java
public static Vector3D zCross(Vector3D vec) { return new Vector3D(-vec.getY(), vec.getX(), 0); }
From source file:nova.core.util.math.Vector3DUtil.java
/** * Calculates one by vectos./*from w w w . j av a2 s . co m*/ * @param vec vector to be reciprocated. * @return reciprocal of vec. */ public static Vector3D reciprocal(Vector3D vec) { return new Vector3D(1 / vec.getX(), 1 / vec.getY(), 1 / vec.getZ()); }
From source file:nova.core.util.math.Vector3DUtil.java
public static Vector3D round(Vector3D vec) { return new Vector3D(FastMath.round(vec.getX()), FastMath.round(vec.getY()), FastMath.round(vec.getZ())); }
From source file:nova.core.util.math.Vector3DUtil.java
public static Vector3D ceil(Vector3D vec) { return new Vector3D(FastMath.ceil(vec.getX()), FastMath.ceil(vec.getY()), FastMath.ceil(vec.getZ())); }