Box
Object Hierarchy:
Description:
[ CCode ( cname = "graphene_box_t" , copy_function = "g_boxed_copy" , free_function = "g_boxed_free" , type_id = "graphene_box_get_type ()" ) ]
[ Version ( since = "1.2" ) ]
public struct Box
A 3D box, described as the volume between a minimum and a maximum vertices.
Content:
Static methods:
- public static unowned Box? empty ()
A degenerate Box that can only be
expanded.
- public static unowned Box? infinite ()
A degenerate Box that cannot be expanded.
- public static unowned Box? minus_one ()
A Box with the minimum vertex set at (-1,
-1, -1) and the maximum vertex set at (0, 0, 0).
- public static unowned Box? one ()
A Box with the minimum vertex set at (0,
0, 0) and the maximum vertex set at (1, 1, 1).
- public static unowned Box? one_minus_one ()
A Box with the minimum vertex set at (-1,
-1, -1) and the maximum vertex set at (1, 1, 1).
- public static unowned Box? zero ()
A Box with both the minimum and maximum
vertices set at (0, 0, 0).
Methods:
- public bool contains_box (Box b)
Checks whether the Box
this contains the given Box b
.
- public bool contains_point (Point3D point)
Checks whether this contains the
given point
.
- public bool equal (Box b)
Checks whether the two given boxes are equal.
- public Box expand (Point3D point)
Expands the dimensions of this to
include the coordinates at point
.
- public Box expand_scalar (float scalar)
Expands the dimensions of this by
the given scalar
value.
- public Box expand_vec3 (Vec3 vec)
Expands the dimensions of this to
include the coordinates of the given vector.
- public Sphere get_bounding_sphere ()
Computes the bounding
Sphere capable of containing the given Box.
- public Point3D get_center ()
Retrieves the coordinates of the center of a Box
.
- public float get_depth ()
Retrieves the size of the this on
the Z axis.
- public float get_height ()
Retrieves the size of the this on
the Y axis.
- public Point3D get_max ()
Retrieves the coordinates of the maximum point of the given
Box.
- public Point3D get_min ()
Retrieves the coordinates of the minimum point of the given
Box.
- public Vec3 get_size ()
Retrieves the size of the box on all three axes, and stores it into
the given size
vector.
- public void get_vertices (ref Vec3[] vertices)
Computes the vertices of the given Box.
- public float get_width ()
Retrieves the size of the this on
the X axis.
- public unowned Box? init (Point3D? min, Point3D? max)
Initializes the given Box with two
vertices.
- public unowned Box? init_from_box (Box src)
Initializes the given Box with the
vertices of another Box.
- public unowned Box? init_from_points (Point3D[] points)
Initializes the given Box with the given
array of vertices.
- public unowned Box? init_from_vec3 (Vec3? min, Vec3? max)
Initializes the given Box with two
vertices stored inside Vec3.
- public unowned Box? init_from_vectors (Vec3[] vectors)
Initializes the given Box with the given
array of vertices.
- public bool intersection (Box b, out Box res)
Intersects the two given Box.
- public Box union (Box b)
Unions the two given Box.