public final class R2UnitSphere extends Object implements R2UnitSphereType
R2UnitSphereType interface.| Modifier and Type | Method and Description |
|---|---|
com.io7m.jcanephora.core.JCGLArrayObjectUsableType |
arrayObject() |
void |
delete(com.io7m.jcanephora.core.api.JCGLInterfaceGL33Type g)
Delete the current object.
|
static double |
getCircleArea(double r)
Calculate the area of a circle with radius
r. |
com.io7m.junsigned.ranges.UnsignedRangeInclusiveL |
getRange() |
static double |
getUVSphereApproximationArea(double r,
int s)
Calculate the area of an approximation of a circle with radius
r
constructed with s line segments. |
static double |
getUVSphereApproximationScaleFactor(double r,
int s)
Calculate the scale factor required to completely contain a circle of
radius
r inside an approximation with radius r constructed
with s line segments. |
static double |
getUVSphereApproximationTriangleArea(double r,
int s)
Calculate the area of one of the triangles that make up an approximation
of a circle with radius
r constructed with s line
segments. |
static double |
getUVSphereTriangleInteriorAngle(int s)
A UV sphere approximates a real sphere by using a fixed number of
vertical segments.
|
boolean |
isDeleted() |
static R2UnitSphereType |
newUnitSphere8(com.io7m.jcanephora.core.api.JCGLInterfaceGL33Type g)
Construct a new
8 segment unit sphere. |
public static R2UnitSphereType newUnitSphere8(com.io7m.jcanephora.core.api.JCGLInterfaceGL33Type g)
8 segment unit sphere.g - An OpenGL interfacepublic static double getUVSphereTriangleInteriorAngle(int s)
A UV sphere approximates a real sphere by using a fixed number of
vertical segments. When using 8 segments, for example, the sphere
looks like an octagon when viewed from above. This function returns the
interior angle, in radians, of one of the triangles that make up the
shape.
The following always holds: 2 * π = n * getUVSphereTriangleInteriorAngle(n)
s - The number of segmentspublic static double getUVSphereApproximationTriangleArea(double r,
int s)
Calculate the area of one of the triangles that make up an approximation
of a circle with radius r constructed with s line
segments.
r - The radiuss - The number of segments in the approximationpublic static double getUVSphereApproximationScaleFactor(double r,
int s)
Calculate the scale factor required to completely contain a circle of
radius r inside an approximation with radius r constructed
with s line segments.
r - The radiuss - The number of segments in the approximationpublic static double getUVSphereApproximationArea(double r,
int s)
Calculate the area of an approximation of a circle with radius r
constructed with s line segments.
r - The radiuss - The number of segments in the approximationpublic static double getCircleArea(double r)
Calculate the area of a circle with radius r.
r - The radiuspublic void delete(com.io7m.jcanephora.core.api.JCGLInterfaceGL33Type g)
throws R2Exception
R2DeletableTypedelete in interface R2DeletableTypeg - An OpenGL interfaceR2Exception - On errorspublic com.io7m.jcanephora.core.JCGLArrayObjectUsableType arrayObject()
arrayObject in interface R2UnitSphereUsableTypepublic com.io7m.junsigned.ranges.UnsignedRangeInclusiveL getRange()
getRange in interface com.io7m.jcanephora.core.JCGLResourceSizedTypepublic boolean isDeleted()
isDeleted in interface com.io7m.jcanephora.core.JCGLResourceUsableTypeCopyright © 2016 <code@io7m.com> http://io7m.com