Basics

Guides

API Reference

Menu

Basics

Guides

API Reference

class: GrapheneBoxLayout

[12:14] static extends: object

Generated struct layout helper for GIR record Box.

Methods

  • layout ()

    Returns the Panama struct layout for Box.

class: GrapheneBox

[28:7] extends: object

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

Members

  • handleObj
  • lib
  • retainedCallbacks
  • signalHandlerNames
  • signalSetterHandlers

Methods

  • GrapheneBox (Handle = null)

    Allocates a new #graphene_box_t. The contents of the returned structure are undefined.

    • @p Handle is an optional native handle or wrapper whose handle to adopt; when the native constructor is called.
  • toNativeHandle (Source)

    Normalizes a constructor argument into a raw pointer carrier. Accepts a raw NativeHandle, a raw NativeBuffer returned from fn.call(...), another generated wrapper exposing handle(), or null. Returns null when the argument carries no pointer.

    • @p Source is the raw handle, raw buffer, wrapper, or null.
    • @r A raw pointer carrier or null when no pointer is present.
  • getLib ()

    Returns the opened native library for this generated wrapper.

    • @r The opened native library.
  • handle ()

    Returns the wrapped NativeHandle.

    • @r The wrapped NativeHandle.
  • isNull ()

    Returns true when the wrapped handle is null.

    • @r A bool.
  • describe ()

    Returns a small string for debugging generated wrappers.

    • @r A string.
  • contains_box (object b)

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

    • @b. ``
    • @p b is a #graphene_box_t.
    • @r true if the box is contained in the given box.
  • contains_point (object point)

    Checks whether @box contains the given @point.

    • @p point is the coordinates to check.
    • @r true if the point is contained in the given box.
  • equal (object b)

    Checks whether the two given boxes are equal.

    • @p b is a #graphene_box_t.
    • @r true if the boxes are equal.
  • expand (object point)

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

    • @p point is the coordinates of the point to include.
    • @p res is return location for the expanded box.
    • @r None.
  • expand_scalar (double scalar)

    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.

    • @p scalar is a scalar value.
    • @p res is return location for the expanded box.
    • @r None.
  • expand_vec3 (object vec)

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

    • @p vec is the coordinates of the point to include, as a #graphene_vec3_t.
    • @p res is return location for the expanded box.
    • @r None.
  • free ()

    Frees the resources allocated by graphene_box_alloc().

    • @r None.
  • get_bounding_sphere ()

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

    • @p sphere is return location for the bounding sphere.
    • @r None.
  • get_center ()

    Retrieves the coordinates of the center of a #graphene_box_t.

    • @p center is return location for the coordinates of the center.
    • @r None.
  • get_depth ()

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

    • @r the depth of the box.
  • get_height ()

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

    • @r the height of the box.
  • get_max ()

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

    • @p max is return location for the maximum point.
    • @r None.
  • get_min ()

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

    • @p min is return location for the minimum point.
    • @r None.
  • get_minmax ()

    Retrieves the coordinates of the minimum and maximum points of the given #graphene_box_t

    • @p min is return location for the minimum point.
    • @p max is return location for the maximum point.
    • @r None.
  • get_size ()

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

    • @p size is return location for the size.
    • @r None.
  • get_vertices ()

    Computes the vertices of the given #graphene_box_t.

    • @p vertices is return location for an array of 8 #graphene_vec3_t.
    • @r None.
  • get_width ()

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

    • @r the width of the box.
  • init (object min, object max)

    Initializes the given #graphene_box_t with two vertices.

    • @p min is the coordinates of the minimum vertex.
    • @p max is the coordinates of the maximum vertex.
    • @r the initialized #graphene_box_t.
  • init_from_box (object src)

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

    • @p src is a #graphene_box_t.
    • @r the initialized #graphene_box_t.
  • init_from_points (list points)

    Initializes the given #graphene_box_t with the given array of vertices. If @n_points is 0, the returned box is initialized with graphene_box_empty().

    • @p n_points is the number #graphene_point3d_t in the @points array.
    • @p points is an array of #graphene_point3d_t.
    • @r the initialized #graphene_box_t.
  • init_from_vec3 (object min, object max)

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

    • @p min is the coordinates of the minimum vertex.
    • @p max is the coordinates of the maximum vertex.
    • @r the initialized #graphene_box_t.
  • init_from_vectors (list vectors)

    Initializes the given #graphene_box_t with the given array of vertices. If @n_vectors is 0, the returned box is initialized with graphene_box_empty().

    • @p n_vectors is the number #graphene_point3d_t in the @vectors array.
    • @p vectors is an array of #graphene_vec3_t.
    • @r the initialized #graphene_box_t.
  • intersection (object b)

    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().

    • @p b is a #graphene_box_t.
    • @p res is return location for the result.
    • @r true if the two boxes intersect.
  • union (object b)

    Unions the two given #graphene_box_t.

    • @p b is the box to union to @a.
    • @p res is return location for the result.
    • @r None.