org.jsfml.system

Class Vector3i

• All Implemented Interfaces:
Serializable

public final class Vector3i
extends Object
implements Serializable
Represents three-dimensional vectors using integer coordinates and provides arithmetic operations on integral 3D vectors.
Serialized Form
• Field Detail

• ZERO

public static final Vector3i ZERO
The zero vector.
• x

public final int x
The vector's X coordinate.
• y

public final int y
The vector's Y coordinate.
• z

public final int z
The vector's Z coordinate.
• Constructor Detail

• Vector3i

public Vector3i(int x,
int y,
int z)
Constructs a new vector with the given coordinates.
Parameters:
x - the X coordinate.
y - the Y coordinate.
z - the Z coordinate.
• Vector3i

public Vector3i(Vector3f v)
Constructs a new vector by converting a floating point vector.

The fractions of the coordinates will be cut off.

Parameters:
v - the vector to convert.
• Method Detail

public static Vector3i add(Vector3i a,
Vector3i b)
Parameters:
a - the first vector.
b - the second vector.
Returns:
a new vector, representing the sum of the two vectors.
• sub

public static Vector3i sub(Vector3i a,
Vector3i b)
Subtracts two vectors.
Parameters:
a - the first vector.
b - the second vector.
Returns:
a new vector, representing the difference between the two vectors.
• componentwiseMul

public static Vector3i componentwiseMul(Vector3i a,
Vector3i b)
Performs a component-wise multiplication of two vectors.
Parameters:
a - the first vector.
b - the second vector.
Returns:
a new vector, representing the "product" of the two vectors.
• componentwiseDiv

public static Vector3i componentwiseDiv(Vector3i a,
Vector3i b)
Performs a component-wise division of two vectors.
Parameters:
a - the first vector.
b - the second vector.
Returns:
a new vector, representing the "quotient" of the two vectors.
• mul

public static Vector3i mul(Vector3i a,
int s)
Multiplies a vector by a scalar.
Parameters:
a - the vector.
s - the scalar to multiply by.
Returns:
a new vector, representing the scaled vector.
• div

public static Vector3i div(Vector3i a,
int s)
Performs an integer division on each component of the vector by a scalar.
Parameters:
a - the vector.
s - the scalar.
Returns:
a new vector, representing the scaled vector.
• neg

public static Vector3i neg(Vector3i v)
Computes the negation of a vector.
Parameters:
v - the vector.
Returns:
a new vector, representing the negation of the given vector.
• hashCode

public int hashCode()
Overrides:
hashCode in class Object