Class SbLined


  • public class SbLined
    extends SbBasic
    Directed line in 3D (double precision). Represents a (double precision) directed line in 3D. This is a basic Open Inventor datatype that is used for representing a 3D line. It is used as input and output by a variety of Open Inventor classes.

    See Also:
    SbVec3d, SbLine, SbPlane
    • Field Detail

      • array

        public final double[] array
    • Constructor Detail

      • SbLined

        public SbLined​(double[] components)
      • SbLined

        public SbLined​(SbLined copyFrom)
      • SbLined

        public SbLined​(SbVec3d p0,
                       SbVec3d p1)
        Constructor. The line is directed from p0 to p1.
        To construct a line from a position and direction you can use: SbLine(p0, p0 + dir), but using the default constructor followed by the setPosDir() method is recommended to avoid floating point precision problems.
      • SbLined

        public SbLined()
        Default constructor. The line is not initialized.
    • Method Detail

      • getValue

        public double[] getValue()
      • setValue

        public SbLined setValue​(double[] components,
                                int startIndex)
      • setValue

        public SbLined setValue​(double[] components)
      • setValue

        public void setValue​(SbLined copyFrom)
      • toArray

        public static SbLined[] toArray​(long nativeArray,
                                        long length)
      • getClosestPoint

        public SbVec3d getClosestPoint​(SbVec3d point)
        Returns the closest point on the line to the given point.
      • getClosestPoints

        public SbVec3d[] getClosestPoints​(SbLined line2)
        Finds the two closest points between this line and line2, and loads them into ptOnThis and ptOnLine2. Returns false if the lines are parallel (results undefined), and returns true otherwise.
      • setValue

        public void setValue​(SbLine line)
        Set value from single precision line.
      • setValue

        public void setValue​(SbVec3d p0,
                             SbVec3d p1)
        Sets line to pass through points p0 and p1.
      • setIntersectEpsilon

        public static void setIntersectEpsilon​(double epsilon)
        Setup epsilon to detect intersection of very small geometry.
      • setPosDir

        public void setPosDir​(SbVec3d position,
                              SbVec3d direction)
        Sets line using a position and a direction vector. The direction vector will be normalized automatically. This method is preferred over setValue when the point has very large magnitude, for example 1e6, because adding a normalized direction vector to such a point may not be significant.
      • getPosition

        public SbVec3d getPosition()
        Returns position of line origin point.
      • getDirection

        public SbVec3d getDirection()
        Returns direction vector of line.