1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
//! # Objects Module
//!
//! This module provides structures and functionality for managing objects in a 3D scene.
//! It includes a `Scene` struct to hold objects, a camera, and lights, as well as a `SceneObject`
//! struct to represent individual objects with transforms, VAOs, and shader programs.
//!
//! ## Usage
//!
//! ```rust
//! use glwfr::scene::objects::{Scene, SceneObject, Transform};
//! use glwfr::graphics::gl_wrapper::{Vao, ShaderProgram};
//! use glwfr::cgmath::{Vector3, Quaternion};
//!
//! fn main() {
//! // Create a transform for an object
//! let transform = Transform {
//! position: Vector3::new(0.0, 0.0, 0.0),
//! rotation: Quaternion::new(1.0, 0.0, 0.0, 0.0),
//! scale: Vector3::new(1.0, 1.0, 1.0),
//! };
//!
//! // Create a scene object
//! let scene_object = SceneObject {
//! transform,
//! vao: Vao::new(), // Assume Vao::new() creates a valid VAO
//! shader_program: ShaderProgram::new(), // Assume ShaderProgram::new() creates a valid shader program
//! vertex_count: 36, // Example vertex count for a cube
//! };
//!
//! // Create a scene with the object, a camera, and lights
//! let scene = Scene {
//! objects: vec![scene_object],
//! camera: Camera::default(), // Assume Camera::default() creates a valid camera
//! lights: vec![], // No lights in this example
//! };
//! }
//! ```
use crate*;
use *;
use ;
/// Represents a 3D scene containing objects, a camera, and lights.
///
/// The `Scene` struct is the central container for all elements in a 3D scene.
/// Represents an object in a 3D scene.
///
/// Each `SceneObject` has a transform, a VAO (Vertex Array Object), a shader program,
/// and a vertex count for rendering.
/// Represents the transform of an object in 3D space.
///
/// The `Transform` struct defines the position, rotation, and scale of an object.