package GL.Geometry is
package vertex_pointers is new interfaces.c.Pointers (positive_Vertex_Id, Vertex, Vertex_array, (others => gl.Double'Last));
type Geometry is abstract tagged record Bounds : Bounds_record; end record;
type Plane is array (0 .. 3) of aliased gl.Double;
type Extent is record Min, Max : gl.Double; end record;
type axis_aligned_bounding_Box is record X_Extent : Extent; -- extents in object space Y_Extent : Extent; Z_Extent : Extent; end record;
type Bounds_record is -- tbd: better name ... 'type Bounds' conflicts with 'Bounds' trait function. ... sphere_box_Bounds ? record sphere_Radius : gl.Double; Box : axis_aligned_bounding_Box; end record;
type vertex_Id is new gl.uInt;
type p_vertex_Id is access all vertex_Id;
type vertex_Id_array is array (gl.positive_uInt range <>) of aliased vertex_Id;
type p_vertex_Id_array is access all vertex_Id_array;
subtype Vertex is gl.Double_vector_3D;
type Vertex_array is array (positive_Vertex_Id range <>) of aliased Vertex;
type p_Vertex_array is access all Vertex_array;
subtype Normal is gl.Double_vector_3D;
type Normals is array (Positive range <>) of aliased Normal;
type Normal_array is array (positive_vertex_Id range <>) of aliased Normal;
type p_Geometry is access all Geometry'Class;
null_Bounds : constant Bounds_record := (sphere_radius => 0.0, box => (x_extent => (min => gl.Double'last, max => gl.Double'first), y_extent => (min => gl.Double'last, max => gl.Double'first), z_extent => (min => gl.Double'last, max => gl.Double'first)));
procedure normalise
| ( | the_Plane | : in out Plane); |
function to_gl_Pointer is new ada.unchecked_Conversion
| ( | p_vertex_Id, gl.Pointer); |
procedure increment
| ( | Self | : in out vertex_Id_array); |
procedure decrement
| ( | Self | : in out vertex_Id_array); |
function to_void_Pointer is new ada.unchecked_Conversion
| ( | p_vertex_Id, gl.Pointer); |
procedure free is new ada.unchecked_Deallocation
| ( | vertex_Id_array, p_vertex_Id_array); |
function to_p_Vertex is new ada.unchecked_Conversion
| ( | gl.Pointer, p_Vertex); |
procedure free is new ada.unchecked_Deallocation
| ( | Vertex_array, p_Vertex_array); |
function Bounds
| ( | Vertices | : in Vertex_array; |
| Indices | : in vertex_Id_array) |
procedure free
| ( | Self | : in out p_Geometry); |