Package ch.bailu.gtk.graphene
Class Sphere
java.lang.Object
ch.bailu.gtk.type.Type
ch.bailu.gtk.type.Pointer
ch.bailu.gtk.type.Record
ch.bailu.gtk.graphene.Sphere
- All Implemented Interfaces:
PointerInterface
A sphere, represented by its center and radius.
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic SphereAllocates a new #graphene_sphere_t.booleancontainsPoint(Point3D point) Checks whether the given @point is contained in the volume
of a #graphene_sphere_t.floatComputes the distance of the given @point from the surface of
a #graphene_sphere_t.booleanChecks whether two #graphene_sphere_t are equal.voidfree()Frees the resources allocated by graphene_sphere_alloc().voidgetBoundingBox(Box box) Computes the bounding box capable of containing the
given #graphene_sphere_t.voidRetrieves the coordinates of the center of a #graphene_sphere_t.static ClassHandlerfloatstatic intstatic longstatic TypeSystem.TypeSizefloatRetrieves the radius of a #graphene_sphere_t.static longstatic TypeSystem.TypeSizeInitializes the given #graphene_sphere_t with the given @center and @radius.booleanisEmpty()Checks whether the sphere has a zero radius.voidTranslates the center of the given #graphene_sphere_t using the @point
coordinates as the delta of the translation.Methods inherited from class ch.bailu.gtk.type.Pointer
asCPointer, cast, connectSignal, disconnectSignals, disconnectSignals, equals, hashCode, throwIfNull, throwNullPointerException, toString, unregisterCallbacks, unregisterCallbacksMethods inherited from class ch.bailu.gtk.type.Type
asCPointer, asCPointer, asCPointerNotNull, asJnaPointer, asJnaPointer, asPointer, asPointer, cast, cast, throwIfNullMethods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, waitMethods inherited from interface ch.bailu.gtk.type.PointerInterface
asCPointerNotNull, asJnaPointer, asPointer, isNotNull, isNull
-
Field Details
-
CENTER
Private field: direct-type- See Also:
-
RADIUS
- See Also:
-
-
Constructor Details
-
Sphere
-
Sphere
public Sphere()
-
-
Method Details
-
getClassHandler
-
getFieldRadius
public float getFieldRadius() -
allocSphere
Allocates a new #graphene_sphere_t.
The contents of the newly allocated structure are undefined.- Returns:
- the newly allocated #graphene_sphere_t. Use graphene_sphere_free() to free the resources allocated by this function
-
containsPoint
Checks whether the given @point is contained in the volume
of a #graphene_sphere_t.- Parameters:
point- a #graphene_point3d_t- Returns:
- `true` if the sphere contains the point
-
distance
Computes the distance of the given @point from the surface of
a #graphene_sphere_t.- Parameters:
point- a #graphene_point3d_t- Returns:
- the distance of the point
-
equal
Checks whether two #graphene_sphere_t are equal.- Parameters:
b- a #graphene_sphere_t- Returns:
- `true` if the spheres are equal
-
free
public void free()Frees the resources allocated by graphene_sphere_alloc(). -
getBoundingBox
Computes the bounding box capable of containing the
given #graphene_sphere_t.- Parameters:
box- return location for the bounding box
-
getCenter
Retrieves the coordinates of the center of a #graphene_sphere_t.- Parameters:
center- return location for the coordinates of the center
-
getRadius
public float getRadius()Retrieves the radius of a #graphene_sphere_t.- Returns:
-
init
Initializes the given #graphene_sphere_t with the given @center and @radius.- Parameters:
center- the coordinates of the center of the sphere, or %NULL for a center in (0, 0, 0)radius- the radius of the sphere- Returns:
- the initialized #graphene_sphere_t
-
isEmpty
public boolean isEmpty()Checks whether the sphere has a zero radius.- Returns:
- `true` if the sphere is empty
-
translate
Translates the center of the given #graphene_sphere_t using the @point
coordinates as the delta of the translation.- Parameters:
point- the coordinates of the translationres- return location for the translated sphere
-
getTypeID
public static long getTypeID() -
getParentTypeID
public static long getParentTypeID() -
getTypeSize
-
getParentTypeSize
-
getInstanceSize
public static int getInstanceSize()
-