Basics

Guides

API Reference

Menu

Basics

Guides

API Reference

class: GrapheneVec3Layout

[12:14] static extends: object

Generated struct layout helper for GIR record Vec3.

Methods

  • layout ()

    Returns the Panama struct layout for Vec3.

class: GrapheneVec3

[29:7] extends: object

A structure capable of holding a vector with three dimensions: x, y, and z. The contents of the #graphene_vec3_t structure are private and should never be accessed directly.

Members

  • handleObj
  • lib
  • retainedCallbacks
  • signalHandlerNames
  • signalSetterHandlers

Methods

  • GrapheneVec3 (Handle = null)

    Allocates a new #graphene_vec3_t structure. The contents of the returned structure are undefined. Use graphene_vec3_init() to initialize the vector.

    • @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.
  • add (object b)

    Adds each component of the two given vectors.

    • @p b is a #graphene_vec3_t.
    • @p res is return location for the resulting vector.
    • @r None.
  • cross (object b)

    Computes the cross product of the two given vectors.

    • @p b is a #graphene_vec3_t.
    • @p res is return location for the resulting vector.
    • @r None.
  • divide (object b)

    Divides each component of the first operand @a by the corresponding component of the second operand @b, and places the results into the vector @res.

    • @p b is a #graphene_vec3_t.
    • @p res is return location for the resulting vector.
    • @r None.
  • dot (object b)

    Computes the dot product of the two given vectors.

    • @p b is a #graphene_vec3_t.
    • @r the value of the dot product.
  • equal (object v2)

    Checks whether the two given #graphene_vec3_t are equal.

    • @p v2 is a #graphene_vec3_t.
    • @r true if the two vectors are equal, and false otherwise.
  • free ()

    Frees the resources allocated by @v

    • @r None.
  • get_x ()

    Retrieves the first component of the given vector @v.

    • @r the value of the first component of the vector.
  • get_xy ()

    Creates a #graphene_vec2_t that contains the first and second components of the given #graphene_vec3_t.

    • @p res is return location for a #graphene_vec2_t.
    • @r None.
  • get_xy0 ()

    Creates a #graphene_vec3_t that contains the first two components of the given #graphene_vec3_t, and the third component set to 0.

    • @p res is return location for a #graphene_vec3_t.
    • @r None.
  • get_xyz0 ()

    Converts a #graphene_vec3_t in a #graphene_vec4_t using 0.0 as the value for the fourth component of the resulting vector.

    • @p res is return location for the vector.
    • @r None.
  • get_xyz1 ()

    Converts a #graphene_vec3_t in a #graphene_vec4_t using 1.0 as the value for the fourth component of the resulting vector.

    • @p res is return location for the vector.
    • @r None.
  • get_xyzw (double w)

    Converts a #graphene_vec3_t in a #graphene_vec4_t using @w as the value of the fourth component of the resulting vector.

    • @p w is the value of the W component.
    • @p res is return location for the vector.
    • @r None.
  • get_y ()

    Retrieves the second component of the given vector @v.

    • @r the value of the second component of the vector.
  • get_z ()

    Retrieves the third component of the given vector @v.

    • @r the value of the third component of the vector.
  • init (double x, double y, double z)

    Initializes a #graphene_vec3_t using the given values. This function can be called multiple times.

    • @p x is the X field of the vector.
    • @p y is the Y field of the vector.
    • @p z is the Z field of the vector.
    • @r a pointer to the initialized vector.
  • init_from_float (list src)

    Initializes a #graphene_vec3_t with the values from an array.

    • @p src is an array of 3 floating point values.
    • @r the initialized vector.
  • init_from_vec3 (object src)

    Initializes a #graphene_vec3_t with the values of another #graphene_vec3_t.

    • @p src is a #graphene_vec3_t.
    • @r the initialized vector.
  • interpolate (object v2, double factor)

    Linearly interpolates @v1 and @v2 using the given @factor.

    • @p v2 is a #graphene_vec3_t.
    • @p factor is the interpolation factor.
    • @p res is the interpolated vector.
    • @r None.
  • length ()

    Retrieves the length of the given vector @v.

    • @r the value of the length of the vector.
  • max (object b)

    Compares each component of the two given vectors and creates a vector that contains the maximum values.

    • @p b is a #graphene_vec3_t.
    • @p res is return location for the result vector.
    • @r None.
  • min (object b)

    Compares each component of the two given vectors and creates a vector that contains the minimum values.

    • @p b is a #graphene_vec3_t.
    • @p res is return location for the result vector.
    • @r None.
  • multiply (object b)

    Multiplies each component of the two given vectors.

    • @p b is a #graphene_vec3_t.
    • @p res is return location for the resulting vector.
    • @r None.
  • near (object v2, double epsilon)

    Compares the two given #graphene_vec3_t vectors and checks whether their values are within the given @epsilon.

    • @p v2 is a #graphene_vec3_t.
    • @p epsilon is the threshold between the two vectors.
    • @r true if the two vectors are near each other.
  • negate ()

    Negates the given #graphene_vec3_t.

    • @p res is return location for the result vector.
    • @r None.
  • normalize ()

    Normalizes the given #graphene_vec3_t.

    • @p res is return location for the normalized vector.
    • @r None.
  • scale (double factor)

    Multiplies all components of the given vector with the given scalar

    • @factor. ``
    • @p factor is the scalar factor.
    • @p res is return location for the result vector.
    • @r None.
  • subtract (object b)

    Subtracts from each component of the first operand @a the corresponding component of the second operand @b and places each result into the components of @res.

    • @p b is a #graphene_vec3_t.
    • @p res is return location for the resulting vector.
    • @r None.
  • to_float ()

    Copies the components of a #graphene_vec3_t into the given array.

    • @p dest is return location for an array of floating point values.
    • @r None.