Physics Simulation & Visualization Tool 0.1
A C++ physics simulation engine with real-time 3D visualization
Loading...
Searching...
No Matches
SceneManager Class Reference

#include <SceneManager.h>

Inheritance diagram for SceneManager:
[legend]
Collaboration diagram for SceneManager:
[legend]

Public Member Functions

 SceneManager (OpenGLWindow *win, Scene *scene)
 
 ~SceneManager () override
 
SceneObjectcreatePrimitive (Primitive type, Shader *shader, const CreationOptions &=ObjectOptions{})
 
SceneObjectcreateObject (const std::string &meshName, Shader *shader=ResourceManager::getShader("basic"), const CreationOptions &=ObjectOptions{})
 
void deleteObject (SceneObject *obj)
 
void deleteAllObjects ()
 
const std::vector< std::unique_ptr< SceneObject > > & getObjects () const
 
SceneObjectgetObjectByID (uint32_t objectID) const
 
bool isNameUnique (const std::string &name, SceneObject *self) const
 
void setObjectName (SceneObject *obj, const std::string &newName)
 
std::string makeUniqueName (const std::string &baseName) const
 
void setCameraTarget (SceneObject *target)
 
void focusObject (SceneObject *target)
 
void clearCameraTarget ()
 
bool isCameraFollowing () const
 
const SceneObjectgetCameraTarget () const
 
void addToPhysicsSystem (Physics::PhysicsBody *body) const
 
void removeFromPhysicsSystem (Physics::PhysicsBody *body) const
 
glm::vec3 getGlobalAcceleration () const
 
void setGlobalAcceleration (const glm::vec3 &newAcceleration) const
 
bool isPhysicsRunning () const
 
float getSimSpeed () const
 
void setSimSpeed (float newSpeed)
 
void startSimulation () const
 
void stopSimulation () const
 
void stepPhysics (float dt) const
 
void addPickable (IPickable *obj)
 
void addDrawable (IDrawable *obj) const
 
void removePickable (IPickable *obj)
 
void removeDrawable (IDrawable *obj) const
 
void updateHoverState (const Math::Ray &mouseRay)
 
void selectObject (SceneObject *obj)
 
void setSelectFor (SceneObject *obj, bool flag=true)
 
void processHeldKeys (const QSet< int > &heldKeys, float dt)
 
void handleMouseButton (Qt::MouseButton button, QEvent::Type type, Qt::KeyboardModifiers mods)
 
void setGizmoFor (SceneObject *newTarget, bool redraw=false)
 
void deleteCurrentGizmo ()
 
void applyDebugSettings ()
 
bool saveScene (const QString &file)
 
bool loadScene (const QString &file)
 
bool loadPreset (const ScenePresets::PresetDescriptor &preset)
 
void resetScene ()
 
void defaultSetup ()
 
void objectAdded (SceneObject *obj)
 
void objectRemoved (SceneObject *obj)
 
void objectRenamed (SceneObject *obj, const QString &newName)
 
void selectedItem (SceneObject *object)
 
void contextMenuRequested (const QPoint &globalPos, SceneObject *object)
 

Data Fields

std::unordered_set< uint32_t > hoveredIDs
 
std::unordered_set< uint32_t > selectedIDs
 
Scenescene
 
std::unique_ptr< Physics::PhysicsSystemphysicsSystem
 
SimulationStopCondition stopCondition
 

Detailed Description

Definition at line 32 of file SceneManager.h.

Constructor & Destructor Documentation

◆ SceneManager()

SceneManager::SceneManager ( OpenGLWindow win,
Scene scene 
)

Definition at line 21 of file SceneManager.cpp.

◆ ~SceneManager()

SceneManager::~SceneManager ( )
override

Definition at line 27 of file SceneManager.cpp.

Member Function Documentation

◆ addDrawable()

void SceneManager::addDrawable ( IDrawable obj) const
inline

Definition at line 66 of file SceneManager.h.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ addPickable()

void SceneManager::addPickable ( IPickable obj)
inline

