Class Segment

  • All Implemented Interfaces:
    java.io.Serializable

    public class Segment
    extends java.lang.Object
    implements java.io.Serializable
    A Segment is a line in 3-space having a starting and an ending position.
    See Also:
    Serialized Form
    • Field Summary

      Fields 
      Modifier and Type Field Description
      Vector3 a
      the starting position
      Vector3 b
      the ending position
    • Constructor Summary

      Constructors 
      Constructor Description
      Segment​(float aX, float aY, float aZ, float bX, float bY, float bZ)
      Constructs a new Segment from the two points given.
      Segment​(Vector3 a, Vector3 b)
      Constructs a new Segment from the two points given.
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      boolean equals​(java.lang.Object o)  
      int hashCode()  
      float len()  
      float len2()  
      • Methods inherited from class java.lang.Object

        clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait
    • Field Detail

      • a

        public final Vector3 a
        the starting position
      • b

        public final Vector3 b
        the ending position
    • Constructor Detail

      • Segment

        public Segment​(Vector3 a,
                       Vector3 b)
        Constructs a new Segment from the two points given.
        Parameters:
        a - the first point
        b - the second point
      • Segment

        public Segment​(float aX,
                       float aY,
                       float aZ,
                       float bX,
                       float bY,
                       float bZ)
        Constructs a new Segment from the two points given.
        Parameters:
        aX - the x-coordinate of the first point
        aY - the y-coordinate of the first point
        aZ - the z-coordinate of the first point
        bX - the x-coordinate of the second point
        bY - the y-coordinate of the second point
        bZ - the z-coordinate of the second point
    • Method Detail

      • len

        public float len()
      • len2

        public float len2()
      • equals

        public boolean equals​(java.lang.Object o)
        Overrides:
        equals in class java.lang.Object
      • hashCode

        public int hashCode()
        Overrides:
        hashCode in class java.lang.Object