Class Sphere
java.lang.Object
eu.mihosoft.vrl.v3d.Sphere
- All Implemented Interfaces:
Primitive
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionintintReturns the property storage of this primitive.doublevoidvoidsetNumSlices(int numSlices) voidsetNumStacks(int numStacks) voidsetRadius(double radius) Returns the polygons that define this primitive.
-
Constructor Details
-
Sphere
public Sphere()Constructor. Creates a sphere with radius 1, 16 slices and 8 stacks and center [0,0,0]. -
Sphere
public Sphere(double radius) Constructor. Creates a sphere with the specified radius, 16 slices and 8 stacks and center [0,0,0].- Parameters:
radius- sphare radius
-
Sphere
public Sphere(double radius, int numSlices, int numStacks) Constructor. Creates a sphere with the specified radius, number of slices and stacks.- Parameters:
radius- sphare radiusnumSlices- number of slicesnumStacks- number of stacks
-
Sphere
Constructor. Creates a sphere with the specified center, radius, number of slices and stacks.- Parameters:
center- center of the sphereradius- sphere radiusnumSlices- number of slicesnumStacks- number of stacks
-
-
Method Details
-
toPolygons
Description copied from interface:PrimitiveReturns the polygons that define this primitive. Note: this method computes the polygons each time this method is called. The polygons can be cached inside aCSGobject.- Specified by:
toPolygonsin interfacePrimitive- Returns:
- a list of polygons that define this primitive
-
getCenter
- Returns:
- the center
-
setCenter
- Parameters:
center- the center to set
-
getRadius
public double getRadius()- Returns:
- the radius
-
setRadius
public void setRadius(double radius) - Parameters:
radius- the radius to set
-
getNumSlices
public int getNumSlices()- Returns:
- the numSlices
-
setNumSlices
public void setNumSlices(int numSlices) - Parameters:
numSlices- the numSlices to set
-
getNumStacks
public int getNumStacks()- Returns:
- the numStacks
-
setNumStacks
public void setNumStacks(int numStacks) - Parameters:
numStacks- the numStacks to set
-
getProperties
Description copied from interface:PrimitiveReturns the property storage of this primitive.- Specified by:
getPropertiesin interfacePrimitive- Returns:
- the property storage of this primitive
-