com.aspose.threed

Interfaces

Classes

Enums

Exceptions

com.aspose.threed

Class Vector4

  • java.lang.Object
    • com.aspose.threed.Vector4
  • All Implemented Interfaces:
    com.aspose.threed.Struct<Vector4>, java.io.Serializable, java.lang.Cloneable


    public final class Vector4
    extends java.lang.Object
    implements com.aspose.threed.Struct<Vector4>, java.io.Serializable
    A vector with four components.
    See Also:
    Serialized Form
    • Field Summary

      Fields 
      Modifier and Type Field and Description
      double w
      The w component.
      double x
      The x component.
      double y
      The y component.
      double z
      The z component.
    • Constructor Summary

      Constructors 
      Constructor and Description
      Vector4() 
      Vector4(java.awt.Color color)
      Initializes a new instance of the Vector4 struct.
      Vector4(double x, double y, double z)
      Initializes a new instance of the Vector4 struct.
      Vector4(double x, double y, double z, double w)
      Initializes a new instance of the Vector4 struct.
      Vector4(Vector3 vec)
      Initializes a new instance of the Vector4 struct.
      Vector4(Vector3 vec, double w)
      Initializes a new instance of the Vector4 struct.
    • Field Detail

      • x

        public double x
        The x component.
      • y

        public double y
        The y component.
      • z

        public double z
        The z component.
      • w

        public double w
        The w component.
    • Constructor Detail

      • Vector4

        public Vector4(java.awt.Color color)
        Initializes a new instance of the Vector4 struct.
        Parameters:
        color - Color.
      • Vector4

        public Vector4(Vector3 vec,
                       double w)
        Initializes a new instance of the Vector4 struct.
        Parameters:
        vec - Vec.
        w - The width.
      • Vector4

        public Vector4(Vector3 vec)
        Initializes a new instance of the Vector4 struct.
        Parameters:
        vec - Vec.
      • Vector4

        public Vector4(double x,
                       double y,
                       double z)
        Initializes a new instance of the Vector4 struct.
        Parameters:
        x - The x coordinate.
        y - The y coordinate.
        z - The z coordinate.
      • Vector4

        public Vector4(double x,
                       double y,
                       double z,
                       double w)
        Initializes a new instance of the Vector4 struct.
        Parameters:
        x - The x coordinate.
        y - The y coordinate.
        z - The z coordinate.
        w - The width.
      • Vector4

        public Vector4()
    • Method Detail

      • add

        public static Vector4 add(Vector4 lhs,
                                  Vector4 rhs)
        Operator overloading for +
        Parameters:
        lhs - The left vector
        rhs - The right vector
        Returns:
        Result vector
      • sub

        public static Vector4 sub(Vector4 lhs,
                                  Vector4 rhs)
        Operator overloading for - (minus)
        Parameters:
        lhs - The left vector
        rhs - The right vector
        Returns:
        Result vector
      • mul

        public static Vector4 mul(Vector4 lhs,
                                  Vector4 rhs)
        Operator overloading for *
        Parameters:
        lhs - The left vector
        rhs - The right vector
        Returns:
        Result vector
      • mul

        public static Vector4 mul(Vector4 lhs,
                                  double rhs)
        Operator overloading for *
        Parameters:
        lhs - The left vector
        rhs - The right double value
        Returns:
        Result vector
      • set

        public void set(double newX,
                        double newY,
                        double newZ)
        Sets vector's xyz components at a time, w will be set to 1
        Parameters:
        newX - New X component.
        newY - New Y component.
        newZ - New Z component.
      • equals

        public boolean equals(java.lang.Object obj)
        Check if two vectors are equal
        Overrides:
        equals in class java.lang.Object
        Parameters:
        obj -
      • set

        public void set(double newX,
                        double newY,
                        double newZ,
                        double newW)
        Sets vector's all components at a time
        Parameters:
        newX - New X component.
        newY - New Y component.
        newZ - New Z component.
        newW - New W component.
      • toString

        public java.lang.String toString()
        Returns a String that represents the current Vector4.
        Overrides:
        toString in class java.lang.Object
        Returns:
        A String that represents the current Vector4.
      • clone

        public Vector4 clone()
        Specified by:
        clone in interface com.aspose.threed.Struct<Vector4>
        Overrides:
        clone in class java.lang.Object
      • copyFrom

        public void copyFrom(Vector4 src)
        Specified by:
        copyFrom in interface com.aspose.threed.Struct<Vector4>
      • hashCode

        public int hashCode()
        Gets the hash code of this vector
        Overrides:
        hashCode in class java.lang.Object