Class Line

java.lang.Object
eu.iv4xr.framework.spatial.Line

public class Line extends Object
A partial line that lies between point a and b.
Author:
Naraenda
  • Field Details

    • a

      public Vec3 a
      Point A, also used as origin point.
    • b

      public Vec3 b
      Point B
  • Constructor Details

    • Line

      public Line(Vec3 a, Vec3 b)
      Constructs a line between two point.
      Parameters:
      a - Point A
      b - Point B
  • Method Details

    • direction

      public Vec3 direction()
      Returns:
      Normalized vector from origin A to B.
    • origin

      public Vec3 origin()
      Returns:
      The origin A.
    • alongLine

      public Vec3 alongLine(float d)
      Parameters:
      d - Distance from the origin.
      Returns:
      Origin() + d * Direcition()
    • length

      public float length()
      Returns:
      Distance between A and B.