Definition at line 65 of file SceneManager.h.

Here is the caller graph for this function:

◆ addToPhysicsSystem()

void SceneManager::addToPhysicsSystem ( Physics::PhysicsBody body) const
inline

Definition at line 54 of file SceneManager.h.

Here is the caller graph for this function:

◆ applyDebugSettings()

void SceneManager::applyDebugSettings ( )

Definition at line 501 of file SceneManager.cpp.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ clearCameraTarget()

void SceneManager::clearCameraTarget ( )

Definition at line 260 of file SceneManager.cpp.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ contextMenuRequested()

void SceneManager::contextMenuRequested ( const QPoint &  globalPos,
SceneObject object 
)
Here is the caller graph for this function:

◆ createObject()

SceneObject * SceneManager::createObject ( const std::string &  meshName,
Shader shader = ResourceManager::getShader("basic"),
const CreationOptions options = ObjectOptions{} 
)

Definition at line 109 of file SceneManager.cpp.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ createPrimitive()

SceneObject * SceneManager::createPrimitive ( Primitive  type,
Shader shader = ResourceManager::getShader("basic"),
const CreationOptions options = ObjectOptions{} 
)

Definition at line 86 of file SceneManager.cpp.

Here is the call graph for this function:

◆ defaultSetup()

void SceneManager::defaultSetup ( )

Definition at line 31 of file SceneManager.cpp.

Here is the call graph for this function:

◆ deleteAllObjects()

void SceneManager::deleteAllObjects ( )

Definition at line 165 of file SceneManager.cpp.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ deleteCurrentGizmo()

void SceneManager::deleteCurrentGizmo ( )

Definition at line 443 of file SceneManager.cpp.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ deleteObject()

void SceneManager::deleteObject ( SceneObject obj)

Definition at line 125 of file SceneManager.cpp.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ focusObject()

void SceneManager::focusObject ( SceneObject target)

Definition at line 250 of file SceneManager.cpp.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ getCameraTarget()

const SceneObject * SceneManager::getCameraTarget ( ) const
inline

Definition at line 52 of file SceneManager.h.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ getGlobalAcceleration()

glm::vec3 SceneManager::getGlobalAcceleration ( ) const
inline

Definition at line 56 of file SceneManager.h.

Here is the caller graph for this function:

◆ getObjectByID()

SceneObject * SceneManager::getObjectByID ( uint32_t  objectID) const

Definition at line 178 of file SceneManager.cpp.

Here is the caller graph for this function:

◆ getObjects()

const std::vector< std::unique_ptr< SceneObject > > & SceneManager::getObjects ( ) const

Definition at line 174 of file SceneManager.cpp.

Here is the caller graph for this function:

◆ getSimSpeed()

float SceneManager::getSimSpeed ( ) const
inline

Definition at line 59 of file SceneManager.h.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ handleMouseButton()

void SceneManager::handleMouseButton ( Qt::MouseButton  button,
QEvent::Type  type,
Qt::KeyboardModifiers  mods 
)

Definition at line 297 of file SceneManager.cpp.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ isCameraFollowing()

bool SceneManager::isCameraFollowing ( ) const
inline

Definition at line 51 of file SceneManager.h.

Here is the call graph for this function:

◆ isNameUnique()

bool SceneManager::isNameUnique ( const std::string &  name,
SceneObject self 
) const

Definition at line 197 of file SceneManager.cpp.

Here is the caller graph for this function:

◆ isPhysicsRunning()

bool SceneManager::isPhysicsRunning ( ) const
inline

Definition at line 58 of file SceneManager.h.

◆ loadPreset()

bool SceneManager::loadPreset ( const ScenePresets::PresetDescriptor preset)

Definition at line 77 of file SceneManager.cpp.

Here is the call graph for this function:

◆ loadScene()

bool SceneManager::loadScene ( const QString &  file)

Definition at line 460 of file SceneManager.cpp.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ makeUniqueName()

