62 const ResourcePath targetProjectPath = Paths::g_projectsLocation / projectID.
_name;
63 const FileError ret =
copyDirectory( sourceProjectPath, targetProjectPath,
true,
true );
65 return ret == FileError::NONE;
71 const ResourcePath scenePath = Paths::g_projectsLocation / projectID.
_name / Paths::g_scenesLocation;
74 if ( ret != FileError::NONE )
82 (scene.
_name +
".xml").c_str(),
85 if ( ret != FileError::NONE )
88 if (ret != FileError::NONE)
100 , _scenePool( *this )
101 , _parentManager( parentMgr )
103 const std::filesystem::directory_iterator end;
104 for ( std::filesystem::directory_iterator iter{ (Paths::g_projectsLocation / projectID.
_name / Paths::g_scenesLocation).fileSystemPath() }; iter != end; ++iter )
106 if ( std::filesystem::is_directory( *iter ) &&
109 auto name = iter->path().filename().string();
110 if ( name.length() > 255 )
112 name = name.substr( 0, 255 );
117 .
_name = name.c_str()
161 return _scenePool.activeScene();
197 STUBBED(
"ToDo: Threaded scene load is currently disabled -Ionut");
199 const bool threaded =
false;
204 Scene* sceneToUnload = _scenePool.activeScene();
205 if ( sceneToUnload !=
nullptr && sceneToUnload->resourceName().compare( scene.
_name ) == 0 )
207 unloadPrevious =
false;
216 if ( unloadPrevious && sceneToUnload )
228 [
this, scene, unloadPrevious, &sceneToUnload]()
230 bool foundInCache =
false;
232 assert( loadedScene !=
nullptr && foundInCache );
241 if ( unloadPrevious && sceneToUnload !=
nullptr )
243 _scenePool.deleteScene( sceneToUnload->
getGUID() );
255 bool foundInCache =
false;
256 Scene* loadingScene = _scenePool.getOrCreateScene(
parent().platformContext(), *
this, sceneEntry, foundInCache );
274 assert( scene !=
nullptr );
284 assert( scene !=
nullptr );
290 _scenePool.activeScene( *scene );
313 :
FrameListener(
"ProjectManager", parentKernel.frameListenerMgr(), 2 )
314 , InputAggregatorInterface()
327 if ( activeProject() ==
nullptr )
367 _recast = std::make_unique<AI::Navigation::DivideRecast>();
378 const std::filesystem::directory_iterator end;
379 for ( std::filesystem::directory_iterator iter{ Paths::g_projectsLocation.fileSystemPath() }; iter != end; ++iter )
381 if ( !std::filesystem::is_directory( *iter ) ||
387 const std::string projectName = iter->path().filename().string();
389 _availableProjects.emplace_back(
ProjectID
392 ._name = projectName.c_str()
396 return _availableProjects;
415 if (!deferToStartOfFrame)
429 if ( _activeProject !=
nullptr )
434 _activeProject = std::make_unique<Project>( *
this, target.
_targetProject );
436 if ( _activeProject ==
nullptr || _activeProject->getSceneEntries().empty() )
444 .
_targetScene = _activeProject->getSceneEntries().front(),
445 ._unloadPreviousScene =
true,
446 ._loadInSeparateThread =
false,
447 ._deferToStartOfFrame =
false,
448 ._createIfNotExist =
false
451 if ( !_activeProject->switchScene( sceneTarget ) )
495 for (
const auto& crtPlayer : players )
497 if ( crtPlayer !=
nullptr )
499 crtPlayer->camera()->setProjection( aspectRatio, vFoV, zPlanes );
524 for (
const auto& crtPlayer : players )
526 if ( crtPlayer && crtPlayer->getBoundNode()->getGUID() == sgnGUID )
535 if ( players[i] ==
nullptr )
543 players[i] = std::make_shared<Player>(
to_U8( i ) );
545 players[i]->camera()->setFixedYawAxis(
true );
548 boost::property_tree::ptree pt;
552 players[i]->camera()->loadFromXML( pt );
575 if ( playerNode ==
nullptr )
585 if ( players[i] !=
nullptr && players[i]->getBoundNode()->
getGUID() == targetGUID )
588 players[i] =
nullptr;
617 const auto& sceneGraph = activeProject()->getActiveScene()->sceneGraph();
628 const auto CheckPointLoS = [&](
const vec3<F32>& point,
const I64 nodeGUID,
const I64 parentNodeGUID ) ->
bool
631 intersectionParams.
_range = { 0.f, zPlanes.
y };
635 sceneGraph->intersect( intersectionParams, rayResults );
639 if ( result.sgnGUID == nodeGUID ||
640 result.sgnGUID == parentNodeGUID )
645 if ( result.inside || result.dist < distanceToPoint )
655 I64 parentNodeGUID = -1;
659 parentNodeGUID = node->parent()->
getGUID();
661 return CheckPointLoS( point, nodeGUID, parentNodeGUID );
664 const auto IsNodeInRect = [&screenRect, &camera, &gfx](
SceneGraphNode* node )
666 assert( node !=
nullptr );
671 if ( sComp ==
nullptr &&
674 if ( node->parent() != nullptr )
684 if ( sComp !=
nullptr && sComp->enabled() )
687 if ( bComp !=
nullptr )
692 return screenRect.
contains( camera.
project( center, targetViewport ) );
704 if ( IsNodeInRect( node.
_node ) )
706 inRectList.
append( node );
707 if ( inRectList.
size() == 1024 )
715 for (
size_t i = 0u; i < inRectList.
size(); ++i )
726 for (
U8 p = 0; p < 8; ++p )
738 for (
size_t i = 0; i < LoSList.
size(); ++i )
741 if ( parsedNode !=
nullptr )
748 parsedNode = parsedNode->parent();
756 if ( eastl::find( cbegin( nodesOut ), cend( nodesOut ), parsedNode ) == cend( nodesOut ) )
758 nodesOut.push_back( parsedNode );
803 Scene* activeScene = activeProject()->getActiveScene();
814 ? dayNightData.
_sunLight->getDiffuseColour()
829 FogDetails fog = activeScene->state()->renderState().fogDetails();
838 const auto& activeSceneState = activeScene->state();
839 sceneData->
windDetails( activeSceneState->windDirX(),
841 activeSceneState->windDirZ(),
842 activeSceneState->windSpeed() );
850 const auto& waterBodies = activeSceneState->waterBodies();
851 for (
const auto& body : waterBodies )
875 GFX::EnqueueCommand<GFX::SetViewportCommand>( bufferInOut )->_viewport = targetViewport;
884 Scene* activeScene = activeProject()->getActiveScene();
885 if ( activeScene->state()->screenshotRequestQueued() )
888 activeScene->state()->screenshotRequestQueued(
false);
896 Scene* activeScene = activeProject()->getActiveScene();
905 if ( activePlayerCount() <= idx )
910 Scene* activeScene = activeProject()->getActiveScene();
913 Camera* overrideCamera = activeScene->state()->playerState( idx ).overrideCamera();
914 if ( overrideCamera !=
nullptr )
916 return overrideCamera;
925 return playerCamera( _currentPlayerPass, skipOverride );
939 activeProject()->getActiveScene()->state()->renderState().singleNodeRenderGUID( editorPreviewNode );
950 if ( camera ==
nullptr )
956 if ( targetNode->parent() !=
nullptr )
968 camera->
lookAt( eyePos, targetPos );
1000 cullParams.
_lodThresholds = activeProject()->getActiveScene()->state()->renderState().lodThresholds();
1001 cullParams.
_stage = stage;
1030 cullParams.
_lodThresholds = activeProject()->getActiveScene()->state()->renderState().lodThresholds();
1031 cullParams.
_stage = stage;
1051 Scene* activeScene = activeProject()->getActiveScene();
1053 cullParamsInOut._stage = stage;
1054 cullParamsInOut._lodThresholds = activeScene->state()->renderState().lodThresholds( stage );
1057 cullParamsInOut._cullMaxDistance = activeScene->state()->renderState().generalVisibility();
1061 cullParamsInOut._cullMaxDistance =
F32_MAX;
1071 Scene* activeScene = activeProject()->getActiveScene();
1084 if ( nodeGUID != -1 )
1087 if ( sgn !=
nullptr )
1089 const auto appendNode = [&nodesOut, &cameraEye](
SceneGraphNode* sgn )
1107 const U32 childCount = children._count;
1108 for (
U32 i = 0u; i < childCount; ++i )
1110 appendNode( children._data[i] );
1122 LightPool* pool = activeProject()->getActiveScene()->lightPool().get();
1135 activeProject()->getActiveScene()->onChangeFocus( hasFocus );
1146 cbk.second( idx, {} );
1161 cbk.second( idx, SGNs );
1170 if ( players[i] !=
nullptr && !
resetSelection( players[i]->index(),
true ) )
1189 return activeProject()->getActiveScene()->playerCount();
1194 const auto& skies = activeProject()->getActiveScene()->sceneGraph()->getNodesByType(
SceneNodeType::TYPE_SKY );
1195 if ( !skies.empty() )
1197 const Sky& sky = skies.front()->getNode<Sky>();
1198 return std::make_pair( sky.activeSkyBox(), sky.skyboxSampler() );
1201 return { INVALID_HANDLE<Texture>, {} };
1213 return activeProject()->getActiveScene()->input()->onKeyDown( key );
1223 return activeProject()->getActiveScene()->input()->onKeyUp( key );
1234 return activeProject()->getActiveScene()->input()->mouseMoved( arg );
1244 return activeProject()->getActiveScene()->input()->mouseButtonPressed( arg );
1254 return activeProject()->getActiveScene()->input()->mouseButtonReleased( arg );
1264 return activeProject()->getActiveScene()->input()->joystickAxisMoved( arg );
1274 return activeProject()->getActiveScene()->input()->joystickPovMoved( arg );
1284 return activeProject()->getActiveScene()->input()->joystickButtonPressed( arg );
1294 return activeProject()->getActiveScene()->input()->joystickButtonReleased( arg );
1304 return activeProject()->getActiveScene()->input()->joystickBallMoved( arg );
1314 return activeProject()->getActiveScene()->input()->joystickAddRemove( arg );
1324 return activeProject()->getActiveScene()->input()->joystickRemap( arg );
1334 return activeProject()->getActiveScene()->input()->onTextEvent( arg );
1355 if ( activeScene->state()->saveLoadDisabled() )
1360 const Str<256>& sceneName = activeScene->resourceName();
1362 const ResourcePath path = Paths::g_saveLocation / sceneName;
1364 bool isLoadFromBackup =
false;
1368 isLoadFromBackup =
true;
1373 if (
copyFile( path, g_bakSaveFile, path, g_saveFile,
false ) != FileError::NONE )
1390 if (
deleteFile( path, g_saveFile ) != FileError::NONE )
1394 if ( !isLoadFromBackup )
1423 if ( activeScene->state()->saveLoadDisabled() )
1429 const Str<256>& sceneName = activeScene->resourceName();
1430 const ResourcePath path = Paths::g_saveLocation / sceneName;
1434 if (
copyFile( path, g_saveFile, path, g_bakSaveFile,
true ) != FileError::NONE )
1448 if ( finishCallback )
1450 finishCallback( ret );
1459 Scene* activeScene = activeProject()->getActiveScene();
1482 [activeScene, msgCallback, finishCallback, toCache](
const Task& )
#define PROFILE_SCOPE_AUTO(CATEGORY)
Time::ApplicationTimer & timer() noexcept
static void shadowingSettings(GFXDevice &device, const F32 lightBleedBias, const F32 minShadowVariance) noexcept
static bool onFrameStart(Divide::Project &project)
static void idle(Divide::Project &project)
static void waitForSaveTask(Divide::ProjectManager &mgr)
static bool onFrameEnd(Divide::Project &project)
static bool saveXML(Scene *scene, const DELEGATE< void, std::string_view > &msgCallback, const DELEGATE< void, bool > &finishCallback)
static bool load(Scene *scene, ByteBuffer &inputBuffer)
static bool save(const Scene *scene, ByteBuffer &outputBuffer)
static bool saveNodeToXML(Scene *scene, const SceneGraphNode *node)
static bool loadNodeFromXML(Scene *scene, SceneGraphNode *node)
static bool onShutdown(PlatformContext &context)
static void postLoadMainThread(Scene *scene)
static void drawCustomUI(Scene *scene, const Rect< I32 > &targetViewport, GFX::CommandBuffer &bufferInOut, GFX::MemoryBarrierCommand &memCmdInOut)
static bool resetSelection(Scene *scene, const PlayerIndex idx, const bool resetIfLocked)
static void onSetActive(Scene *scene)
static bool load(Scene *scene)
static bool frameEnded(Scene *scene)
static bool onStartup(PlatformContext &context)
static PlayerList & getPlayers(Scene *scene) noexcept
static bool loadComplete(Scene *scene) noexcept
static bool unload(Scene *scene)
static void onPlayerRemove(Scene *scene, const Player_ptr &player)
static void onPlayerAdd(Scene *scene, const Player_ptr &player)
static void onRemoveActive(Scene *scene)
static bool frameStarted(Scene *scene)
static SceneEnvironmentProbePool * getEnvProbes(Scene *scene) noexcept
static void currentPlayerPass(Scene *scene, const PlayerIndex idx)
static void debugDraw(Scene *scene, GFX::CommandBuffer &bufferInOut, GFX::MemoryBarrierCommand &memCmdInOut)
static void clearHoverTarget(Scene *scene, const Input::MouseMoveEvent &arg)
static void setSelected(Scene *scene, const PlayerIndex idx, const vector< SceneGraphNode * > &sgns, const bool recursive)
const vec3< F32 > & getCenter() const noexcept
F32 getDistanceFromPoint(const vec3< F32 > &point) const noexcept
void setRadius(F32 radius) noexcept
F32 getRadius() const noexcept
void setCenter(const vec3< F32 > ¢er) noexcept
const BoundingSphere & getBoundingSphere() const noexcept
bool loadFromFile(const ResourcePath &path, std::string_view fileName, const U8 version=BUFFER_FORMAT_VERSION)
bool dumpToFile(const ResourcePath &path, std::string_view fileName, const U8 version=BUFFER_FORMAT_VERSION)
Saves the entire buffer contents to file. Always appends the version at the end of the file.
const mat4< F32 > & viewMatrix() const noexcept
Returns the most recent/up-to-date view matrix.
static Camera * GetUtilityCamera(const UtilityCamera type)
const mat4< F32 > & lookAt(const mat4< F32 > &viewMatrix)
Sets the camera's view matrix to specify the specified value by extracting the eye position,...
const Frustum & getFrustum() const noexcept
Returns the most recent/up-to-date frustum.
const CameraSnapshot & snapshot() const noexcept
Returns the internal camera snapshot data (eye, orientation, etc)
static constexpr F32 s_minNearZ
bool updateLookAt()
Return true if the cached camera state wasn't up-to-date.
vec2< F32 > project(const vec3< F32 > &worldCoords, const Rect< I32 > &viewport) const noexcept
bool maximized() const noexcept
void onChangeScene(Scene *newScene)
void registerFrameListener(FrameListener *listener, U32 callOrder)
Register a new Frame Listener to be processed every frame.
Rough around the edges Adapter pattern abstracting the actual rendering API and access to the GPU.
vec2< U16 > renderingResolution() const noexcept
Renderer & getRenderer() const
void debugDraw(const SceneRenderState &sceneRenderState, GFX::CommandBuffer &bufferInOut, GFX::MemoryBarrierCommand &memCmdInOut)
Render all of our immediate mode primitives. This isn't very optimised and most are recreated per fra...
static U64 FrameCount() noexcept
void screenshot(std::string_view fileName, GFX::CommandBuffer &bufferInOut) const
Save a screenshot in TGA format.
FORCE_INLINE I64 getGUID() const noexcept
void onUnloadScene(Scene *scene)
When we unload a scene, we unload all of its GUI elements. ToDo: Scene should own these and scene sho...
void onChangeScene(Scene *newScene)
When we change a scene, we want to toggle our current scene GUI elements off and toggle the new scene...
Kernel & parent() noexcept
The kernel is the main system that connects all of our various systems: windows, gfx,...
FORCE_INLINE PlatformContext & platformContext() noexcept
FORCE_INLINE FrameListenerManager & frameListenerMgr() noexcept
void uploadLightData(RenderStage stage, const CameraSnapshot &cameraSnapshot, GFX::MemoryBarrierCommand &memCmdInOut)
void sortLightData(RenderStage stage, const CameraSnapshot &cameraSnapshot)
static void DestroyStaticData()
static void InitStaticData(PlatformContext &context)
static bool saveNodeToXML(Scene *activeScene, const SceneGraphNode *node)
static bool saveScene(Scene *activeScene, bool toCache, const DELEGATE< void, std::string_view > &msgCallback, const DELEGATE< void, bool > &finishCallback)
static bool loadNodeFromXML(Scene *activeScene, SceneGraphNode *node)
static bool loadScene(Scene *activeScene)
vec3< F32 > cornerPoint(U8 cornerIndex) const noexcept
PlatformContext & context() noexcept
DisplayWindow & mainWindow() noexcept
Application & app() noexcept
Editor & editor() noexcept
TaskPool & taskPool(const TaskPoolType type) noexcept
GFXDevice & gfx() noexcept
void setFadeOut(const UColour3 &targetColour, D64 durationMS, D64 waitDurationMS, DELEGATE< void > onComplete=DELEGATE< void >())
void setFadeIn(D64 durationMS, DELEGATE< void > onComplete=DELEGATE< void >())
void setActiveScene(Scene *scene)
Scene * getActiveScene() const noexcept
bool switchSceneInternal()
SwitchSceneTarget _sceneSwitchTarget
bool unloadScene(Scene *scene)
vector< SceneEntry > _sceneEntries
Project(ProjectManager &parentMgr, const ProjectID &name)
static bool CreateNewScene(const SceneEntry &scene, const ProjectID &projectID)
static bool CreateNewProject(const ProjectID &projectID)
bool switchScene(const SwitchSceneTarget &scene)
Scene * loadScene(const SceneEntry &sceneEntry)
ProjectManager & parent() noexcept
bool loadComplete() const noexcept
Check if the scene was loaded properly.
void addPlayerInternal(Scene *parentScene, SceneGraphNode *playerNode)
SwitchProjectTarget _projectSwitchTarget
bool joystickPovMoved(const Input::JoystickEvent &arg) override
Joystick direction change: return true if input was consumed.
bool mouseButtonPressed(const Input::MouseButtonEvent &arg) override
Mouse button pressed: return true if input was consumed.
bool saveActiveScene(bool toCache, bool deferred, const DELEGATE< void, std::string_view > &msgCallback={}, const DELEGATE< void, bool > &finishCallback={})
bool joystickBallMoved(const Input::JoystickEvent &arg) override
void initPostLoadState() noexcept
bool mouseButtonReleased(const Input::MouseButtonEvent &arg) override
Mouse button released: return true if input was consumed.
vector< std::pair< size_t, DELEGATE< void, U8, const vector< SceneGraphNode * > & > > > _selectionChangeCallbacks
void getSortedReflectiveNodes(const Camera *camera, RenderStage stage, bool inView, VisibleNodeList<> &nodesOut) const
get the full list of reflective nodes
static bool OnStartup(PlatformContext &context)
void setSelected(PlayerIndex idx, const vector< SceneGraphNode * > &SGNs, bool recursive)
bool frameStarted(const FrameEvent &evt) override
void drawCustomUI(const Rect< I32 > &targetViewport, GFX::CommandBuffer &bufferInOut, GFX::MemoryBarrierCommand &memCmdInOut)
~ProjectManager() override
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.
ProjectManager(Kernel &parentKernel)
VisibleNodeList _recentlyRenderedNodes
eastl::queue< std::pair< Scene *, SceneGraphNode * > > _playerAddQueue
void getSortedRefractiveNodes(const Camera *camera, RenderStage stage, bool inView, VisibleNodeList<> &nodesOut) const
get the full list of refractive nodes
void editorPreviewNode(const I64 editorPreviewNode) noexcept
void removePlayerInternal(Scene *parentScene, SceneGraphNode *playerNode)
ErrorCode loadProjectInternal()
bool onKeyDown(const Input::KeyEvent &key) override
Key pressed: return true if input was consumed.
eastl::queue< std::pair< Scene *, SceneGraphNode * > > _playerRemoveQueue
std::pair< Handle< Texture >, SamplerDescriptor > getSkyTexture() const
Camera * playerCamera(bool skipOverride=false) const noexcept
bool networkUpdate(U64 frameCount)
const PlatformContext & platformContext() const noexcept
bool joystickRemap(const Input::JoystickEvent &arg) override
bool saveNode(const SceneGraphNode *targetNode) const
void removePlayer(Scene *parentScene, SceneGraphNode *playerNode, bool queue)
void addPlayer(Scene *parentScene, SceneGraphNode *playerNode, bool queue)
void prepareLightData(RenderStage stage, const CameraSnapshot &cameraSnapshot, GFX::MemoryBarrierCommand &memCmdInOut)
bool joystickButtonPressed(const Input::JoystickEvent &arg) override
Joystick button pressed: return true if input was consumed.
ErrorCode loadProject(const ProjectID &targetProject, bool deferToStartOfFrame)
bool joystickAddRemove(const Input::JoystickEvent &arg) override
bool frameEnded(const FrameEvent &evt) override
frameEnded is called after the buffers have been swapped
const VisibleNodeList & getRenderedNodeList() const noexcept
std::array< Time::ProfileTimer *, to_base(RenderStage::COUNT)> _sceneGraphCullTimers
void postRender(GFX::CommandBuffer &bufferInOut, GFX::MemoryBarrierCommand &memCmdInOut)
void getNodesInScreenRect(const Rect< I32 > &screenRect, const Camera &camera, vector< SceneGraphNode * > &nodesOut) const
void debugDraw(GFX::CommandBuffer &bufferInOut, GFX::MemoryBarrierCommand &memCmdInOut)
void initDefaultCullValues(RenderStage stage, NodeCullParams &cullParamsInOut) noexcept
init default culling values like max cull distance and other scene related states
bool joystickAxisMoved(const Input::JoystickEvent &arg) override
Joystick axis change: return true if input was consumed.
void cullSceneGraph(const NodeCullParams &cullParams, const U16 cullFlags, VisibleNodeList<> &nodesOut)
cull the SceneGraph against the current view frustum.
bool onKeyUp(const Input::KeyEvent &key) override
Key released: return true if input was consumed.
bool mouseMoved(const Input::MouseMoveEvent &arg) override
Mouse moved: return true if input was consumed.
PlayerIndex _currentPlayerPass
void onResolutionChange(const SizeChangeParams ¶ms)
void onNodeDestroy(Scene *parentScene, SceneGraphNode *node)
void currentPlayerPass(PlayerIndex idx)
bool resetSelection(PlayerIndex idx, const bool resetIfLocked)
SceneEnvironmentProbePool * getEnvProbes() const noexcept
void mouseMovedExternally(const Input::MouseMoveEvent &arg)
bool loadNode(SceneGraphNode *targetNode) const
U8 activePlayerCount() const noexcept
void onChangeFocus(bool hasFocus)
AI::Navigation::DivideRecast_uptr _recast
static bool OnShutdown(PlatformContext &context)
BoundingSphere moveCameraToNode(Camera *camera, const SceneGraphNode *targetNode) const
bool joystickButtonReleased(const Input::JoystickEvent &arg) override
Joystick button released: return true if input was consumed.
void updateSceneState(U64 deltaGameTimeUS, U64 deltaAppTimeUS)
Update animations, network data, sounds, triggers etc.
bool onTextEvent(const Input::TextEvent &arg) override
bool contains(U xIn, U yIn) const noexcept
ResourceState getState() const noexcept
static BoundingSphere GetBounds(const SceneGraphNode *sgn)
SceneGraphNode * findNode(const Str< 128 > &name, bool sceneNodeName=false) const
SceneGraph * sceneGraph() noexcept
Return a reference to the parent graph. Operator= should be disabled.
FORCE_INLINE T * get() const
Returns a pointer to a specific component. Returns null if the SGN does not have the component reques...
bool hasFlag(const Flags flag) const noexcept
Returns true only if the current node has the specified flag. Does not check children!
ChildContainer & getChildren() noexcept
static I64 DEFAULT_SCENE_GUID
void updateSceneState(U64 deltaTimeUS)
Update animations, network data, sounds, triggers etc.
static ResourcePath GetSceneRootFolder(const Project &project)
Return the full path to the location of Scenes folder in the project (e.g. ./Projects/Foo/Scenes/ for...
vec3< F32 > getSunDirection() const
Project & parent() noexcept
SunInfo getCurrentSunDetails() const noexcept
void fogDetails(const FogDetails &details) noexcept
void windDetails(const F32 directionX, const F32 directionY, const F32 directionZ, const F32 speed) noexcept
bool waterDetails(const U8 index, const WaterBodyData &data) noexcept
void appData(const U32 elapsedGameTimeMS, const U32 elapsedAppTimeMS, const MaterialDebugFlag materialDebugFlag)
void sunDetails(const vec3< F32 > &sunDirection, const FColour3 &colour, const F32 altitude, const F32 azimuth) noexcept
void waitForAllTasks(bool flushCallbacks)
void resetFPSCounter() noexcept
vec3< T > getForwardDirection() const noexcept
Returns normalized(getForwardVec())
vec3 direction(const vec3 &u) const noexcept
get the direction vector to the specified point
T distance(const vec3 &v) const noexcept
compute the vector's distance to another specified vector
constexpr T RadiansToDegrees(T angleRadians) noexcept
Return the degree equivalent of the given radian value.
constexpr DEGREES< T > to_VerticalFoV(DEGREES< T > horizontalFoV, D64 aspectRatio) noexcept
constexpr bool ENABLE_EDITOR
constexpr bool IS_DEBUG_BUILD
constexpr bool IS_EDITOR_BUILD
constexpr U8 MAX_LOCAL_PLAYER_COUNT
Maximum number of players we support locally. We store per-player data such as key-bindings,...
constexpr char DELETED_FOLDER_NAME[]
constexpr char DEFAULT_PROJECT_NAME[]
constexpr char DEFAULT_SCENE_NAME[]
FColour4 WHITE
Random stuff added for convenience.
constexpr Optick::Category::Type Scene
constexpr T SecondsToMicroseconds(U a) noexcept
ProfileTimer & ADD_TIMER(const char *timerName)
const char * RenderStageToString(const RenderStage stage) noexcept
Str StringFormat(const char *fmt, Args &&...args)
bool CompareIgnoreCase(const char *a, const char *b) noexcept
void readXML(const ResourcePath &path, boost::property_tree::ptree &tree)
constexpr const char * g_saveFile
constexpr const char * g_bakSaveFile
Handle console commands that start with a forward slash.
FileError removeDirectory(const ResourcePath &path)
DELEGATE_STD< Ret, Args... > DELEGATE
constexpr U32 to_U32(const T value)
void Wait(const Task &task, TaskPool &pool)
vector< ProjectID > ProjectIDs
@ RES_LOADED
The resource is available for usage.
@ RES_LOADING
The resource is loading, creating data, parsing scripts, etc.
Task * CreateTask(Predicate &&threadedFunction, bool allowedInIdle=true)
constexpr F32 to_F32(const T value)
bool Finished(const Task &task) noexcept
constexpr D64 to_D64(const T value)
SceneNodeType
ToDo: Move particle emitter to components (it will make them way more dynamic) - Ionut.
constexpr U16 BYTE_BUFFER_VERSION
eastl::vector< Type > vector
bool IsSet(const SwitchSceneTarget &target) noexcept
std::shared_lock< mutex > SharedLock
FileError copyFile(const ResourcePath &sourcePath, const std::string_view sourceName, const ResourcePath &targetPath, const std::string_view targetName, const bool overwrite)
constexpr U64 _ID(const char *const str, const U64 value=val_64_const) noexcept
void efficient_clear(eastl::fixed_vector< T, nodeCount, bEnableOverflow, OverflowAllocator > &fixed_vector)
constexpr U8 to_U8(const T value)
static const vec3< F32 > WORLD_Z_NEG_AXIS
FORCE_INLINE constexpr bool Is3DObject(const SceneNodeType type) noexcept
void Start(Task &task, TaskPool &pool, TaskPriority priority=TaskPriority::DONT_CARE, const DELEGATE< void > &onCompletionFunction={})
FileError copyDirectory(const ResourcePath &sourcePath, const ResourcePath &targetPath, bool recursively, bool overwrite)
bool operator==(const DisplayManager::OutputDisplayProperties &lhs, const DisplayManager::OutputDisplayProperties &rhs) noexcept
FileError deleteFile(const ResourcePath &filePath, const std::string_view fileName)
bool fileExists(const ResourcePath &filePathAndName)
constexpr I32 to_I32(const T value)
bool pathExists(const ResourcePath &filePath)
static const vec3< F32 > VECTOR3_ZERO
FORCE_INLINE T * Get(const Handle< T > handle)
constexpr auto to_base(const Type value) -> Type
static NO_INLINE void errorfn(const char *format, T &&... args)
static NO_INLINE void warnfn(const char *format, T &&... args)
static NO_INLINE void printfn(const char *format, T &&... args)
vec4< F32 > _colourAndDensity
vec4< F32 > _colourSunScatter
vec4< U16 > _lodThresholds
vec3< F32 > _cameraEyePos
static void FrustumCull(const NodeCullParams ¶ms, U16 cullFlags, const SceneGraph &sceneGraph, const SceneState &sceneState, PlatformContext &context, VisibleNodeList<> &nodesOut)
static void ToVisibleNodes(const Camera *camera, const vector< SceneGraphNode * > &nodes, VisibleNodeList<> &nodesOut)
StringReturnType< N > string() const noexcept
const SceneNodeType * _ignoredTypes
bool _includeTransformNodes
size_t _ignoredTypesCount
DirectionalLightComponent * _sunLight
U16 width
The new width and height.
Angle::RADIANS< F32 > azimuth
Angle::RADIANS< F32 > altitude
Angle::DEGREES< F32 > altitudeMax
bool _deferToStartOfFrame
bool _unloadPreviousScene
void append(const VisibleNodeList &other) noexcept
size_t size() const noexcept
const T & node(const size_t idx) const noexcept