PGR Copakond OpenGL Engine - Bowling
Loading...
Searching...
No Matches
copakond::Scene Class Reference

Base class for all game scenes, managing lifecycle, rendering, and scene entities. More...

#include <scene.h>

Inheritance diagram for copakond::Scene:
copakond::BowlingScene copakond::SampleScene copakond::TemplateScene

Public Member Functions

 Scene (const char *sceneName, Input *engineInput, Shader *engineShader, int winWidth, int winHeight)
virtual ~Scene ()=default
const std::vector< Mesh * > & getMeshes () const
const std::vector< Light * > & getLights () const
const std::vector< Spline * > & getSplines () const
const std::vector< CollisionShape * > & getColliders () const
SkyboxgetSkybox () const
LightgetSun () const
CameragetCamera ()
ShadergetShader () const
InputgetInput () const
float updateTime ()
 Calculates delta time since the last frame.
float getSkyboxBlendingCoeff ()
const char * getSceneName ()
virtual void init ()
virtual void update (float deltaTime)
virtual void physics_update (float deltaTime)
 Fixed-step physics update loop for resolving collisions and forces.
virtual void onKeyboardEvent (unsigned char key, int x, int y, bool isDown)
virtual void onMouseButtonEvent (int button, int state, int x, int y)
virtual void onMouseWheelEvent (int wheel, int direction, int x, int y)
virtual void onMouseMoveEvent (int x, int y)
virtual void onScreenResizeEvent (int width, int height)
 Handles viewport and projection matrix updates on window resize.
virtual void onMenuEvent (int option)

Protected Member Functions

void addToScene (Mesh *mesh)
void addToScene (Light *light)
void addToScene (Spline *spline)

Protected Attributes

const char * WIN_TITLE
Inputinput
Shadershader
Cameracamera
std::vector< Mesh * > meshes = std::vector<Mesh*>()
std::vector< Light * > lights = std::vector<Light*>()
std::vector< Spline * > splines = std::vector<Spline*>()
std::vector< CollisionShape * > colliders = std::vector<CollisionShape*>()
Lightsun = nullptr
Skyboxskybox = nullptr
uint64_t time = 0
int winWidth = 0
int winHeight = 0
float skyboxBlendingCoeff = 0.0f

Detailed Description

Base class for all game scenes, managing lifecycle, rendering, and scene entities.

Constructor & Destructor Documentation

◆ Scene()

copakond::Scene::Scene ( const char * sceneName,
Input * engineInput,
Shader * engineShader,
int winWidth,
int winHeight )
inline

◆ ~Scene()

virtual copakond::Scene::~Scene ( )
virtualdefault

Member Function Documentation

◆ addToScene() [1/3]

void copakond::Scene::addToScene ( Light * light)
protected

◆ addToScene() [2/3]

void copakond::Scene::addToScene ( Mesh * mesh)
protected

◆ addToScene() [3/3]

void copakond::Scene::addToScene ( Spline * spline)
protected

◆ getCamera()

Camera & copakond::Scene::getCamera ( )
inline

◆ getColliders()

const std::vector< CollisionShape * > & copakond::Scene::getColliders ( ) const
inline

◆ getInput()

Input * copakond::Scene::getInput ( ) const
inline

◆ getLights()

const std::vector< Light * > & copakond::Scene::getLights ( ) const
inline

◆ getMeshes()

const std::vector< Mesh * > & copakond::Scene::getMeshes ( ) const
inline

◆ getSceneName()

const char * copakond::Scene::getSceneName ( )
inline

◆ getShader()

Shader * copakond::Scene::getShader ( ) const
inline

◆ getSkybox()

Skybox * copakond::Scene::getSkybox ( ) const
inline

◆ getSkyboxBlendingCoeff()

float copakond::Scene::getSkyboxBlendingCoeff ( )
inline

◆ getSplines()

const std::vector< Spline * > & copakond::Scene::getSplines ( ) const
inline

◆ getSun()

Light * copakond::Scene::getSun ( ) const
inline

◆ init()

virtual void copakond::Scene::init ( )
inlinevirtual

◆ onKeyboardEvent()

virtual void copakond::Scene::onKeyboardEvent ( unsigned char key,
int x,
int y,
bool isDown )
inlinevirtual

◆ onMenuEvent()

virtual void copakond::Scene::onMenuEvent ( int option)
inlinevirtual

◆ onMouseButtonEvent()

virtual void copakond::Scene::onMouseButtonEvent ( int button,
int state,
int x,
int y )
inlinevirtual

◆ onMouseMoveEvent()

virtual void copakond::Scene::onMouseMoveEvent ( int x,
int y )
inlinevirtual

◆ onMouseWheelEvent()

virtual void copakond::Scene::onMouseWheelEvent ( int wheel,
int direction,
int x,
int y )
inlinevirtual

◆ onScreenResizeEvent()

virtual void copakond::Scene::onScreenResizeEvent ( int width,
int height )
inlinevirtual

Handles viewport and projection matrix updates on window resize.

◆ physics_update()

virtual void copakond::Scene::physics_update ( float deltaTime)
inlinevirtual

Fixed-step physics update loop for resolving collisions and forces.

Reimplemented in copakond::BowlingScene, copakond::SampleScene, and copakond::TemplateScene.

◆ update()

virtual void copakond::Scene::update ( float deltaTime)
inlinevirtual

◆ updateTime()

float copakond::Scene::updateTime ( )

Calculates delta time since the last frame.

Member Data Documentation

◆ camera

Camera* copakond::Scene::camera
protected

◆ colliders

std::vector<CollisionShape*> copakond::Scene::colliders = std::vector<CollisionShape*>()
protected

◆ input

Input* copakond::Scene::input
protected

◆ lights

std::vector<Light*> copakond::Scene::lights = std::vector<Light*>()
protected

◆ meshes

std::vector<Mesh*> copakond::Scene::meshes = std::vector<Mesh*>()
protected

◆ shader

Shader* copakond::Scene::shader
protected

◆ skybox

Skybox* copakond::Scene::skybox = nullptr
protected

◆ skyboxBlendingCoeff

float copakond::Scene::skyboxBlendingCoeff = 0.0f
protected

◆ splines

std::vector<Spline*> copakond::Scene::splines = std::vector<Spline*>()
protected

◆ sun

Light* copakond::Scene::sun = nullptr
protected

◆ time

uint64_t copakond::Scene::time = 0
protected

◆ WIN_TITLE

const char* copakond::Scene::WIN_TITLE
protected

◆ winHeight

int copakond::Scene::winHeight = 0
protected

◆ winWidth

int copakond::Scene::winWidth = 0
protected

The documentation for this class was generated from the following files: