Basics

Guides

API Reference

Menu

Basics

Guides

API Reference

class: GraphenePlane

[29:7] extends: object

A 2D plane that extends infinitely in a 3D volume. The contents of the graphene_plane_t are private, and should not be modified directly.

Members

  • handleObj
  • lib
  • retainedCallbacks
  • signalHandlerNames
  • signalSetterHandlers

Methods

  • GraphenePlane (Handle = null)

    Allocates a new #graphene_plane_t structure. 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.
  • distance (object point)

    Computes the distance of @point from a #graphene_plane_t.

    • @p point is a #graphene_point3d_t.
    • @r the distance of the given #graphene_point3d_t from the plane.
  • equal (object b)

    Checks whether the two given #graphene_plane_t are equal.

    • @p b is a #graphene_plane_t.
    • @r true if the given planes are equal.
  • free ()

    Frees the resources allocated by graphene_plane_alloc().

    • @r None.
  • get_constant ()

    Retrieves the distance along the normal vector of the given #graphene_plane_t from the origin.

    • @r the constant value of the plane.
  • get_normal ()

    Retrieves the normal vector pointing towards the origin of the given #graphene_plane_t.

    • @p normal is return location for the normal vector.
    • @r None.
  • init (object normal, double constant)

    Initializes the given #graphene_plane_t using the given @normal vector and @constant values.

    • @p normal is a unit length normal vector defining the plane pointing towards the origin; if unset, we use the X axis by default.
    • @p constant is the distance from the origin to the plane along the normal vector; the sign determines the half-space occupied by the plane.
    • @r the initialized plane.
  • init_from_plane (object src)

    Initializes the given #graphene_plane_t using the normal vector and constant of another #graphene_plane_t.

    • @p src is a #graphene_plane_t.
    • @r the initialized plane.
  • init_from_point (object normal, object point)

    Initializes the given #graphene_plane_t using the given normal vector and an arbitrary co-planar point.

    • @p normal is a normal vector defining the plane pointing towards the origin.
    • @p point is a #graphene_point3d_t.
    • @r the initialized plane.
  • init_from_points (object a, object b, object c)

    Initializes the given #graphene_plane_t using the 3 provided co-planar points. The winding order is counter-clockwise, and determines which direction the normal vector will point.

    • @p a is a #graphene_point3d_t.
    • @p b is a #graphene_point3d_t.
    • @p c is a #graphene_point3d_t.
    • @r the initialized plane.
  • init_from_vec4 (object src)

    Initializes the given #graphene_plane_t using the components of the given #graphene_vec4_t vector.

    • @p src is a #graphene_vec4_t containing the normal vector in its first three components, and the distance in its fourth component.
    • @r the initialized plane.
  • negate ()

    Negates the normal vector and constant of a #graphene_plane_t, effectively mirroring the plane across the origin.

    • @p res is return location for the negated plane.
    • @r None.
  • normalize ()

    Normalizes the vector of the given #graphene_plane_t, and adjusts the constant accordingly.

    • @p res is return location for the normalized plane.
    • @r None.
  • transform (object matrix, object normal_matrix)

    Transforms a #graphene_plane_t @p using the given @matrix and

    • @normal_matrix. If @normal_matrix is %NULL, a transformation matrix for the plane normal will be computed from @matrix. If you are transforming multiple planes using the same @matrix it's recommended to compute the normal matrix beforehand to avoid incurring in the cost of recomputing it every time.
    • @p matrix is a #graphene_matrix_t.
    • @p normal_matrix is a #graphene_matrix_t.
    • @p res is the transformed plane.
    • @r None.

class: GraphenePlaneLayout

[12:14] static extends: object

Generated struct layout helper for GIR record Plane.

Methods

  • layout ()

    Returns the Panama struct layout for Plane.