Module: Graphene

Defined in:
lib/graphene1/rect.rb,
lib/graphene1.rb,
lib/graphene1/size.rb,
lib/graphene1/vec2.rb,
lib/graphene1/point.rb,
lib/graphene1/loader.rb,
lib/graphene1/version.rb

Overview

Copyright (C) 2025 Ruby-GNOME Project Team

This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option) any later version.

This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details.

You should have received a copy of the GNU Lesser General Public License along with this library; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA

Defined Under Namespace

Modules: EulerOrder, RayIntersectionKind, Version Classes: Error, Loader, Point, Rect, Size, Vec2

Constant Summary collapse

PI =
3.141593
PI_2 =
1.570796
VEC2_LEN =

Evaluates to the number of components of a #graphene_vec2_t.

This symbol is useful when declaring a C array of floating point values to be used with graphene_vec2_init_from_float() and graphene_vec2_to_float(), e.g.

|[ float v[GRAPHENE_VEC2_LEN];

// vec is defined elsewhere graphene_vec2_to_float (&vec, v);

for (int i = 0; i < GRAPHENE_VEC2_LEN; i++) fprintf (stdout, "component %d: %g\n", i, v[i]); ]|

2
VEC3_LEN =

Evaluates to the number of components of a #graphene_vec3_t.

This symbol is useful when declaring a C array of floating point values to be used with graphene_vec3_init_from_float() and graphene_vec3_to_float(), e.g.

|[ float v[GRAPHENE_VEC3_LEN];

// vec is defined elsewhere graphene_vec3_to_float (&vec, v);

for (int i = 0; i < GRAPHENE_VEC2_LEN; i++) fprintf (stdout, "component %d: %g\n", i, v[i]); ]|

3
VEC4_LEN =

Evaluates to the number of components of a #graphene_vec4_t.

This symbol is useful when declaring a C array of floating point values to be used with graphene_vec4_init_from_float() and graphene_vec4_to_float(), e.g.

|[ float v[GRAPHENE_VEC4_LEN];

// vec is defined elsewhere graphene_vec4_to_float (&vec, v);

for (int i = 0; i < GRAPHENE_VEC4_LEN; i++) fprintf (stdout, "component %d: %g\n", i, v[i]); ]|

4
LOG_DOMAIN =
"Graphene"

Instance Method Summary collapse

Instance Method Details

#box_emptyGraphene::Box

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:

  • (Graphene::Box)

    a #graphene_box_t

#box_infiniteGraphene::Box

A degenerate #graphene_box_t that cannot be expanded.

The returned value is owned by Graphene and should not be modified or freed.

Returns:

  • (Graphene::Box)

    a #graphene_box_t

#box_minus_oneGraphene::Box

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:

  • (Graphene::Box)

    a #graphene_box_t

#box_oneGraphene::Box

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:

  • (Graphene::Box)

    a #graphene_box_t

#box_one_minus_oneGraphene::Box

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:

  • (Graphene::Box)

    a #graphene_box_t

#box_zeroGraphene::Box

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:

  • (Graphene::Box)

    a #graphene_box_t

#point3d_zeroGraphene::Point3D

Retrieves a constant point with all three coordinates set to 0.

Returns:

  • (Graphene::Point3D)

    a zero point

#point_zeroGraphene::Point

Returns a point fixed at (0, 0).

Returns:

#rect_allocGraphene::Rect

Allocates a new #graphene_rect_t.

The contents of the returned rectangle are undefined.

Returns:

#rect_zeroGraphene::Rect

Returns a degenerate rectangle with origin fixed at (0, 0) and a size of 0, 0.

Returns:

#size_zeroGraphene::Size

A constant pointer to a zero #graphene_size_t, useful for equality checks and interpolations.

Returns:

#vec2_oneGraphene::Vec2

Retrieves a constant vector with (1, 1) components.

Returns:

#vec2_x_axisGraphene::Vec2

Retrieves a constant vector with (1, 0) components.

Returns:

#vec2_y_axisGraphene::Vec2

Retrieves a constant vector with (0, 1) components.

Returns:

#vec2_zeroGraphene::Vec2

Retrieves a constant vector with (0, 0) components.

Returns:

#vec3_oneGraphene::Vec3

Provides a constant pointer to a vector with three components, all sets to 1.

Returns:

  • (Graphene::Vec3)

    a constant vector

#vec3_x_axisGraphene::Vec3

Provides a constant pointer to a vector with three components with values set to (1, 0, 0).

Returns:

  • (Graphene::Vec3)

    a constant vector

#vec3_y_axisGraphene::Vec3

Provides a constant pointer to a vector with three components with values set to (0, 1, 0).

Returns:

  • (Graphene::Vec3)

    a constant vector

#vec3_z_axisGraphene::Vec3

Provides a constant pointer to a vector with three components with values set to (0, 0, 1).

Returns:

  • (Graphene::Vec3)

    a constant vector

#vec3_zeroGraphene::Vec3

Provides a constant pointer to a vector with three components, all sets to 0.

Returns:

  • (Graphene::Vec3)

    a constant vector

#vec4_oneGraphene::Vec4

Retrieves a pointer to a #graphene_vec4_t with all its components set to 1.

Returns:

  • (Graphene::Vec4)

    a constant vector

#vec4_w_axisGraphene::Vec4

Retrieves a pointer to a #graphene_vec4_t with its components set to (0, 0, 0, 1).

Returns:

  • (Graphene::Vec4)

    a constant vector

#vec4_x_axisGraphene::Vec4

Retrieves a pointer to a #graphene_vec4_t with its components set to (1, 0, 0, 0).

Returns:

  • (Graphene::Vec4)

    a constant vector

#vec4_y_axisGraphene::Vec4

Retrieves a pointer to a #graphene_vec4_t with its components set to (0, 1, 0, 0).

Returns:

  • (Graphene::Vec4)

    a constant vector

#vec4_z_axisGraphene::Vec4

Retrieves a pointer to a #graphene_vec4_t with its components set to (0, 0, 1, 0).

Returns:

  • (Graphene::Vec4)

    a constant vector

#vec4_zeroGraphene::Vec4

Retrieves a pointer to a #graphene_vec4_t with all its components set to 0.

Returns:

  • (Graphene::Vec4)

    a constant vector