toxi.geom.mesh
Class SphereFunction

java.lang.Object
  extended by toxi.geom.mesh.SphereFunction
All Implemented Interfaces:
SurfaceFunction

public class SphereFunction
extends java.lang.Object
implements SurfaceFunction

This implementation of a SurfaceFunction samples a given Sphere instance when called by the SurfaceMeshBuilder.


Field Summary
 Sphere sphere
           
 
Constructor Summary
SphereFunction()
           
SphereFunction(float radius)
          Creates a new instance using a sphere of the given radius, located at the world origin.
SphereFunction(Sphere s)
          Creates a new instance using the given sphere
 
Method Summary
 Vec3D computeVertexFor(Vec3D p, float phi, float theta)
           
 float getPhiRange()
           
 int getPhiResolutionLimit(int res)
           
 float getThetaRange()
           
 int getThetaResolutionLimit(int res)
           
 void setMaxPhi(float max)
           
 void setMaxTheta(float max)
           
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

sphere

public Sphere sphere
Constructor Detail

SphereFunction

public SphereFunction()

SphereFunction

public SphereFunction(float radius)
Creates a new instance using a sphere of the given radius, located at the world origin.

Parameters:
radius -

SphereFunction

public SphereFunction(Sphere s)
Creates a new instance using the given sphere

Parameters:
s - sphere
Method Detail

computeVertexFor

public Vec3D computeVertexFor(Vec3D p,
                              float phi,
                              float theta)
Specified by:
computeVertexFor in interface SurfaceFunction

getPhiRange

public float getPhiRange()
Specified by:
getPhiRange in interface SurfaceFunction

getPhiResolutionLimit

public int getPhiResolutionLimit(int res)
Specified by:
getPhiResolutionLimit in interface SurfaceFunction

getThetaRange

public float getThetaRange()
Specified by:
getThetaRange in interface SurfaceFunction

getThetaResolutionLimit

public int getThetaResolutionLimit(int res)
Specified by:
getThetaResolutionLimit in interface SurfaceFunction

setMaxPhi

public void setMaxPhi(float max)

setMaxTheta

public void setMaxTheta(float max)