Package sfs3.client.entities.data
Class Vec3D
java.lang.Object
sfs3.client.entities.data.Vec3D
A vector 3D class used for defining coordinates in the MMORoom virtual world. The class supports either Integers or Floats.
It provides constructors for 2D and 3D coordinates systems. (In 2D values Z == 0)
- See Also:
-
Constructor Summary
ConstructorsConstructorDescriptionVec3D(float fx, float fy) Constructor for float-based 2D coordinatesVec3D(float fx, float fy, float fz) Constructor for float-based 3D coordinatesVec3D(int ix, int iy) Constructor for integer-based 2D coordinatesVec3D(int ix, int iy, int iz) Constructor for integer-based 3D coordinates -
Method Summary
Modifier and TypeMethodDescriptionfloatfloatX()Get the X coordinate as floatfloatfloatY()Get the Y coordinate as floatfloatfloatZ()Get the Z coordinate as floatstatic Vec3DfromArray(SFSDataWrapper element) protected static Vec3DfromFloatArray(List<Float> array) privateprotected static Vec3DfromIntArray(List<Integer> array) privateintintX()Get the X coordinate as integerintintY()Get the Y coordinate as integerintintZ()Get the Z coordinate as integerbooleanisFloat()Detect whether this object uses floating point numbers or integersprivateprivatetoString()
-
Constructor Details
-
Vec3D
public Vec3D(int ix, int iy, int iz) Constructor for integer-based 3D coordinates -
Vec3D
public Vec3D(float fx, float fy, float fz) Constructor for float-based 3D coordinates -
Vec3D
public Vec3D(int ix, int iy) Constructor for integer-based 2D coordinates -
Vec3D
public Vec3D(float fx, float fy) Constructor for float-based 2D coordinates
-
-
Method Details
-
fromArray
-
fromIntArray
private -
fromFloatArray
private -
isFloat
public boolean isFloat()Detect whether this object uses floating point numbers or integers- Returns:
- true if it uses floating point numbers
-
floatX
public float floatX()Get the X coordinate as float -
floatY
public float floatY()Get the Y coordinate as float -
floatZ
public float floatZ()Get the Z coordinate as float -
intX
public int intX()Get the X coordinate as integer -
intY
public int intY()Get the Y coordinate as integer -
intZ
public int intZ()Get the Z coordinate as integer -
toString
-
toIntArray
private -
toFloatArray
private
-