Package mgui.geometry

Class Sphere3D

java.lang.Object
mgui.geometry.Shape3D
mgui.geometry.Sphere3D
All Implemented Interfaces:
java.lang.Cloneable, Shape, XMLObject

public class Sphere3D
extends Shape3D
Represents a sphere in R3.
Since:
1.0
Version:
1.0
Author:
Andrew Reid
  • Field Details

    • center

      public org.jogamp.vecmath.Point3f center
    • radius

      public float radius
  • Constructor Details

    • Sphere3D

      public Sphere3D()
    • Sphere3D

      public Sphere3D​(org.jogamp.vecmath.Point3f c, float r)
    • Sphere3D

      public Sphere3D​(org.jogamp.java3d.BoundingSphere bs)
  • Method Details

    • getBoundBox

      public Box3D getBoundBox()
      Overrides:
      getBoundBox in class Shape3D
    • getCoords

      public float[] getCoords()
      Specified by:
      getCoords in interface Shape
      Specified by:
      getCoords in class Shape3D
    • getVertex

      public org.jogamp.vecmath.Point3f getVertex​(int index)
      Description copied from class: Shape3D
      Returns the vertex at the specified index as a Point3f. This vertex is a copy, so operations performed on it will not affect this shape.

      Note: subclasses may want to provide a more efficient implementation of this method.

      Specified by:
      getVertex in class Shape3D
      Returns:
    • getVertices

      public java.util.ArrayList<org.jogamp.vecmath.Point3f> getVertices()
      Description copied from class: Shape3D
      Returns a list of this shape's nodes as Point3f's. This list is a copy, so operations performed on these nodes will not affect this shape.
      Specified by:
      getVertices in class Shape3D
      Returns:
    • setCoords

      public void setCoords​(float[] f)
      Specified by:
      setCoords in interface Shape
      Specified by:
      setCoords in class Shape3D
    • setVertices

      public void setVertices​(java.util.ArrayList<org.jogamp.vecmath.Point3f> n)
      Specified by:
      setVertices in class Shape3D