Class SbSphere

java.lang.Object
com.openinventor.inventor.SbBasic
com.openinventor.inventor.SbSphere

public class SbSphere extends SbBasic
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 Details

    • array

      public final float[] array
  • Constructor Details

    • SbSphere

      public SbSphere(SbSphere copyFrom)
    • SbSphere

      public SbSphere(float[] components)
    • SbSphere

      public SbSphere(SbVec3f c, float r)
      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

      public SbSphere setValue(float[] components, int startIndex)
    • setValue

      public void setValue(SbSphere copyFrom)
    • setValue

      public SbSphere setValue(float[] components)
    • toArray

      public static SbSphere[] toArray(long nativeArray, long length)
    • intersect

      public SbVec3f[] intersect(SbLine l)
      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

      public void setValue(SbVec3f c, float r)
      Change the center and radius.
    • setCenter

      public void setCenter(SbVec3f c)
      Set the center.
    • circumscribe

      public void circumscribe(SbBox3f box)
      Return a sphere containing a given box.
    • intersectFirst

      public SbVec3f intersectFirst(SbLine l)
      Intersect line and sphere, returning true if there is an intersection. The line is treated as a ray.
    • getCenter

      public SbVec3f getCenter()
      Return the center.
    • getRadius

      public float getRadius()
      Return the radius.