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
-
#box_empty ⇒ Graphene::Box
A degenerate #graphene_box_t that can only be expanded.
-
#box_infinite ⇒ Graphene::Box
A degenerate #graphene_box_t that cannot be expanded.
-
#box_minus_one ⇒ Graphene::Box
A #graphene_box_t with the minimum vertex set at (-1, -1, -1) and the maximum vertex set at (0, 0, 0).
-
#box_one ⇒ Graphene::Box
A #graphene_box_t with the minimum vertex set at (0, 0, 0) and the maximum vertex set at (1, 1, 1).
-
#box_one_minus_one ⇒ Graphene::Box
A #graphene_box_t with the minimum vertex set at (-1, -1, -1) and the maximum vertex set at (1, 1, 1).
-
#box_zero ⇒ Graphene::Box
A #graphene_box_t with both the minimum and maximum vertices set at (0, 0, 0).
-
#point3d_zero ⇒ Graphene::Point3D
Retrieves a constant point with all three coordinates set to 0.
-
#point_zero ⇒ Graphene::Point
Returns a point fixed at (0, 0).
-
#rect_alloc ⇒ Graphene::Rect
Allocates a new #graphene_rect_t.
-
#rect_zero ⇒ Graphene::Rect
Returns a degenerate rectangle with origin fixed at (0, 0) and a size of 0, 0.
-
#size_zero ⇒ Graphene::Size
A constant pointer to a zero #graphene_size_t, useful for equality checks and interpolations.
-
#vec2_one ⇒ Graphene::Vec2
Retrieves a constant vector with (1, 1) components.
-
#vec2_x_axis ⇒ Graphene::Vec2
Retrieves a constant vector with (1, 0) components.
-
#vec2_y_axis ⇒ Graphene::Vec2
Retrieves a constant vector with (0, 1) components.
-
#vec2_zero ⇒ Graphene::Vec2
Retrieves a constant vector with (0, 0) components.
-
#vec3_one ⇒ Graphene::Vec3
Provides a constant pointer to a vector with three components, all sets to 1.
-
#vec3_x_axis ⇒ Graphene::Vec3
Provides a constant pointer to a vector with three components with values set to (1, 0, 0).
-
#vec3_y_axis ⇒ Graphene::Vec3
Provides a constant pointer to a vector with three components with values set to (0, 1, 0).
-
#vec3_z_axis ⇒ Graphene::Vec3
Provides a constant pointer to a vector with three components with values set to (0, 0, 1).
-
#vec3_zero ⇒ Graphene::Vec3
Provides a constant pointer to a vector with three components, all sets to 0.
-
#vec4_one ⇒ Graphene::Vec4
Retrieves a pointer to a #graphene_vec4_t with all its components set to 1.
-
#vec4_w_axis ⇒ Graphene::Vec4
Retrieves a pointer to a #graphene_vec4_t with its components set to (0, 0, 0, 1).
-
#vec4_x_axis ⇒ Graphene::Vec4
Retrieves a pointer to a #graphene_vec4_t with its components set to (1, 0, 0, 0).
-
#vec4_y_axis ⇒ Graphene::Vec4
Retrieves a pointer to a #graphene_vec4_t with its components set to (0, 1, 0, 0).
-
#vec4_z_axis ⇒ Graphene::Vec4
Retrieves a pointer to a #graphene_vec4_t with its components set to (0, 0, 1, 0).
-
#vec4_zero ⇒ Graphene::Vec4
Retrieves a pointer to a #graphene_vec4_t with all its components set to 0.
Instance Method Details
#box_empty ⇒ Graphene::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.
#box_infinite ⇒ Graphene::Box
A degenerate #graphene_box_t that cannot be expanded.
The returned value is owned by Graphene and should not be modified or freed.
#box_minus_one ⇒ Graphene::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.
#box_one ⇒ Graphene::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.
#box_one_minus_one ⇒ Graphene::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.
#box_zero ⇒ Graphene::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.
#point3d_zero ⇒ Graphene::Point3D
Retrieves a constant point with all three coordinates set to 0.
#point_zero ⇒ Graphene::Point
Returns a point fixed at (0, 0).
#rect_alloc ⇒ Graphene::Rect
Allocates a new #graphene_rect_t.
The contents of the returned rectangle are undefined.
#rect_zero ⇒ Graphene::Rect
Returns a degenerate rectangle with origin fixed at (0, 0) and a size of 0, 0.
#size_zero ⇒ Graphene::Size
A constant pointer to a zero #graphene_size_t, useful for equality checks and interpolations.
#vec2_one ⇒ Graphene::Vec2
Retrieves a constant vector with (1, 1) components.
#vec2_x_axis ⇒ Graphene::Vec2
Retrieves a constant vector with (1, 0) components.
#vec2_y_axis ⇒ Graphene::Vec2
Retrieves a constant vector with (0, 1) components.
#vec2_zero ⇒ Graphene::Vec2
Retrieves a constant vector with (0, 0) components.
#vec3_one ⇒ Graphene::Vec3
Provides a constant pointer to a vector with three components, all sets to 1.
#vec3_x_axis ⇒ Graphene::Vec3
Provides a constant pointer to a vector with three components with values set to (1, 0, 0).
#vec3_y_axis ⇒ Graphene::Vec3
Provides a constant pointer to a vector with three components with values set to (0, 1, 0).
#vec3_z_axis ⇒ Graphene::Vec3
Provides a constant pointer to a vector with three components with values set to (0, 0, 1).
#vec3_zero ⇒ Graphene::Vec3
Provides a constant pointer to a vector with three components, all sets to 0.
#vec4_one ⇒ Graphene::Vec4
Retrieves a pointer to a #graphene_vec4_t with all its components set to 1.
#vec4_w_axis ⇒ Graphene::Vec4
Retrieves a pointer to a #graphene_vec4_t with its components set to (0, 0, 0, 1).
#vec4_x_axis ⇒ Graphene::Vec4
Retrieves a pointer to a #graphene_vec4_t with its components set to (1, 0, 0, 0).
#vec4_y_axis ⇒ Graphene::Vec4
Retrieves a pointer to a #graphene_vec4_t with its components set to (0, 1, 0, 0).
#vec4_z_axis ⇒ Graphene::Vec4
Retrieves a pointer to a #graphene_vec4_t with its components set to (0, 0, 1, 0).
#vec4_zero ⇒ Graphene::Vec4
Retrieves a pointer to a #graphene_vec4_t with all its components set to 0.