Box

A 3D box, described as the volume between a minimum and a maximum vertices.

Constructors

this
this(graphene_box_t* graphene_box, bool ownedRef)

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

this
this()

Allocates a new #graphene_box_t.

Destructor

~this
~this()
Undocumented in source.

Members

Aliases

unio
alias unio = union_
Undocumented in source.

Functions

containsBox
bool containsBox(Box b)

Checks whether the #graphene_box_t @a contains the given #graphene_box_t @b.

containsPoint
bool containsPoint(Point3D point)

Checks whether @box contains the given @point.

equal
bool equal(Box b)

Checks whether the two given boxes are equal.

expand
void expand(Point3D point, Box res)

Expands the dimensions of @box to include the coordinates at @point.

expandScalar
void expandScalar(float scalar, Box res)

Expands the dimensions of @box by the given @scalar value.

expandVec3
void expandVec3(Vec3 vec, Box res)

Expands the dimensions of @box to include the coordinates of the given vector.

free
void free()

Frees the resources allocated by graphene_box_alloc().

getBoundingSphere
void getBoundingSphere(Sphere sphere)

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

getBoxStruct
graphene_box_t* getBoxStruct(bool transferOwnership)

Get the main Gtk struct

getCenter
void getCenter(Point3D center)

Retrieves the coordinates of the center of a #graphene_box_t.

getDepth
float getDepth()

Retrieves the size of the @box on the Z axis.

getHeight
float getHeight()

Retrieves the size of the @box on the Y axis.

getMax
void getMax(Point3D max)

Retrieves the coordinates of the maximum point of the given #graphene_box_t.

getMin
void getMin(Point3D min)

Retrieves the coordinates of the minimum point of the given #graphene_box_t.

getSize
void getSize(Vec3 size)

Retrieves the size of the box on all three axes, and stores it into the given @size vector.

getStruct
void* getStruct()

the main Gtk struct as a void*

getVertices
void getVertices(Vec3[8] vertices)

Computes the vertices of the given #graphene_box_t.

getWidth
float getWidth()

Retrieves the size of the @box on the X axis.

init
Box init(Point3D min, Point3D max)

Initializes the given #graphene_box_t with two vertices.

initFromBox
Box initFromBox(Box src)

Initializes the given #graphene_box_t with the vertices of another #graphene_box_t.

initFromPoints
Box initFromPoints(Point3D[] points)

Initializes the given #graphene_box_t with the given array of vertices.

initFromVec3
Box initFromVec3(Vec3 min, Vec3 max)

Initializes the given #graphene_box_t with two vertices stored inside #graphene_vec3_t.

initFromVectors
Box initFromVectors(Vec3[] vectors)

Initializes the given #graphene_box_t with the given array of vertices.

intersection
bool intersection(Box b, Box res)

Intersects the two given #graphene_box_t.

union_
void union_(Box b, Box res)

Unions the two given #graphene_box_t.

Static functions

empty
Box empty()

A degenerate #graphene_box_t that can only be expanded.

getType
GType getType()
infinite
Box infinite()

A degenerate #graphene_box_t that cannot be expanded.

minusOne
Box minusOne()

A #graphene_box_t with the minimum vertex set at (-1, -1, -1) and the maximum vertex set at (0, 0, 0).

one
Box one()

A #graphene_box_t with the minimum vertex set at (0, 0, 0) and the maximum vertex set at (1, 1, 1).

oneMinusOne
Box oneMinusOne()

A #graphene_box_t with the minimum vertex set at (-1, -1, -1) and the maximum vertex set at (1, 1, 1).

zero
Box zero()

A #graphene_box_t with both the minimum and maximum vertices set at (0, 0, 0).

Variables

graphene_box
graphene_box_t* graphene_box;

the main Gtk struct

ownedRef
bool ownedRef;
Undocumented in source.

Meta