Example usage for org.apache.commons.math3.geometry.euclidean.threed Vector3D getY

List of usage examples for org.apache.commons.math3.geometry.euclidean.threed Vector3D getY

Introduction

In this page you can find the example usage for org.apache.commons.math3.geometry.euclidean.threed Vector3D getY.

Prototype

public double getY() 

Source Link

Document

Get the ordinate of the vector.

Usage

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;/*  w w  w  . j ava2 s .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//from  w  w  w  .  ja  va  2s . c o  m
 */
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./*from  www. j a  v a2 s  . c om*/
 * @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./*from  ww  w  .j a  va 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 w  w w. jav a  2  s.co  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 xCross(Vector3D vec) {
    return new Vector3D(0, vec.getZ(), -vec.getY());
}

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   ww w.  jav a 2 s  .  c  om
 * @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()));
}