Package com.openinventor.inventor
Class SbPlane
- java.lang.Object
-
- com.openinventor.inventor.SbBasic
-
- com.openinventor.inventor.SbPlane
-
-
Field Summary
Fields Modifier and Type Field Description float[]array
-
Constructor Summary
Constructors Constructor Description SbPlane()Default constructor.SbPlane(float[] components)SbPlane(SbPlane copyFrom)SbPlane(SbVec3f normal, float distance)Constructor.SbPlane(SbVec3f normal, SbVec3f point)Constructor.SbPlane(SbVec3f p0, SbVec3f p1, SbVec3f p2)Constructor.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description booleanequals(java.lang.Object obj)floatgetDistance(SbVec3f point)Returns the distance from a point to plane.floatgetDistanceFromOrigin()Returns distance from origin to plane.SbVec3fgetNormal()Returns normal vector to plane.float[]getValue()SbVec3fintersect(SbLine l)Intersect line and plane, returning true if there is an intersection, false if line is parallel to plane.booleanisInHalfSpace(SbVec3f point)Returns true if the given point is within the half-space defined by the plane.voidoffset(float d)Offset a plane by a given distance.SbPlanesetValue(float[] components)SbPlanesetValue(float[] components, int startIndex)voidsetValue(SbPlane copyFrom)static SbPlane[]toArray(long nativeArray, long length)voidtransform(SbMatrix matrix)Transforms the plane by the given matrix.
-
-
-
Constructor Detail
-
SbPlane
public SbPlane(float[] components)
-
SbPlane
public SbPlane(SbPlane copyFrom)
-
SbPlane
public SbPlane(SbVec3f normal, float distance)
Constructor. normal is a normal vector and distance is distance from origin to plane along normal vector.
-
SbPlane
public SbPlane(SbVec3f p0, SbVec3f p1, SbVec3f p2)
Constructor. p0, p1, and p2 represent three points in the plane.
-
SbPlane
public SbPlane(SbVec3f normal, SbVec3f point)
Constructor. normal is a normal vector and point is a point in 3-space for the plane to pass through.
-
SbPlane
public SbPlane()
Default constructor. The plane is not initialized.
-
-
Method Detail
-
setValue
public SbPlane setValue(float[] components)
-
setValue
public SbPlane setValue(float[] components, int startIndex)
-
getValue
public float[] getValue()
-
setValue
public void setValue(SbPlane copyFrom)
-
transform
public void transform(SbMatrix matrix)
Transforms the plane by the given matrix.
-
getDistance
public float getDistance(SbVec3f point)
Returns the distance from a point to plane. Positive distance means the point is in the plane's half space.
-
toArray
public static SbPlane[] toArray(long nativeArray, long length)
-
offset
public void offset(float d)
Offset a plane by a given distance.
-
intersect
public SbVec3f intersect(SbLine l)
Intersect line and plane, returning true if there is an intersection, false if line is parallel to plane.
-
getDistanceFromOrigin
public float getDistanceFromOrigin()
Returns distance from origin to plane.
-
equals
public boolean equals(java.lang.Object obj)
- Overrides:
equalsin classjava.lang.Object
-
getNormal
public SbVec3f getNormal()
Returns normal vector to plane.
-
isInHalfSpace
public boolean isInHalfSpace(SbVec3f point)
Returns true if the given point is within the half-space defined by the plane.
-
-