Package javajs.util

Class T4

All Implemented Interfaces:
Serializable, JSONEncodable
Direct Known Subclasses:
P4

public abstract class T4 extends T3
A generic 4 element tuple that is represented by single precision floating point x,y,z and w coordinates.
Version:
specification 1.1, implementation $Revision: 1.9 $, $Date: 2006/07/28 17:01:32 $
Author:
Kenji hiranabe additions by Bob Hanson hansonr@stolaf.edu 9/30/2012 for unique constructor and method names for the optimization of compiled JavaScript using Java2Script
See Also:
  • Field Details

    • w

      public float w
      The w coordinate.
  • Constructor Details

    • T4

      public T4()
      Constructs and initializes a Tuple4f to (0,0,0,0).
  • Method Details

    • set4

      public final void set4(float x, float y, float z, float w)
      Sets the value of this tuple to the specified xyzw coordinates.
      Parameters:
      x - the x coordinate
      y - the y coordinate
      z - the z coordinate
      w - the w coordinate
    • scale4

      public final void scale4(float s)
      Sets the value of this tuple to the scalar multiplication of itself.
      Parameters:
      s - the scalar value
    • hashCode

      public int hashCode()
      Returns a hash number based on the data values in this object. Two different Tuple4f objects with identical data values (ie, returns true for equals(Tuple4f) ) will return the same hash number. Two vectors with different data members may return the same hash value, although this is not likely.
      Overrides:
      hashCode in class T3
    • equals

      public boolean equals(Object o)
      Returns true if all of the data members of Object are equal to the corresponding data members in this
      Overrides:
      equals in class T3
      Parameters:
      o - the vector with which the comparison is made.
    • toString

      public String toString()
      Returns a string that contains the values of this Tuple4f. The form is (x,y,z,w).
      Overrides:
      toString in class T3
      Returns:
      the String representation
    • toJSON

      public String toJSON()
      Specified by:
      toJSON in interface JSONEncodable
      Overrides:
      toJSON in class T3