public final class R2UnitSphere extends Object implements R2UnitSphereType
R2UnitSphereType
interface.Modifier and Type | Method and Description |
---|---|
com.io7m.jcanephora.core.JCGLArrayObjectUsableType |
arrayObject() |
com.io7m.junsigned.ranges.UnsignedRangeInclusiveL |
byteRange() |
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 . |
boolean |
isDeleted() |
static R2UnitSphereType |
newUnitSphere8(com.io7m.jcanephora.core.api.JCGLInterfaceGL33Type g)
Construct a new
8 segment unit sphere. |
static double |
uvSphereApproximationArea(double r,
int s)
Calculate the area of an approximation of a circle with radius
r
constructed with s line segments. |
static double |
uvSphereApproximationScaleFactor(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 |
uvSphereApproximationTriangleArea(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 |
uvSphereTriangleInteriorAngle(int s)
A UV sphere approximates a real sphere by using a fixed number of
vertical segments.
|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
wrap
public static R2UnitSphereType newUnitSphere8(com.io7m.jcanephora.core.api.JCGLInterfaceGL33Type g)
8
segment unit sphere.g
- An OpenGL interfacepublic static double uvSphereTriangleInteriorAngle(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 * uvSphereTriangleInteriorAngle(n)
s
- The number of segmentspublic static double uvSphereApproximationTriangleArea(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 uvSphereApproximationScaleFactor(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 uvSphereApproximationArea(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
R2DeletableType
delete
in interface R2DeletableType
g
- An OpenGL interfaceR2Exception
- On errorspublic com.io7m.jcanephora.core.JCGLArrayObjectUsableType arrayObject()
arrayObject
in interface R2UnitSphereUsableType
public com.io7m.junsigned.ranges.UnsignedRangeInclusiveL byteRange()
byteRange
in interface com.io7m.jcanephora.core.JCGLResourceSizedType
public boolean isDeleted()
isDeleted
in interface com.io7m.jcanephora.core.JCGLResourceUsableType
Copyright © 2017 <code@io7m.com> http://io7m.com