Class 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 coordinates
      Vec3D​(float fx, float fy, float fz)
      Constructor for float-based 3D coordinates
      Vec3D​(int ix, int iy)
      Constructor for integer-based 2D coordinates
      Vec3D​(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 float
      float floatY()
      Get the Y coordinate as float
      float floatZ()
      Get the Z coordinate as float
      static Vec3D fromFloatArray​(java.util.List<java.lang.Float> array)
      private
      static Vec3D fromIntArray​(java.util.List<java.lang.Integer> array)
      private
      int intX()
      Get the X coordinate as integer
      int intY()
      Get the Y coordinate as integer
      int intZ()
      Get the Z coordinate as integer
      boolean isFloat()
      Detect whether this object uses floating point numbers or integers
      java.util.List<java.lang.Float> toFloatArray()
      private
      java.util.List<java.lang.Integer> toIntArray()
      private
      java.lang.String toString()  
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
    • 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 class java.lang.Object
      • toIntArray

        public java.util.List<java.lang.Integer> toIntArray()
        private
      • toFloatArray

        public java.util.List<java.lang.Float> toFloatArray()
        private