Package com.openinventor.inventor
Class SbLine
- java.lang.Object
-
- com.openinventor.inventor.SbBasic
-
- com.openinventor.inventor.SbLine
-
-
Field Summary
Fields Modifier and Type Field Description float[]
array
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description SbVec3f
getClosestPoint(SbVec3f point)
Returns the closest point on the line to the given point.SbVec3f[]
getClosestPoints(SbLine line2)
Finds the two closest points between this line and line2, and loads them into ptOnThis and ptOnLine2.SbVec3f
getDirection()
Returns direction vector of line.SbVec3f
getPosition()
Returns position of line origin point.float[]
getValue()
static void
setIntersectEpsilon(float epsilon)
Setup epsilon to detect intersection of very small geometry.void
setPosDir(SbVec3f position, SbVec3f direction)
Sets line using a position and a direction vector.SbLine
setValue(float[] components)
SbLine
setValue(float[] components, int startIndex)
void
setValue(SbLine copyFrom)
void
setValue(SbLined line)
Sets line from a double precision line.void
setValue(SbVec3f p0, SbVec3f p1)
Sets line to pass through points p0 and p1.static SbLine[]
toArray(long nativeArray, long length)
-
-
-
Constructor Detail
-
SbLine
public SbLine(float[] components)
-
SbLine
public SbLine(SbLine copyFrom)
-
SbLine
public SbLine(SbVec3f p0, SbVec3f 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 thesetPosDir()
method is recommended to avoid floating point precision problems.
-
SbLine
public SbLine()
Default constructor. The line is not initialized.
-
-
Method Detail
-
setValue
public SbLine setValue(float[] components)
-
getValue
public float[] getValue()
-
setValue
public void setValue(SbLine copyFrom)
-
setValue
public SbLine setValue(float[] components, int startIndex)
-
getClosestPoint
public SbVec3f getClosestPoint(SbVec3f point)
Returns the closest point on the line to the given point.
-
toArray
public static SbLine[] toArray(long nativeArray, long length)
-
getClosestPoints
public SbVec3f[] getClosestPoints(SbLine 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(SbLined line)
Sets line from a double precision line.
-
setIntersectEpsilon
public static void setIntersectEpsilon(float epsilon)
Setup epsilon to detect intersection of very small geometry.
-
setPosDir
public void setPosDir(SbVec3f position, SbVec3f 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 SbVec3f getPosition()
Returns position of line origin point.
-
getDirection
public SbVec3f getDirection()
Returns direction vector of line.
-
-