Package com.openinventor.inventor
Class SbSphere
java.lang.Object
com.openinventor.inventor.SbBasic
com.openinventor.inventor.SbSphere
Class for representing a sphere.
Represents a sphere in 3D. This is a lightweight datatype that is used for arguments or return values in the Open Inventor toolkit. See
SoSphere for a database sphere (used for rendering, picking, etc.).
- See Also:
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidcircumscribe(SbBox3f box) Return a sphere containing a given box.Return the center.floatReturn the radius.float[]getValue()SbVec3f[]Intersect line and sphere, returning true if there is an intersection.Intersect line and sphere, returning true if there is an intersection.voidSet the center.voidsetRadius(float r) Set the radius.setValue(float[] components) setValue(float[] components, int startIndex) voidvoidChange the center and radius.static SbSphere[]toArray(long nativeArray, long length)
-
Field Details
-
array
public final float[] array
-
-
Constructor Details
-
SbSphere
-
SbSphere
public SbSphere(float[] components) -
SbSphere
Constructor that takes a center and a radius. -
SbSphere
public SbSphere()Default constructor. The sphere is not initialized.
-
-
Method Details
-
getValue
public float[] getValue() -
setValue
-
setValue
-
setValue
-
toArray
-
intersect
Intersect line and sphere, returning true if there is an intersection. The line is treated as a ray. -
setRadius
public void setRadius(float r) Set the radius. -
setValue
Change the center and radius. -
setCenter
Set the center. -
circumscribe
Return a sphere containing a given box. -
intersectFirst
Intersect line and sphere, returning true if there is an intersection. The line is treated as a ray. -
getCenter
Return the center. -
getRadius
public float getRadius()Return the radius.
-