std::string SceneManager::makeUniqueName ( const std::string &  baseName) const

Definition at line 228 of file SceneManager.cpp.

Here is the caller graph for this function:

◆ objectAdded()

void SceneManager::objectAdded ( SceneObject obj)
Here is the caller graph for this function:

◆ objectRemoved()

void SceneManager::objectRemoved ( SceneObject obj)
Here is the caller graph for this function:

◆ objectRenamed()

void SceneManager::objectRenamed ( SceneObject obj,
const QString &  newName 
)
Here is the caller graph for this function:

◆ processHeldKeys()

void SceneManager::processHeldKeys ( const QSet< int > &  heldKeys,
float  dt 
)

Definition at line 353 of file SceneManager.cpp.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ removeDrawable()

void SceneManager::removeDrawable ( IDrawable obj) const
inline

Definition at line 68 of file SceneManager.h.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ removeFromPhysicsSystem()

void SceneManager::removeFromPhysicsSystem ( Physics::PhysicsBody body) const
inline

Definition at line 55 of file SceneManager.h.

Here is the caller graph for this function:

◆ removePickable()

void SceneManager::removePickable ( IPickable obj)

Definition at line 449 of file SceneManager.cpp.

Here is the caller graph for this function:

◆ resetScene()

void SceneManager::resetScene ( )

Definition at line 52 of file SceneManager.cpp.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ saveScene()

bool SceneManager::saveScene ( const QString &  file)

Definition at line 455 of file SceneManager.cpp.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ selectedItem()

void SceneManager::selectedItem ( SceneObject object)
Here is the caller graph for this function:

◆ selectObject()

void SceneManager::selectObject ( SceneObject obj)

Definition at line 288 of file SceneManager.cpp.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ setCameraTarget()

void SceneManager::setCameraTarget ( SceneObject target)

Definition at line 241 of file SceneManager.cpp.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ setGizmoFor()

void SceneManager::setGizmoFor ( SceneObject newTarget,
bool  redraw = false 
)

Definition at line 413 of file SceneManager.cpp.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ setGlobalAcceleration()

void SceneManager::setGlobalAcceleration ( const glm::vec3 &  newAcceleration) const
inline

Definition at line 57 of file SceneManager.h.

Here is the caller graph for this function:

◆ setObjectName()

void SceneManager::setObjectName ( SceneObject obj,
const std::string &  newName 
)

Definition at line 206 of file SceneManager.cpp.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ setSelectFor()

void SceneManager::setSelectFor ( SceneObject obj,
bool  flag = true 
)

Definition at line 426 of file SceneManager.cpp.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ setSimSpeed()

void SceneManager::setSimSpeed ( float  newSpeed)
inline

Definition at line 60 of file SceneManager.h.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ startSimulation()

void SceneManager::startSimulation ( ) const
inline

Definition at line 61 of file SceneManager.h.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ stepPhysics()

void SceneManager::stepPhysics ( float  dt) const
inline

Definition at line 63 of file SceneManager.h.

◆ stopSimulation()

void SceneManager::stopSimulation ( ) const
inline

Definition at line 62 of file SceneManager.h.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ updateHoverState()

void SceneManager::updateHoverState ( const Math::Ray mouseRay)

Definition at line 279 of file SceneManager.cpp.

Here is the call graph for this function:
Here is the caller graph for this function:

Field Documentation

◆ hoveredIDs

std::unordered_set<uint32_t> SceneManager::hoveredIDs

Definition at line 86 of file SceneManager.h.

◆ physicsSystem

std::unique_ptr<Physics::PhysicsSystem> SceneManager::physicsSystem

Definition at line 89 of file SceneManager.h.

◆ scene

Scene* SceneManager::scene

Definition at line 88 of file SceneManager.h.

◆ selectedIDs

std::unordered_set<uint32_t> SceneManager::selectedIDs

Definition at line 86 of file SceneManager.h.

◆ stopCondition

SimulationStopCondition SceneManager::stopCondition

Definition at line 90 of file SceneManager.h.


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