net.java.joglutils.msg.math
Class Sphere

java.lang.Object
  extended by net.java.joglutils.msg.math.Sphere

public class Sphere
extends Object

Represents a sphere.


Constructor Summary
Sphere()
          Default constructor creates a sphere with center (0, 0, 0) and radius 0
Sphere(Box3f box)
           
Sphere(Sphere other)
           
Sphere(Vec3f center, float radius)
           
 
Method Summary
 void extendBy(Sphere arg)
          Mutate this sphere to encompass both itself and the argument.
 Vec3f getCenter()
           
 float getRadius()
           
 void makeEmpty()
          Re-initialize this sphere to center (0, 0, 0) and radius 0
 void set(Box3f box)
          Sets this sphere to encompass the given box
 void set(Sphere other)
          Sets the parameters of this sphere to those of the given one
 void set(Vec3f center, float radius)
           
 void setCenter(Vec3f center)
           
 void setRadius(float radius)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Sphere

public Sphere()
Default constructor creates a sphere with center (0, 0, 0) and radius 0


Sphere

public Sphere(Vec3f center,
              float radius)

Sphere

public Sphere(Sphere other)

Sphere

public Sphere(Box3f box)
Method Detail

makeEmpty

public void makeEmpty()
Re-initialize this sphere to center (0, 0, 0) and radius 0


setCenter

public void setCenter(Vec3f center)

getCenter

public Vec3f getCenter()

setRadius

public void setRadius(float radius)

getRadius

public float getRadius()

set

public void set(Vec3f center,
                float radius)

set

public void set(Sphere other)
Sets the parameters of this sphere to those of the given one


set

public void set(Box3f box)
Sets this sphere to encompass the given box


extendBy

public void extendBy(Sphere arg)
Mutate this sphere to encompass both itself and the argument. Ignores zero-size arguments.