![]() |
ProtoTracer
1.0
Real-time 3D rendering and animation engine
|
Manages a collection of 3D objects and applies optional screen-space effects. More...
#include <Scene.h>
Public Member Functions | |
Scene (unsigned int maxObjects) | |
Constructs a Scene instance. | |
~Scene () | |
Destructor for Scene , freeing allocated resources. | |
bool | UseEffect () |
Checks if an effect is enabled for the scene. | |
void | EnableEffect () |
Enables the screen-space effect for the scene. | |
void | DisableEffect () |
Disables the screen-space effect for the scene. | |
Effect * | GetEffect () |
Retrieves the current screen-space effect. | |
void | SetEffect (Effect *effect) |
Sets the screen-space effect for the scene. | |
void | AddObject (Object3D *object) |
Adds a 3D object to the scene. | |
void | RemoveObject (unsigned int i) |
Removes a 3D object from the scene by its index. | |
void | RemoveObject (Object3D *object) |
Removes a specific 3D object from the scene. | |
Object3D ** | GetObjects () |
Retrieves all objects in the scene. | |
uint8_t | GetObjectCount () |
Retrieves the current number of objects in the scene. | |
Private Member Functions | |
void | RemoveElement (unsigned int element) |
Removes an object from the scene by its index. | |
Private Attributes | |
const int | maxObjects |
Maximum number of objects allowed in the scene. | |
Object3D ** | objects |
Array of pointers to the Object3D instances in the scene. | |
unsigned int | numObjects = 0 |
Current number of objects in the scene. | |
Effect * | effect |
Pointer to the screen-space Effect applied to the scene. | |
bool | doesUseEffect = false |
Flag indicating whether the effect is enabled. | |
Manages a collection of 3D objects and applies optional screen-space effects.
The Scene
class allows for the addition, removal, and management of 3D objects. It also supports applying screen-space effects to modify the appearance of the entire scene.
Constructs a Scene
instance.
maxObjects | Maximum number of objects the scene can hold. |
Definition at line 3 of file Scene.cpp.
References maxObjects, and objects.
~Scene | ( | ) |
Adds a 3D object to the scene.
object | Pointer to the Object3D to add. |
Definition at line 31 of file Scene.cpp.
References numObjects, and objects.
Referenced by AceAnimation::AceAnimation(), ArrowAnimation::ArrowAnimation(), BetaProject::BetaProject(), Boot::Boot(), CreeperAnimation::CreeperAnimation(), DrGonzoProject::DrGonzoProject(), DrGonzoTest::DrGonzoTest(), FursuitEyesV1::FursuitEyesV1(), ProtogenHUB75Project::ProtogenHUB75Project(), ProtogenProject::ProtogenProject(), ProtogenWS35Project::ProtogenWS35Project(), SageAnimation::SageAnimation(), SplatAnimation::SplatAnimation(), SpyroAnimation::SpyroAnimation(), UnicornZhenjaAnimation::UnicornZhenjaAnimation(), and VerifyEngine::VerifyEngine().
void DisableEffect | ( | ) |
Disables the screen-space effect for the scene.
Definition at line 19 of file Scene.cpp.
References doesUseEffect.
void EnableEffect | ( | ) |
Enables the screen-space effect for the scene.
Definition at line 15 of file Scene.cpp.
References doesUseEffect.
Referenced by ProtogenProject::ProtogenProject().
Effect * GetEffect | ( | ) |
Retrieves the current screen-space effect.
Effect
, or nullptr
if no effect is set. Definition at line 23 of file Scene.cpp.
References effect.
Referenced by RenderingEngine::Rasterize().
uint8_t GetObjectCount | ( | ) |
Retrieves the current number of objects in the scene.
Definition at line 62 of file Scene.cpp.
References numObjects.
Referenced by Rasterizer::Rasterize().
Object3D ** GetObjects | ( | ) |
Retrieves all objects in the scene.
Object3D
pointers. Definition at line 58 of file Scene.cpp.
References objects.
Referenced by Rasterizer::Rasterize().
Removes an object from the scene by its index.
This method adjusts the internal array to maintain order.
element | Index of the object to remove. |
Definition at line 36 of file Scene.cpp.
References numObjects, and objects.
Referenced by RemoveObject(), and RemoveObject().
Removes a specific 3D object from the scene.
object | Pointer to the Object3D to remove. |
Definition at line 49 of file Scene.cpp.
References numObjects, objects, and RemoveElement().
Removes a 3D object from the scene by its index.
i | Index of the object to remove. |
Definition at line 42 of file Scene.cpp.
References numObjects, and RemoveElement().
Sets the screen-space effect for the scene.
effect | Pointer to the Effect to apply. |
Definition at line 27 of file Scene.cpp.
References effect.
Referenced by ProtogenProject::UpdateFace().
bool UseEffect | ( | ) |
Checks if an effect is enabled for the scene.
true
if an effect is enabled, otherwise false
. Definition at line 11 of file Scene.cpp.
References doesUseEffect.
Referenced by RenderingEngine::Rasterize().
Flag indicating whether the effect is enabled.
Definition at line 32 of file Scene.h.
Referenced by DisableEffect(), EnableEffect(), and UseEffect().
|
private |
Pointer to the screen-space Effect
applied to the scene.
Definition at line 31 of file Scene.h.
Referenced by GetEffect(), and SetEffect().
Current number of objects in the scene.
Definition at line 30 of file Scene.h.
Referenced by AddObject(), GetObjectCount(), RemoveElement(), RemoveObject(), and RemoveObject().
|
private |
Array of pointers to the Object3D
instances in the scene.
Definition at line 29 of file Scene.h.
Referenced by AddObject(), GetObjects(), RemoveElement(), RemoveObject(), Scene(), and ~Scene().