- java.lang.Object
 - 
- org.spongepowered.math.vector.Vector3d
 
 
- 
- All Implemented Interfaces:
 Serializable,Comparable<Vector3d>,Vectord
@Immutable public final class Vector3d extends Object implements Vectord, Comparable<Vector3d>, Serializable
- See Also:
 - Serialized Form
 
 
- 
- 
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description Vector3dabs()Vector3dadd(double x, double y, double z)Vector3dadd(float x, float y, float z)Vector3dadd(Vector3d v)Vector3dceil()intcompareTo(Vector3d v)static Vector3dcreateDirectionDeg(double theta, double phi)Gets the direction vector of a certain theta and phi in degrees.static Vector3dcreateDirectionDeg(float theta, float phi)Gets the direction vector of a certain theta and phi in degrees.static Vector3dcreateDirectionRad(double theta, double phi)Gets the direction vector of a certain theta and phi in radians.static Vector3dcreateDirectionRad(float theta, float phi)Gets the direction vector of a certain theta and phi in radians.static Vector3dcreateRandomDirection(Random random)Gets the direction vector of a random pitch and yaw using the random specified.Vector3dcross(double x, double y, double z)Vector3dcross(float x, float y, float z)Vector3dcross(Vector3d v)doubledistance(double x, double y, double z)doubledistance(float x, float y, float z)doubledistance(Vector3d v)doubledistanceSquared(double x, double y, double z)doubledistanceSquared(float x, float y, float z)doubledistanceSquared(Vector3d v)Vector3ddiv(double a)Vector3ddiv(double x, double y, double z)Vector3ddiv(float a)Vector3ddiv(float x, float y, float z)Vector3ddiv(Vector3d v)doubledot(double x, double y, double z)doubledot(float x, float y, float z)doubledot(Vector3d v)booleanequals(Object other)Vector3dfloor()intfloorX()intfloorY()intfloorZ()static Vector3dfrom(double n)static Vector3dfrom(double x, double y, double z)inthashCode()doublelength()doublelengthSquared()Vector3dmax(double x, double y, double z)Vector3dmax(float x, float y, float z)Vector3dmax(Vector3d v)intmaxAxis()Returns the axis with the maximum value.Vector3dmin(double x, double y, double z)Vector3dmin(float x, float y, float z)Vector3dmin(Vector3d v)intminAxis()Returns the axis with the minimal value.Vector3dmul(double a)Vector3dmul(double x, double y, double z)Vector3dmul(float a)Vector3dmul(float x, float y, float z)Vector3dmul(Vector3d v)Vector3dnegate()Vector3dnormalize()Vector3dpow(double power)Vector3dpow(float pow)Vector3dproject(double x, double y, double z)Vector3dproject(float x, float y, float z)Vector3dproject(Vector3d v)Vector3dround()Vector3dsub(double x, double y, double z)Vector3dsub(float x, float y, float z)Vector3dsub(Vector3d v)double[]toArray()Vector3dtoDouble()Vector3ftoFloat()Vector3itoInt()Vector3ltoLong()StringtoString()Vector2dtoVector2()Vector2dtoVector2(boolean useZ)Vector4dtoVector4()Vector4dtoVector4(double w)Vector4dtoVector4(float w)VectorNdtoVectorN()doublex()doubley()doublez() 
 - 
 
- 
- 
Field Detail
- 
ZERO
public static final Vector3d ZERO
 
- 
UNIT_X
public static final Vector3d UNIT_X
 
- 
UNIT_Y
public static final Vector3d UNIT_Y
 
- 
UNIT_Z
public static final Vector3d UNIT_Z
 
- 
ONE
public static final Vector3d ONE
 
- 
RIGHT
public static final Vector3d RIGHT
 
- 
UP
public static final Vector3d UP
 
- 
FORWARD
public static final Vector3d FORWARD
 
 - 
 
- 
Constructor Detail
- 
Vector3d
public Vector3d(Vector2d v)
 
- 
Vector3d
public Vector3d(Vector2d v, float z)
 
- 
Vector3d
public Vector3d(Vector2d v, double z)
 
- 
Vector3d
public Vector3d(Vector4d v)
 
- 
Vector3d
public Vector3d(VectorNd v)
 
- 
Vector3d
public Vector3d(float x, float y, float z) 
- 
Vector3d
public Vector3d(double x, double y, double z) 
 - 
 
