Sphere

A sphere, represented by its center and radius.

Constructors

this
this(graphene_sphere_t* graphene_sphere, bool ownedRef)

Sets our main struct and passes it to the parent class.

this
this()

Allocates a new #graphene_sphere_t.

Destructor

~this
~this()
Undocumented in source.

Members

Functions

containsPoint
bool containsPoint(Point3D point)

Checks whether the given @point is contained in the volume of a #graphene_sphere_t.

distance
float distance(Point3D point)

Computes the distance of the given @point from the surface of a #graphene_sphere_t.

equal
bool equal(Sphere b)

Checks whether two #graphene_sphere_t are equal.

free
void free()

Frees the resources allocated by graphene_sphere_alloc().

getBoundingBox
void getBoundingBox(Box box)

Computes the bounding box capable of containing the given #graphene_sphere_t.

getCenter
void getCenter(Point3D center)

Retrieves the coordinates of the center of a #graphene_sphere_t.

getRadius
float getRadius()

Retrieves the radius of a #graphene_sphere_t.

getSphereStruct
graphene_sphere_t* getSphereStruct(bool transferOwnership)

Get the main Gtk struct

getStruct
void* getStruct()

the main Gtk struct as a void*

init
Sphere init(Point3D center, float radius)

Initializes the given #graphene_sphere_t with the given @center and @radius.

initFromPoints
Sphere initFromPoints(Point3D[] points, Point3D center)

Initializes the given #graphene_sphere_t using the given array of 3D coordinates so that the sphere includes them.

initFromVectors
Sphere initFromVectors(Vec3[] vectors, Point3D center)

Initializes the given #graphene_sphere_t using the given array of 3D coordinates so that the sphere includes them.

isEmpty
bool isEmpty()

Checks whether the sphere has a zero radius.

translate
void translate(Point3D point, Sphere res)

Translates the center of the given #graphene_sphere_t using the @point coordinates as the delta of the translation.

Static functions

getType
GType getType()

Variables

graphene_sphere
graphene_sphere_t* graphene_sphere;

the main Gtk struct

ownedRef
bool ownedRef;
Undocumented in source.

Meta