Package ch.bailu.gtk.graphene
Class Box
java.lang.Object
ch.bailu.gtk.type.Type
ch.bailu.gtk.type.Pointer
ch.bailu.gtk.type.Record
ch.bailu.gtk.graphene.Box
- All Implemented Interfaces:
PointerInterface
A 3D box, described as the volume between a minimum and
a maximum vertices.
a maximum vertices.
-
Field Summary
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionstatic Box
allocBox()
Allocates a new #graphene_box_t.boolean
containsBox
(Box b) Checks whether the #graphene_box_t @a contains the given
#graphene_box_t @b.boolean
containsPoint
(Point3D point) Checks whether @box contains the given @point.static Box
empty()
A degenerate #graphene_box_t that can only be expanded.boolean
Checks whether the two given boxes are equal.void
Expands the dimensions of @box to include the coordinates at @point.void
expandScalar
(float scalar, Box res) Expands the dimensions of @box by the given @scalar value.void
expandVec3
(Vec3 vec, Box res) Expands the dimensions of @box to include the coordinates of the
given vector.void
free()
Frees the resources allocated by graphene_box_alloc().void
getBoundingSphere
(Sphere sphere) Computes the bounding #graphene_sphere_t capable of containing the given
#graphene_box_t.void
Retrieves the coordinates of the center of a #graphene_box_t.static ClassHandler
float
getDepth()
Retrieves the size of the @box on the Z axis.float
Retrieves the size of the @box on the Y axis.static int
void
Retrieves the coordinates of the maximum point of the given
#graphene_box_t.void
Retrieves the coordinates of the minimum point of the given
#graphene_box_t.static long
static TypeSystem.TypeSize
void
Retrieves the size of the box on all three axes, and stores
it into the given @size vector.static long
static TypeSystem.TypeSize
float
getWidth()
Retrieves the size of the @box on the X axis.static Box
infinite()
A degenerate #graphene_box_t that cannot be expanded.Initializes the given #graphene_box_t with two vertices.initFromBox
(Box src) Initializes the given #graphene_box_t with the vertices of
another #graphene_box_t.initFromVec3
(Vec3 min, Vec3 max) Initializes the given #graphene_box_t with two vertices
stored inside #graphene_vec3_t.boolean
intersection
(Box b, Box res) Intersects the two given #graphene_box_t.static Box
minusOne()
A #graphene_box_t with the minimum vertex set at (-1, -1, -1) and the
maximum vertex set at (0, 0, 0).static Box
one()
A #graphene_box_t with the minimum vertex set at (0, 0, 0) and the
maximum vertex set at (1, 1, 1).static Box
A #graphene_box_t with the minimum vertex set at (-1, -1, -1) and the
maximum vertex set at (1, 1, 1).void
Unions the two given #graphene_box_t.static Box
zero()
A #graphene_box_t with both the minimum and maximum vertices set at (0, 0, 0).Methods inherited from class ch.bailu.gtk.type.Pointer
asCPointer, cast, connectSignal, disconnectSignals, disconnectSignals, equals, hashCode, throwIfNull, throwNullPointerException, toString, unregisterCallbacks, unregisterCallbacks
Methods inherited from class ch.bailu.gtk.type.Type
asCPointer, asCPointer, asCPointerNotNull, asJnaPointer, asJnaPointer, asPointer, asPointer, cast, cast, throwIfNull
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
Methods inherited from interface ch.bailu.gtk.type.PointerInterface
asCPointerNotNull, asJnaPointer, asPointer, isNotNull, isNull
-
Field Details
-
MIN
Private field: direct-type- See Also:
-
MAX
Private field: direct-type- See Also:
-
-
Constructor Details
-
Box
-
Box
public Box()
-
-
Method Details
-
getClassHandler
-
allocBox
Allocates a new #graphene_box_t.
The contents of the returned structure are undefined.- Returns:
- the newly allocated #graphene_box_t structure. Use graphene_box_free() to free the resources allocated by this function
-
containsBox
Checks whether the #graphene_box_t @a contains the given
#graphene_box_t @b.- Parameters:
b
- a #graphene_box_t- Returns:
- `true` if the box is contained in the given box
-
containsPoint
Checks whether @box contains the given @point.- Parameters:
point
- the coordinates to check- Returns:
- `true` if the point is contained in the given box
-
equal
Checks whether the two given boxes are equal.- Parameters:
b
- a #graphene_box_t- Returns:
- `true` if the boxes are equal
-
expand
Expands the dimensions of @box to include the coordinates at @point.- Parameters:
point
- the coordinates of the point to includeres
- return location for the expanded box
-
expandScalar
Expands the dimensions of @box by the given @scalar value.
If @scalar is positive, the #graphene_box_t will grow; if @scalar is
negative, the #graphene_box_t will shrink.- Parameters:
scalar
- a scalar valueres
- return location for the expanded box
-
expandVec3
Expands the dimensions of @box to include the coordinates of the
given vector.- Parameters:
vec
- the coordinates of the point to include, as a #graphene_vec3_tres
- return location for the expanded box
-
free
public void free()Frees the resources allocated by graphene_box_alloc(). -
getBoundingSphere
Computes the bounding #graphene_sphere_t capable of containing the given
#graphene_box_t.- Parameters:
sphere
- return location for the bounding sphere
-
getCenter
Retrieves the coordinates of the center of a #graphene_box_t.- Parameters:
center
- return location for the coordinates of the center
-
getDepth
public float getDepth()Retrieves the size of the @box on the Z axis.- Returns:
- the depth of the box
-
getHeight
public float getHeight()Retrieves the size of the @box on the Y axis.- Returns:
- the height of the box
-
getMax
Retrieves the coordinates of the maximum point of the given
#graphene_box_t.- Parameters:
max
- return location for the maximum point
-
getMin
Retrieves the coordinates of the minimum point of the given
#graphene_box_t.- Parameters:
min
- return location for the minimum point
-
getSize
Retrieves the size of the box on all three axes, and stores
it into the given @size vector.- Parameters:
size
- return location for the size
-
getWidth
public float getWidth()Retrieves the size of the @box on the X axis.- Returns:
- the width of the box
-
init
Initializes the given #graphene_box_t with two vertices.- Parameters:
min
- the coordinates of the minimum vertexmax
- the coordinates of the maximum vertex- Returns:
- the initialized #graphene_box_t
-
initFromBox
Initializes the given #graphene_box_t with the vertices of
another #graphene_box_t.- Parameters:
src
- a #graphene_box_t- Returns:
- the initialized #graphene_box_t
-
initFromVec3
Initializes the given #graphene_box_t with two vertices
stored inside #graphene_vec3_t.- Parameters:
min
- the coordinates of the minimum vertexmax
- the coordinates of the maximum vertex- Returns:
- the initialized #graphene_box_t
-
intersection
Intersects the two given #graphene_box_t.
If the two boxes do not intersect, @res will contain a degenerate box
initialized with graphene_box_empty().- Parameters:
b
- a #graphene_box_tres
- return location for the result- Returns:
- true if the two boxes intersect
-
union
Unions the two given #graphene_box_t.- Parameters:
b
- the box to union to @ares
- return location for the result
-
empty
A degenerate #graphene_box_t that can only be expanded.
The returned value is owned by Graphene and should not be modified or freed.- Returns:
- a #graphene_box_t
-
infinite
A degenerate #graphene_box_t that cannot be expanded.
The returned value is owned by Graphene and should not be modified or freed.- Returns:
- a #graphene_box_t
-
minusOne
A #graphene_box_t with the minimum vertex set at (-1, -1, -1) and the
maximum vertex set at (0, 0, 0).
The returned value is owned by Graphene and should not be modified or freed.- Returns:
- a #graphene_box_t
-
one
A #graphene_box_t with the minimum vertex set at (0, 0, 0) and the
maximum vertex set at (1, 1, 1).
The returned value is owned by Graphene and should not be modified or freed.- Returns:
- a #graphene_box_t
-
oneMinusOne
A #graphene_box_t with the minimum vertex set at (-1, -1, -1) and the
maximum vertex set at (1, 1, 1).
The returned value is owned by Graphene and should not be modified or freed.- Returns:
- a #graphene_box_t
-
zero
A #graphene_box_t with both the minimum and maximum vertices set at (0, 0, 0).
The returned value is owned by Graphene and should not be modified or freed.- Returns:
- a #graphene_box_t
-
getTypeID
public static long getTypeID() -
getParentTypeID
public static long getParentTypeID() -
getTypeSize
-
getParentTypeSize
-
getInstanceSize
public static int getInstanceSize()
-