com.supermap.ar.areffect

Class Vector

  • java.lang.Object
    • com.supermap.ar.areffect.Vector


  • public class Vector
    extends java.lang.Object
    AR vector. It is used for determining the rotation axis The direction of each vector is from the origin of coordinates to the specific point
    • Constructor Detail

      • Vector

        public Vector(float x,
                      float y,
                      float z)
        Constructs an AR vector
        Parameters:
        x -
        y -
        z -
    • Method Detail

      • setX

        public void setX(float x)
        Sets the x coordinate
        Parameters:
        x -
      • getX

        public float getX()
        Gets the x coordinate
        Returns:
      • setY

        public void setY(float y)
        Sets the y coordinate
        Parameters:
        y -
      • getY

        public float getY()
        Gets the y coordinate
        Returns:
      • getZ

        public float getZ()
        Gets the z coordinate
        Returns:
      • setZ

        public void setZ(float z)
        Sets the z coordinate
        Parameters:
        z -
      • scaled

        public Vector scaled(float a)
        Uniformly scales a Vector3
        Returns:
        a Vector3 multiplied by a scalar amount
      • negated

        public Vector negated()
        Negates a Vector3
        Returns:
        A Vector3 with opposite direction
      • add

        public static Vector add(Vector lhs,
                                 Vector rhs)
        Adds two Vector3's
        Returns:
        The combined Vector3
      • subtract

        public static Vector subtract(Vector lhs,
                                      Vector rhs)
        Subtract two Vector3
        Returns:
        The combined Vector3
      • dot

        public static float dot(Vector lhs,
                                Vector rhs)
        Get dot product of two Vector3's
        Returns:
        The scalar product of the Vector3's
      • cross

        public static Vector cross(Vector lhs,
                                   Vector rhs)
        Get cross product of two Vector3's
        Returns:
        A Vector3 perpendicular to Vector3's
      • length

        public float length()
        Returns:
      • lengthSquared

        public float lengthSquared()
        Returns: