![]() |
Divide Framework 0.1
A free and open-source 3D Framework under heavy development
|
#include <ProjectManager.h>
Public Member Functions | |
ProjectManager (Kernel &parentKernel) | |
~ProjectManager () override | |
void | idle () |
void | destroy () |
ErrorCode | loadProject (const ProjectID &targetProject, bool deferToStartOfFrame) |
size_t | addSelectionCallback (const DELEGATE< void, U8, const vector< SceneGraphNode * > & > &selectionCallback) |
bool | removeSelectionCallback (const size_t idx) |
bool | resetSelection (PlayerIndex idx, const bool resetIfLocked) |
void | setSelected (PlayerIndex idx, const vector< SceneGraphNode * > &SGNs, bool recursive) |
void | onNodeDestroy (Scene *parentScene, SceneGraphNode *node) |
void | cullSceneGraph (const NodeCullParams &cullParams, const U16 cullFlags, VisibleNodeList<> &nodesOut) |
cull the SceneGraph against the current view frustum. | |
void | findNode (const vec3< F32 > &cameraEye, const I64 nodeGUID, VisibleNodeList<> &nodesOut) |
Searches the scenegraph for the specified nodeGUID and, if found, adds it to nodesOut. | |
void | initDefaultCullValues (RenderStage stage, NodeCullParams &cullParamsInOut) noexcept |
init default culling values like max cull distance and other scene related states | |
void | getSortedReflectiveNodes (const Camera *camera, RenderStage stage, bool inView, VisibleNodeList<> &nodesOut) const |
get the full list of reflective nodes | |
void | getSortedRefractiveNodes (const Camera *camera, RenderStage stage, bool inView, VisibleNodeList<> &nodesOut) const |
get the full list of refractive nodes | |
const VisibleNodeList & | getRenderedNodeList () const noexcept |
void | onChangeFocus (bool hasFocus) |
bool | loadComplete () const noexcept |
Check if the scene was loaded properly. | |
void | updateSceneState (U64 deltaGameTimeUS, U64 deltaAppTimeUS) |
Update animations, network data, sounds, triggers etc. | |
void | onResolutionChange (const SizeChangeParams ¶ms) |
U8 | playerPass () const noexcept |
bool | saveActiveScene (bool toCache, bool deferred, const DELEGATE< void, std::string_view > &msgCallback={}, const DELEGATE< void, bool > &finishCallback={}) |
AI::Navigation::DivideRecast * | recast () const noexcept |
SceneEnvironmentProbePool * | getEnvProbes () const noexcept |
U8 | activePlayerCount () const noexcept |
bool | onKeyDown (const Input::KeyEvent &key) override |
Key pressed: return true if input was consumed. | |
bool | onKeyUp (const Input::KeyEvent &key) override |
Key released: return true if input was consumed. | |
bool | joystickAxisMoved (const Input::JoystickEvent &arg) override |
Joystick axis change: return true if input was consumed. | |
bool | joystickPovMoved (const Input::JoystickEvent &arg) override |
Joystick direction change: return true if input was consumed. | |
bool | joystickButtonPressed (const Input::JoystickEvent &arg) override |
Joystick button pressed: return true if input was consumed. | |
bool | joystickButtonReleased (const Input::JoystickEvent &arg) override |
Joystick button released: return true if input was consumed. | |
bool | joystickBallMoved (const Input::JoystickEvent &arg) override |
bool | joystickAddRemove (const Input::JoystickEvent &arg) override |
bool | joystickRemap (const Input::JoystickEvent &arg) override |
bool | mouseMoved (const Input::MouseMoveEvent &arg) override |
Mouse moved: return true if input was consumed. | |
bool | mouseButtonPressed (const Input::MouseButtonEvent &arg) override |
Mouse button pressed: return true if input was consumed. | |
bool | mouseButtonReleased (const Input::MouseButtonEvent &arg) override |
Mouse button released: return true if input was consumed. | |
bool | onTextEvent (const Input::TextEvent &arg) override |
void | mouseMovedExternally (const Input::MouseMoveEvent &arg) |
PROPERTY_RW (bool, wantsMouse, false) | |
PROPERTY_R_IW (ProjectIDs, availableProjects) | |
PROPERTY_R (Project_uptr, activeProject, nullptr) | |
const PlatformContext & | platformContext () const noexcept |
PlatformContext & | platformContext () noexcept |
![]() | |
FrameListener (const Str< 64 > &name, FrameListenerManager &parent, U32 callOrder) | |
Either give it a name. | |
virtual | ~FrameListener () override |
bool | operator< (FrameListener &that) const noexcept |
![]() | |
GUIDWrapper () noexcept | |
GUIDWrapper (const GUIDWrapper &old) noexcept | |
GUIDWrapper (GUIDWrapper &&old) noexcept | |
virtual | ~GUIDWrapper ()=default |
FORCE_INLINE I64 | getGUID () const noexcept |
GUIDWrapper & | operator= (const GUIDWrapper &old)=delete |
GUIDWrapper & | operator= (GUIDWrapper &&other)=delete |
![]() | |
virtual | ~InputAggregatorInterface ()=default |
virtual bool | onKeyDown (const KeyEvent &arg)=0 |
Keyboard: return true if input was consumed. | |
virtual bool | onKeyUp (const KeyEvent &arg)=0 |
virtual bool | mouseMoved (const MouseMoveEvent &arg)=0 |
Mouse: return true if input was consumed. | |
virtual bool | mouseButtonPressed (const MouseButtonEvent &arg)=0 |
virtual bool | mouseButtonReleased (const MouseButtonEvent &arg)=0 |
virtual bool | joystickButtonPressed (const JoystickEvent &arg)=0 |
Joystick or Gamepad: return true if input was consumed. | |
virtual bool | joystickButtonReleased (const JoystickEvent &arg)=0 |
virtual bool | joystickAxisMoved (const JoystickEvent &arg)=0 |
virtual bool | joystickPovMoved (const JoystickEvent &arg)=0 |
virtual bool | joystickBallMoved (const JoystickEvent &arg)=0 |
virtual bool | joystickAddRemove (const JoystickEvent &arg)=0 |
virtual bool | joystickRemap (const JoystickEvent &arg)=0 |
virtual bool | onTextEvent (const TextEvent &arg)=0 |
![]() | |
KernelComponent (Kernel &parent) noexcept | |
virtual | ~KernelComponent ()=default |
Kernel & | parent () noexcept |
const Kernel & | parent () const noexcept |
![]() | |
NonCopyable (const NonCopyable &)=delete | |
NonCopyable & | operator= (const NonCopyable &)=delete |
NonCopyable (NonCopyable &&)=default | |
NonCopyable & | operator= (NonCopyable &&)=default |
Static Public Member Functions | |
static bool | OnStartup (PlatformContext &context) |
static bool | OnShutdown (PlatformContext &context) |
![]() | |
static I64 | generateGUID () noexcept |
Protected Member Functions | |
bool | networkUpdate (U64 frameCount) |
ProjectIDs & | init () |
void | initPostLoadState () noexcept |
void | addPlayerInternal (Scene *parentScene, SceneGraphNode *playerNode) |
void | removePlayerInternal (Scene *parentScene, SceneGraphNode *playerNode) |
void | addPlayer (Scene *parentScene, SceneGraphNode *playerNode, bool queue) |
void | removePlayer (Scene *parentScene, SceneGraphNode *playerNode, bool queue) |
void | getNodesInScreenRect (const Rect< I32 > &screenRect, const Camera &camera, vector< SceneGraphNode * > &nodesOut) const |
void | waitForSaveTask () |
bool | frameStarted (const FrameEvent &evt) override |
bool | frameEnded (const FrameEvent &evt) override |
frameEnded is called after the buffers have been swapped | |
void | drawCustomUI (const Rect< I32 > &targetViewport, GFX::CommandBuffer &bufferInOut, GFX::MemoryBarrierCommand &memCmdInOut) |
void | postRender (GFX::CommandBuffer &bufferInOut, GFX::MemoryBarrierCommand &memCmdInOut) |
void | debugDraw (GFX::CommandBuffer &bufferInOut, GFX::MemoryBarrierCommand &memCmdInOut) |
void | prepareLightData (RenderStage stage, const CameraSnapshot &cameraSnapshot, GFX::MemoryBarrierCommand &memCmdInOut) |
Camera * | playerCamera (bool skipOverride=false) const noexcept |
Camera * | playerCamera (PlayerIndex idx, bool skipOverride=false) const noexcept |
void | editorPreviewNode (const I64 editorPreviewNode) noexcept |
void | currentPlayerPass (PlayerIndex idx) |
BoundingSphere | moveCameraToNode (Camera *camera, const SceneGraphNode *targetNode) const |
bool | saveNode (const SceneGraphNode *targetNode) const |
bool | loadNode (SceneGraphNode *targetNode) const |
std::pair< Handle< Texture >, SamplerDescriptor > | getSkyTexture () const |
ErrorCode | loadProjectInternal () |
![]() | |
void | setCallOrder (const U32 order) noexcept |
virtual bool | frameStarted (const FrameEvent &evt) |
virtual bool | framePreRender (const FrameEvent &evt) |
framePreRenderStarted is called when we need to start processing the visual aspect of a scene | |
virtual bool | frameSceneRenderStarted (const FrameEvent &evt) |
frameSceneRenderStarted is called right before rendering the scene for the current player starts | |
virtual bool | frameSceneRenderEnded (const FrameEvent &evt) |
frameSceneRenderEnded is called immediately after scene rendering for the current player has ended but before any blitting operations | |
virtual bool | frameRenderingQueued (const FrameEvent &evt) |
virtual bool | framePostRender (const FrameEvent &evt) |
virtual bool | frameEnded (const FrameEvent &evt) |
frameEnded is called after the buffers have been swapped | |
PROPERTY_R_IW (bool, enabled, false) | |
PROPERTY_RW (Str< 64 >, name) | |
![]() | |
NonCopyable ()=default | |
~NonCopyable ()=default | |
Private Attributes | |
bool | _init = false |
bool | _processInput = false |
Task * | _saveTask = nullptr |
PlayerIndex | _currentPlayerPass = 0u |
U64 | _elapsedAppTime = 0ULL |
U32 | _elapsedAppTimeMS = 0u |
U64 | _elapsedGameTime = 0ULL |
U32 | _elapsedGameTimeMS = 0u |
U64 | _saveTimer = 0ULL |
std::array< Time::ProfileTimer *, to_base(RenderStage::COUNT)> | _sceneGraphCullTimers |
bool | _playerQueueDirty = false |
eastl::queue< std::pair< Scene *, SceneGraphNode * > > | _playerAddQueue |
eastl::queue< std::pair< Scene *, SceneGraphNode * > > | _playerRemoveQueue |
AI::Navigation::DivideRecast_uptr | _recast |
SwitchProjectTarget | _projectSwitchTarget {} |
vector< std::pair< size_t, DELEGATE< void, U8, const vector< SceneGraphNode * > & > > > | _selectionChangeCallbacks |
VisibleNodeList | _recentlyRenderedNodes |
Additional Inherited Members | |
![]() | |
const I64 | _guid |
![]() | |
Kernel & | _parent |
Definition at line 189 of file ProjectManager.h.
|
explicit |
Definition at line 312 of file ProjectManager.cpp.
|
override |
Definition at line 319 of file ProjectManager.cpp.
|
noexcept |
Definition at line 1187 of file ProjectManager.cpp.
|
protected |
Definition at line 505 of file ProjectManager.cpp.
|
protected |
Definition at line 518 of file ProjectManager.cpp.
|
inline |
Definition at line 218 of file ProjectManager.h.
void Divide::ProjectManager::cullSceneGraph | ( | const NodeCullParams & | cullParams, |
const U16 | cullFlags, | ||
VisibleNodeList<> & | nodesOut | ||
) |
cull the SceneGraph against the current view frustum.
Definition at line 1065 of file ProjectManager.cpp.
|
protected |
Definition at line 928 of file ProjectManager.cpp.
|
protected |
Definition at line 892 of file ProjectManager.cpp.
void Divide::ProjectManager::destroy | ( | ) |
Definition at line 399 of file ProjectManager.cpp.
|
protected |
Definition at line 871 of file ProjectManager.cpp.
|
protectednoexcept |
Definition at line 937 of file ProjectManager.cpp.
void Divide::ProjectManager::findNode | ( | const vec3< F32 > & | cameraEye, |
const I64 | nodeGUID, | ||
VisibleNodeList<> & | nodesOut | ||
) |
Searches the scenegraph for the specified nodeGUID and, if found, adds it to nodesOut.
Definition at line 1080 of file ProjectManager.cpp.
|
overrideprotectedvirtual |
frameEnded is called after the buffers have been swapped
Reimplemented from Divide::FrameListener.
Definition at line 784 of file ProjectManager.cpp.
|
overrideprotectedvirtual |
Adapter patern instead of pure interface for the same reason as the Ogre boys pointed out: Implement what you need without filling classes with dummy functions frameStarted is calld at the beggining of a new frame before processing the logic aspect of a scene
Reimplemented from Divide::FrameListener.
Definition at line 764 of file ProjectManager.cpp.
|
noexcept |
Definition at line 1182 of file ProjectManager.cpp.
|
protected |
Definition at line 594 of file ProjectManager.cpp.
|
noexcept |
Definition at line 1044 of file ProjectManager.cpp.
|
protected |
Definition at line 1192 of file ProjectManager.cpp.
void Divide::ProjectManager::getSortedReflectiveNodes | ( | const Camera * | camera, |
RenderStage | stage, | ||
bool | inView, | ||
VisibleNodeList<> & | nodesOut | ||
) | const |
get the full list of reflective nodes
Definition at line 983 of file ProjectManager.cpp.
void Divide::ProjectManager::getSortedRefractiveNodes | ( | const Camera * | camera, |
RenderStage | stage, | ||
bool | inView, | ||
VisibleNodeList<> & | nodesOut | ||
) | const |
get the full list of refractive nodes
Definition at line 1014 of file ProjectManager.cpp.
void Divide::ProjectManager::idle | ( | ) |
Definition at line 335 of file ProjectManager.cpp.
|
protected |
Definition at line 359 of file ProjectManager.cpp.
|
noexcept |
init default culling values like max cull distance and other scene related states
Definition at line 1049 of file ProjectManager.cpp.
|
protectednoexcept |
Definition at line 470 of file ProjectManager.cpp.
|
overridevirtual |
Implements Divide::Input::InputAggregatorInterface.
Definition at line 1307 of file ProjectManager.cpp.
|
overridevirtual |
Joystick axis change: return true if input was consumed.
Implements Divide::Input::InputAggregatorInterface.
Definition at line 1257 of file ProjectManager.cpp.
|
overridevirtual |
Implements Divide::Input::InputAggregatorInterface.
Definition at line 1297 of file ProjectManager.cpp.
|
overridevirtual |
Joystick button pressed: return true if input was consumed.
Implements Divide::Input::InputAggregatorInterface.
Definition at line 1277 of file ProjectManager.cpp.
|
overridevirtual |
Joystick button released: return true if input was consumed.
Implements Divide::Input::InputAggregatorInterface.
Definition at line 1287 of file ProjectManager.cpp.
|
overridevirtual |
Joystick direction change: return true if input was consumed.
Implements Divide::Input::InputAggregatorInterface.
Definition at line 1267 of file ProjectManager.cpp.
|
overridevirtual |
Implements Divide::Input::InputAggregatorInterface.
Definition at line 1317 of file ProjectManager.cpp.
|
noexcept |
Check if the scene was loaded properly.
Definition at line 325 of file ProjectManager.cpp.
|
protected |
Definition at line 977 of file ProjectManager.cpp.
ErrorCode Divide::ProjectManager::loadProject | ( | const ProjectID & | targetProject, |
bool | deferToStartOfFrame | ||
) |
Definition at line 411 of file ProjectManager.cpp.
|
protected |
Definition at line 424 of file ProjectManager.cpp.
|
overridevirtual |
Mouse button pressed: return true if input was consumed.
Implements Divide::Input::InputAggregatorInterface.
Definition at line 1237 of file ProjectManager.cpp.
|
overridevirtual |
Mouse button released: return true if input was consumed.
Implements Divide::Input::InputAggregatorInterface.
Definition at line 1247 of file ProjectManager.cpp.
|
overridevirtual |
Mouse moved: return true if input was consumed.
Implements Divide::Input::InputAggregatorInterface.
Definition at line 1226 of file ProjectManager.cpp.
void Divide::ProjectManager::mouseMovedExternally | ( | const Input::MouseMoveEvent & | arg | ) |
Called if a mouse move event was captured by a different system (editor, gui, etc). Used to cancel scene specific mouse move tracking
Definition at line 1177 of file ProjectManager.cpp.
|
protected |
Root node just means a teleport to (0,0,0)
Definition at line 942 of file ProjectManager.cpp.
|
protected |
Definition at line 1492 of file ProjectManager.cpp.
void Divide::ProjectManager::onChangeFocus | ( | bool | hasFocus | ) |
Definition at line 1128 of file ProjectManager.cpp.
|
overridevirtual |
Key pressed: return true if input was consumed.
-----------------------—Input Management----------------------------------—///
Implements Divide::Input::InputAggregatorInterface.
Definition at line 1206 of file ProjectManager.cpp.
|
overridevirtual |
Key released: return true if input was consumed.
Implements Divide::Input::InputAggregatorInterface.
Definition at line 1216 of file ProjectManager.cpp.
void Divide::ProjectManager::onNodeDestroy | ( | Scene * | parentScene, |
SceneGraphNode * | node | ||
) |
Definition at line 1165 of file ProjectManager.cpp.
void Divide::ProjectManager::onResolutionChange | ( | const SizeChangeParams & | params | ) |
Definition at line 486 of file ProjectManager.cpp.
|
static |
Definition at line 307 of file ProjectManager.cpp.
|
static |
Definition at line 302 of file ProjectManager.cpp.
|
overridevirtual |
Implements Divide::Input::InputAggregatorInterface.
Definition at line 1327 of file ProjectManager.cpp.
|
noexcept |
Definition at line 1342 of file ProjectManager.cpp.
|
noexcept |
Definition at line 1337 of file ProjectManager.cpp.
|
protectednoexcept |
Definition at line 923 of file ProjectManager.cpp.
|
protectednoexcept |
Definition at line 903 of file ProjectManager.cpp.
|
inlinenoexcept |
Definition at line 260 of file ProjectManager.h.
|
protected |
Definition at line 880 of file ProjectManager.cpp.
|
protected |
Definition at line 1116 of file ProjectManager.cpp.
Divide::ProjectManager::PROPERTY_R | ( | Project_uptr | , |
activeProject | , | ||
nullptr | |||
) |
Divide::ProjectManager::PROPERTY_R_IW | ( | ProjectIDs | , |
availableProjects | |||
) |
Divide::ProjectManager::PROPERTY_RW | ( | bool | , |
wantsMouse | , | ||
false | |||
) |
|
inlinenoexcept |
Definition at line 267 of file ProjectManager.h.
|
protected |
Definition at line 560 of file ProjectManager.cpp.
|
protected |
Definition at line 573 of file ProjectManager.cpp.
|
inline |
Definition at line 227 of file ProjectManager.h.
bool Divide::ProjectManager::resetSelection | ( | PlayerIndex | idx, |
const bool | resetIfLocked | ||
) |
Definition at line 1138 of file ProjectManager.cpp.
bool Divide::ProjectManager::saveActiveScene | ( | bool | toCache, |
bool | deferred, | ||
const DELEGATE< void, std::string_view > & | msgCallback = {} , |
||
const DELEGATE< void, bool > & | finishCallback = {} |
||
) |
Definition at line 1455 of file ProjectManager.cpp.
|
protected |
Definition at line 972 of file ProjectManager.cpp.
void Divide::ProjectManager::setSelected | ( | PlayerIndex | idx, |
const vector< SceneGraphNode * > & | SGNs, | ||
bool | recursive | ||
) |
Definition at line 1154 of file ProjectManager.cpp.
Update animations, network data, sounds, triggers etc.
Definition at line 799 of file ProjectManager.cpp.
|
protected |
Definition at line 460 of file ProjectManager.cpp.
|
friend |
Definition at line 202 of file ProjectManager.h.
|
friend |
Definition at line 198 of file ProjectManager.h.
|
friend |
Definition at line 199 of file ProjectManager.h.
|
friend |
Definition at line 195 of file ProjectManager.h.
|
friend |
Definition at line 200 of file ProjectManager.h.
|
friend |
Definition at line 197 of file ProjectManager.h.
|
friend |
Definition at line 201 of file ProjectManager.h.
|
friend |
Definition at line 194 of file ProjectManager.h.
|
private |
Definition at line 360 of file ProjectManager.h.
|
private |
Definition at line 361 of file ProjectManager.h.
|
private |
Definition at line 362 of file ProjectManager.h.
|
private |
Definition at line 363 of file ProjectManager.h.
|
private |
Definition at line 364 of file ProjectManager.h.
|
private |
Definition at line 356 of file ProjectManager.h.
|
private |
Definition at line 370 of file ProjectManager.h.
|
private |
Definition at line 369 of file ProjectManager.h.
|
private |
Definition at line 371 of file ProjectManager.h.
|
private |
Definition at line 357 of file ProjectManager.h.
|
private |
Definition at line 374 of file ProjectManager.h.
|
private |
Definition at line 372 of file ProjectManager.h.
|
private |
Definition at line 377 of file ProjectManager.h.
|
private |
Definition at line 359 of file ProjectManager.h.
|
private |
Definition at line 365 of file ProjectManager.h.
|
private |
Definition at line 367 of file ProjectManager.h.
|
private |
Definition at line 376 of file ProjectManager.h.