Vp::MainScene
#include "Viewport/scene/scenes/MainScene.h"
Inherits from Vp::Scene
Public Functions
| Name | |
|---|---|
| MainScene(Viewport * viewport) | |
| virtual void | draw(int width, int height, const glm::mat4 & model, const glm::mat4 & view, const glm::mat4 & projection, SceneRenderTarget & renderTarget, const DisplayOptions & displayOptions)<br>Draw the scene using the provided view and projection matrices. |
| virtual void | draw(int width, int height, const glm::mat4 & model, const glm::mat4 & view, const glm::mat4 & projection, SceneRenderTarget & renderTarget, const DisplayOptions & displayOptions) override<br>Draw the scene using the provided view and projection matrices. |
| virtual void | draw(int width, int height, const glm::mat4 & model, SceneRenderTarget & renderTarget, const DisplayOptions & displayOptions)<br>Draw the scene using the scene's camera. |
| virtual void | draw(int width, int height, const std::shared_ptr< AbstractCamera > & camera, const glm::mat4 & model, SceneRenderTarget & renderTarget, const DisplayOptions & displayOptions)<br>Draw the scene using a provided camera. |
| virtual void | init() override<br>Initialises the scene. |
| virtual void | update(double dt) override<br>Update entity logic. |
Public Attributes
| Name | |
|---|---|
| bool | m_lightFollowsCamera |
| std::shared_ptr< GridObject > | m_localGrid <br>Grid representing current local/reference space. |
| std::shared_ptr< GridObject > | m_worldGrid <br>Grid representing the world space standard basis. |
Protected Attributes
| Name | |
|---|---|
| SunLight * | m_sun1 |
| glm::vec3 | m_sun1_dir |
| SunLight * | m_sun2 |
| glm::vec3 | m_sun2_dir |
| float | m_sun2_intensity |
Additional inherited members
Public Functions inherited from Vp::Scene
| Name | |
|---|---|
| Scene(Viewport * viewport) | |
| virtual | ~Scene() =default |
| template <typename T ,typename std::enable_if< std::is_base_of< Entity, T >::value, bool >::type =true> <br>std::weak_ptr< T > | addEntity(std::shared_ptr< T > entity)<br>Adds entity to the scene. |
| void | addSelectionCallback(std::function< void(Entity *)> callback) |
| virtual Ptr< SceneRenderTarget > | createRenderTarget(const RenderOptions & options)<br>Create and populates a SceneRenderTarget object with expected framebuffer objects for the scenes render pass. |
| const std::vector< std::shared_ptr< Entity > > & | getEntities() const |
| void | processInput(double dt, glm::vec2 mousePos, glm::ivec2 windowSize)<br>Update input logic. |
| void | processSelection(SceneRenderTarget & renderTarget, glm::vec2 mousePos, glm::ivec2 windowSize)<br>Update selection logic. |
| template <typename T ,typename std::enable_if< std::is_base_of< Entity, T >::value, bool >::type =true> <br>void | removeEntity(std::weak_ptr< T > entity)<br>Remove entity from the scene. |
| void | triggerSelectionCallbacks(Entity * entity) |
Protected Functions inherited from Vp::Scene
| Name | |
|---|---|
| void | drawHighlight(int width, int height, const glm::mat4 & model, const glm::mat4 & view, const glm::mat4 & projection, SceneRenderTarget & renderTarget, const DisplayOptions & displayOptions, ViewportSettings & stg, const Ptr< Framebuffer > & mainFBO, const Ptr< Framebuffer > & selectionFBO, const Ptr< Framebuffer > & selectionBlurFBO, const Ptr< Framebuffer > & selectionBlurSecondPassFBO) |
| void | drawStandard(int width, int height, const glm::mat4 & model, const glm::mat4 & view, const glm::mat4 & projection, SceneRenderTarget & renderTarget, const DisplayOptions & displayOptions, RenderOptions renderOptions, bool alpha, glm::vec3 clearColor, const Ptr< Framebuffer > & mainFBO) |
| void | drawWboit(int width, int height, const glm::mat4 & model, const glm::mat4 & view, const glm::mat4 & projection, SceneRenderTarget & renderTarget, const DisplayOptions & displayOptions, RenderOptions renderOptions, bool alpha, glm::vec3 clearColor, const Ptr< Framebuffer > & mainFBO, const Ptr< Framebuffer > & transparentFBO) |
| void | renderSortedTransparentEntities(const std::vector< Entity * > & entities, const glm::mat4 & model, const glm::mat4 & view, const glm::mat4 & projection, const DisplayOptions & displayOptions) const |
| void | sortExplicitlyOrderedTransparentEntities(std::vector< Entity * > & entities) |
| void | sortUnorderedTransparentEntities(std::vector< Entity * > & entities, const glm::mat4 & model, const glm::mat4 & view) |
Public Attributes inherited from Vp::Scene
| Name | |
|---|---|
| std::shared_ptr< AbstractCamera > | m_camera |
| std::shared_ptr< Lighting > | m_lighting |
| std::shared_ptr< SelectStencil > | m_selectStencil |
| Viewport * | m_viewport |
Protected Attributes inherited from Vp::Scene
| Name | |
|---|---|
| std::vector< std::shared_ptr< Entity > > | m_entities |
| std::vector< Entity * > | m_explicitTransparencyOrderEntitiesFirst |
| std::vector< Entity * > | m_explicitTransparencyOrderEntitiesLast |
| std::vector< Entity * > | m_highlightedEntities |
| Entity * | m_selectedEntity |
| std::vector< std::function< void(Entity *)> > | m_selectionCallbacks <br>Callbacks that get triggered on entity selection. |
| std::vector< Entity * > | m_unorderedTransparentEntities |
Friends inherited from Vp::Scene
| Name | |
|---|---|
| class | Viewport |
Public Functions Documentation
function MainScene
explicit MainScene(
Viewport * viewport
)explicit MainScene(
Viewport * viewport
)function draw
virtual void draw(
int width,
int height,
const glm::mat4 & model,
const glm::mat4 & view,
const glm::mat4 & projection,
SceneRenderTarget & renderTarget,
const DisplayOptions & displayOptions
)virtual void draw(
int width,
int height,
const glm::mat4 & model,
const glm::mat4 & view,
const glm::mat4 & projection,
SceneRenderTarget & renderTarget,
const DisplayOptions & displayOptions
)Draw the scene using the provided view and projection matrices.
Parameters:
- width Desired framebuffer pixel width
- height Desired framebuffer pixel height
- model Implicit model matrix, multiplies all model transforms from the left.
Reimplements: Vp::Scene::draw
function draw
virtual void draw(
int width,
int height,
const glm::mat4 & model,
const glm::mat4 & view,
const glm::mat4 & projection,
SceneRenderTarget & renderTarget,
const DisplayOptions & displayOptions
) overridevirtual void draw(
int width,
int height,
const glm::mat4 & model,
const glm::mat4 & view,
const glm::mat4 & projection,
SceneRenderTarget & renderTarget,
const DisplayOptions & displayOptions
) overrideDraw the scene using the provided view and projection matrices.
Parameters:
- width Desired framebuffer pixel width
- height Desired framebuffer pixel height
- model Implicit model matrix, multiplies all model transforms from the left.
Reimplements: Vp::Scene::draw
function draw
virtual void draw(
int width,
int height,
const glm::mat4 & model,
SceneRenderTarget & renderTarget,
const DisplayOptions & displayOptions
)virtual void draw(
int width,
int height,
const glm::mat4 & model,
SceneRenderTarget & renderTarget,
const DisplayOptions & displayOptions
)Draw the scene using the scene's camera.
Parameters:
- width Desired framebuffer pixel width
- height Desired framebuffer pixel height
- model Implicit model matrix, multiplies all model transforms from the left.
Reimplements: Vp::Scene::draw
function draw
virtual void draw(
int width,
int height,
const std::shared_ptr< AbstractCamera > & camera,
const glm::mat4 & model,
SceneRenderTarget & renderTarget,
const DisplayOptions & displayOptions
)virtual void draw(
int width,
int height,
const std::shared_ptr< AbstractCamera > & camera,
const glm::mat4 & model,
SceneRenderTarget & renderTarget,
const DisplayOptions & displayOptions
)Draw the scene using a provided camera.
Parameters:
- width Desired framebuffer pixel width
- height Desired framebuffer pixel height
- camera The camera to render the scene with
- model Implicit model matrix, multiplies all model transforms from the left.
Reimplements: Vp::Scene::draw
function init
virtual void init() overridevirtual void init() overrideInitialises the scene.
Reimplements: Vp::Scene::init
Should be called before any draw operations.
function update
virtual void update(
double dt
) overridevirtual void update(
double dt
) overrideUpdate entity logic.
Reimplements: Vp::Scene::update
Public Attributes Documentation
variable m_lightFollowsCamera
bool m_lightFollowsCamera = true;bool m_lightFollowsCamera = true;variable m_localGrid
std::shared_ptr< GridObject > m_localGrid;std::shared_ptr< GridObject > m_localGrid;Grid representing current local/reference space.
variable m_worldGrid
std::shared_ptr< GridObject > m_worldGrid;std::shared_ptr< GridObject > m_worldGrid;Grid representing the world space standard basis.
Protected Attributes Documentation
variable m_sun1
SunLight * m_sun1;SunLight * m_sun1;variable m_sun1_dir
glm::vec3 m_sun1_dir;glm::vec3 m_sun1_dir;variable m_sun2
SunLight * m_sun2;SunLight * m_sun2;variable m_sun2_dir
glm::vec3 m_sun2_dir;glm::vec3 m_sun2_dir;variable m_sun2_intensity
float m_sun2_intensity;float m_sun2_intensity;Updated on 2026-05-21 at 15:39:36 +0000