- 
Method Detail
- 
x
public double x()
 
- 
y
public double y()
 
- 
z
public double z()
 
- 
floorX
public int floorX()
 
- 
floorY
public int floorY()
 
- 
floorZ
public int floorZ()
 
- 
add
public Vector3d add(float x, float y, float z)
 
- 
add
public Vector3d add(double x, double y, double z)
 
- 
sub
public Vector3d sub(float x, float y, float z)
 
- 
sub
public Vector3d sub(double x, double y, double z)
 
- 
mul
public Vector3d mul(float a)
 
- 
mul
public Vector3d mul(float x, float y, float z)
 
- 
mul
public Vector3d mul(double x, double y, double z)
 
- 
div
public Vector3d div(float a)
 
- 
div
public Vector3d div(float x, float y, float z)
 
- 
div
public Vector3d div(double x, double y, double z)
 
- 
dot
public double dot(Vector3d v)
 
- 
dot
public double dot(float x, float y, float z) 
- 
dot
public double dot(double x, double y, double z) 
- 
project
public Vector3d project(float x, float y, float z)
 
- 
project
public Vector3d project(double x, double y, double z)
 
- 
cross
public Vector3d cross(float x, float y, float z)
 
- 
cross
public Vector3d cross(double x, double y, double z)
 
- 
pow
public Vector3d pow(float pow)
 
- 
min
public Vector3d min(float x, float y, float z)
 
- 
min
public Vector3d min(double x, double y, double z)
 
- 
max
public Vector3d max(float x, float y, float z)
 
- 
max
public Vector3d max(double x, double y, double z)
 
- 
distanceSquared
public double distanceSquared(Vector3d v)
 
- 
distanceSquared
public double distanceSquared(float x, float y, float z) 
- 
distanceSquared
public double distanceSquared(double x, double y, double z) 
- 
distance
public double distance(Vector3d v)
 
- 
distance
public double distance(float x, float y, float z) 
- 
distance
public double distance(double x, double y, double z) 
- 
lengthSquared
public double lengthSquared()
- Specified by:
 lengthSquaredin interfaceVectord
 
- 
minAxis
public int minAxis()
Returns the axis with the minimal value. 
- 
maxAxis
public int maxAxis()
Returns the axis with the maximum value. 
- 
toVector2
public Vector2d toVector2()
 
- 
toVector2
public Vector2d toVector2(boolean useZ)
 
- 
toVector4
public Vector4d toVector4()
 
- 
toVector4
public Vector4d toVector4(float w)
 
- 
toVector4
public Vector4d toVector4(double w)
 
- 
toVectorN
public VectorNd toVectorN()
 
- 
compareTo
public int compareTo(Vector3d v)
- Specified by:
 compareToin interfaceComparable<Vector3d>
 
- 
from
public static Vector3d from(double n)
 
- 
from
public static Vector3d from(double x, double y, double z)
 
- 
createRandomDirection
public static Vector3d createRandomDirection(Random random)
Gets the direction vector of a random pitch and yaw using the random specified.- Parameters:
 random- to use- Returns:
 - the random direction vector
 
 
- 
createDirectionDeg
public static Vector3d createDirectionDeg(float theta, float phi)
Gets the direction vector of a certain theta and phi in degrees. This uses the standard math spherical coordinate system.- Parameters:
 theta- in degreesphi- in degrees- Returns:
 - the direction vector
 
 
- 
createDirectionDeg
public static Vector3d createDirectionDeg(double theta, double phi)
Gets the direction vector of a certain theta and phi in degrees. This uses the standard math spherical coordinate system.- Parameters:
 theta- in degreesphi- in degrees- Returns:
 - the direction vector
 
 
- 
createDirectionRad
public static Vector3d createDirectionRad(float theta, float phi)
Gets the direction vector of a certain theta and phi in radians. This uses the standard math spherical coordinate system.- Parameters:
 theta- in radiansphi- in radians- Returns:
 - the direction vector
 
 
- 
createDirectionRad
public static Vector3d createDirectionRad(double theta, double phi)
Gets the direction vector of a certain theta and phi in radians. This uses the standard math spherical coordinate system.- Parameters:
 theta- in radiansphi- in radians- Returns:
 - the direction vector
 
 
 - 
 
 -