Package com.smartfoxserver.v2.mmo
Class Vec3D
- java.lang.Object
-
- com.smartfoxserver.v2.mmo.Vec3D
-
- All Implemented Interfaces:
java.io.Serializable
public class Vec3D extends java.lang.Object implements java.io.Serializable
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)
- Since:
- 2.8.0
- See Also:
MMORoom
,CreateMMORoomSettings
, Serialized Form
-
-
Constructor Summary
Constructors Constructor Description Vec3D(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
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description float
floatX()
Get the X coordinate as floatfloat
floatY()
Get the Y coordinate as floatfloat
floatZ()
Get the Z coordinate as floatstatic Vec3D
fromFloatArray(java.util.List<java.lang.Float> array)
privatestatic Vec3D
fromIntArray(java.util.List<java.lang.Integer> array)
privateint
intX()
Get the X coordinate as integerint
intY()
Get the Y coordinate as integerint
intZ()
Get the Z coordinate as integerboolean
isFloat()
Detect whether this object uses floating point numbers or integersjava.util.List<java.lang.Float>
toFloatArray()
privatejava.util.List<java.lang.Integer>
toIntArray()
privatejava.lang.String
toString()
-
-
-
Constructor Detail
-
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 Detail
-
fromIntArray
public static Vec3D fromIntArray(java.util.List<java.lang.Integer> array)
private
-
fromFloatArray
public static Vec3D fromFloatArray(java.util.List<java.lang.Float> array)
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
public java.lang.String toString()
- Overrides:
toString
in classjava.lang.Object
-
toIntArray
public java.util.List<java.lang.Integer> toIntArray()
private
-
toFloatArray
public java.util.List<java.lang.Float> toFloatArray()
private
-
-