mirror of
https://github.com/AxioDL/PrimeWorldEditor.git
synced 2025-12-17 00:47:05 +00:00
Renamed CSceneManager to CScene
This commit is contained in:
@@ -3,7 +3,7 @@
|
||||
#include "Core/Render/CGraphics.h"
|
||||
#include "Core/Render/CRenderer.h"
|
||||
|
||||
CCollisionNode::CCollisionNode(CSceneManager *pScene, CSceneNode *pParent, CCollisionMeshGroup *pCollision)
|
||||
CCollisionNode::CCollisionNode(CScene *pScene, CSceneNode *pParent, CCollisionMeshGroup *pCollision)
|
||||
: CSceneNode(pScene, pParent)
|
||||
{
|
||||
SetCollision(pCollision);
|
||||
|
||||
@@ -9,7 +9,7 @@ class CCollisionNode : public CSceneNode
|
||||
TResPtr<CCollisionMeshGroup> mpCollision;
|
||||
|
||||
public:
|
||||
CCollisionNode(CSceneManager *pScene, CSceneNode *pParent = 0, CCollisionMeshGroup *pCollision = 0);
|
||||
CCollisionNode(CScene *pScene, CSceneNode *pParent = 0, CCollisionMeshGroup *pCollision = 0);
|
||||
ENodeType NodeType();
|
||||
void AddToRenderer(CRenderer *pRenderer, const SViewInfo& ViewInfo);
|
||||
void Draw(FRenderOptions Options, int ComponentIndex, const SViewInfo& ViewInfo);
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
#include "Core/Render/CRenderer.h"
|
||||
#include <Math/MathUtil.h>
|
||||
|
||||
CLightNode::CLightNode(CSceneManager *pScene, CSceneNode *pParent, CLight *Light)
|
||||
CLightNode::CLightNode(CScene *pScene, CSceneNode *pParent, CLight *Light)
|
||||
: CSceneNode(pScene, pParent)
|
||||
{
|
||||
mpLight = Light;
|
||||
|
||||
@@ -8,7 +8,7 @@ class CLightNode : public CSceneNode
|
||||
{
|
||||
CLight *mpLight;
|
||||
public:
|
||||
CLightNode(CSceneManager *pScene, CSceneNode *pParent = 0, CLight *Light = 0);
|
||||
CLightNode(CScene *pScene, CSceneNode *pParent = 0, CLight *Light = 0);
|
||||
ENodeType NodeType();
|
||||
void AddToRenderer(CRenderer *pRenderer, const SViewInfo& ViewInfo);
|
||||
void Draw(FRenderOptions Options, int ComponentIndex, const SViewInfo& ViewInfo);
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
#include "Core/Render/CGraphics.h"
|
||||
#include <Math/MathUtil.h>
|
||||
|
||||
CModelNode::CModelNode(CSceneManager *pScene, CSceneNode *pParent, CModel *pModel) : CSceneNode(pScene, pParent)
|
||||
CModelNode::CModelNode(CScene *pScene, CSceneNode *pParent, CModel *pModel) : CSceneNode(pScene, pParent)
|
||||
{
|
||||
SetModel(pModel);
|
||||
mScale = CVector3f(1.f);
|
||||
|
||||
@@ -12,7 +12,7 @@ class CModelNode : public CSceneNode
|
||||
bool mForceAlphaOn;
|
||||
|
||||
public:
|
||||
explicit CModelNode(CSceneManager *pScene, CSceneNode *pParent = 0, CModel *pModel = 0);
|
||||
explicit CModelNode(CScene *pScene, CSceneNode *pParent = 0, CModel *pModel = 0);
|
||||
|
||||
virtual ENodeType NodeType();
|
||||
virtual void AddToRenderer(CRenderer *pRenderer, const SViewInfo& ViewInfo);
|
||||
|
||||
@@ -8,7 +8,7 @@
|
||||
class CRootNode : public CSceneNode
|
||||
{
|
||||
public:
|
||||
explicit CRootNode(CSceneManager *pScene, CSceneNode *pParent = 0) : CSceneNode(pScene, pParent) {}
|
||||
explicit CRootNode(CScene *pScene, CSceneNode *pParent = 0) : CSceneNode(pScene, pParent) {}
|
||||
~CRootNode() {}
|
||||
|
||||
ENodeType NodeType() {
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
#include "CSceneManager.h"
|
||||
#include "CScene.h"
|
||||
#include "Core/Render/CGraphics.h"
|
||||
#include "Core/Resource/CResCache.h"
|
||||
#include "Core/Resource/Script/CScriptLayer.h"
|
||||
@@ -18,7 +18,7 @@
|
||||
* Advantage of this is that I don't need to write separate functions for every single node type
|
||||
* They can all be tracked together and the code could be streamlined a lot.
|
||||
*/
|
||||
CSceneManager::CSceneManager()
|
||||
CScene::CScene()
|
||||
{
|
||||
mSplitTerrain = true;
|
||||
mNodeCount = 0;
|
||||
@@ -28,12 +28,12 @@ CSceneManager::CSceneManager()
|
||||
mpAreaRootNode = nullptr;
|
||||
}
|
||||
|
||||
CSceneManager::~CSceneManager()
|
||||
CScene::~CScene()
|
||||
{
|
||||
ClearScene();
|
||||
}
|
||||
|
||||
CModelNode* CSceneManager::AddModel(CModel *m)
|
||||
CModelNode* CScene::AddModel(CModel *m)
|
||||
{
|
||||
if (m == nullptr) return nullptr;
|
||||
|
||||
@@ -43,7 +43,7 @@ CModelNode* CSceneManager::AddModel(CModel *m)
|
||||
return node;
|
||||
}
|
||||
|
||||
CStaticNode* CSceneManager::AddStaticModel(CStaticModel *mdl)
|
||||
CStaticNode* CScene::AddStaticModel(CStaticModel *mdl)
|
||||
{
|
||||
if (mdl == nullptr) return nullptr;
|
||||
|
||||
@@ -53,7 +53,7 @@ CStaticNode* CSceneManager::AddStaticModel(CStaticModel *mdl)
|
||||
return node;
|
||||
}
|
||||
|
||||
CCollisionNode* CSceneManager::AddCollision(CCollisionMeshGroup *mesh)
|
||||
CCollisionNode* CScene::AddCollision(CCollisionMeshGroup *mesh)
|
||||
{
|
||||
if (mesh == nullptr) return nullptr;
|
||||
|
||||
@@ -63,7 +63,7 @@ CCollisionNode* CSceneManager::AddCollision(CCollisionMeshGroup *mesh)
|
||||
return node;
|
||||
}
|
||||
|
||||
CScriptNode* CSceneManager::AddScriptObject(CScriptObject *obj)
|
||||
CScriptNode* CScene::AddScriptObject(CScriptObject *obj)
|
||||
{
|
||||
if (obj == nullptr) return nullptr;
|
||||
|
||||
@@ -73,7 +73,7 @@ CScriptNode* CSceneManager::AddScriptObject(CScriptObject *obj)
|
||||
return node;
|
||||
}
|
||||
|
||||
CLightNode* CSceneManager::AddLight(CLight *Light)
|
||||
CLightNode* CScene::AddLight(CLight *Light)
|
||||
{
|
||||
if (Light == nullptr) return nullptr;
|
||||
|
||||
@@ -83,7 +83,7 @@ CLightNode* CSceneManager::AddLight(CLight *Light)
|
||||
return node;
|
||||
}
|
||||
|
||||
void CSceneManager::SetActiveArea(CGameArea* _area)
|
||||
void CScene::SetActiveArea(CGameArea* _area)
|
||||
{
|
||||
// Clear existing area
|
||||
delete mpAreaRootNode;
|
||||
@@ -188,12 +188,12 @@ void CSceneManager::SetActiveArea(CGameArea* _area)
|
||||
std::cout << CSceneNode::NumNodes() << " nodes\n";
|
||||
}
|
||||
|
||||
void CSceneManager::SetActiveWorld(CWorld* _world)
|
||||
void CScene::SetActiveWorld(CWorld* _world)
|
||||
{
|
||||
mpWorld = _world;
|
||||
}
|
||||
|
||||
void CSceneManager::ClearScene()
|
||||
void CScene::ClearScene()
|
||||
{
|
||||
if (mpAreaRootNode)
|
||||
{
|
||||
@@ -212,7 +212,7 @@ void CSceneManager::ClearScene()
|
||||
mNodeCount = 0;
|
||||
}
|
||||
|
||||
void CSceneManager::AddSceneToRenderer(CRenderer *pRenderer, const SViewInfo& ViewInfo)
|
||||
void CScene::AddSceneToRenderer(CRenderer *pRenderer, const SViewInfo& ViewInfo)
|
||||
{
|
||||
FRenderOptions Options = pRenderer->RenderOptions();
|
||||
|
||||
@@ -249,7 +249,7 @@ void CSceneManager::AddSceneToRenderer(CRenderer *pRenderer, const SViewInfo& Vi
|
||||
}
|
||||
}
|
||||
|
||||
SRayIntersection CSceneManager::SceneRayCast(const CRay& Ray, const SViewInfo& ViewInfo)
|
||||
SRayIntersection CScene::SceneRayCast(const CRay& Ray, const SViewInfo& ViewInfo)
|
||||
{
|
||||
// Terribly hacky stuff to avoid having tons of redundant code
|
||||
// because I'm too lazy to rewrite CSceneManager right now and fix it
|
||||
@@ -295,7 +295,7 @@ SRayIntersection CSceneManager::SceneRayCast(const CRay& Ray, const SViewInfo& V
|
||||
return Tester.TestNodes(ViewInfo);
|
||||
}
|
||||
|
||||
void CSceneManager::PickEnvironmentObjects()
|
||||
void CScene::PickEnvironmentObjects()
|
||||
{
|
||||
// Pick AreaAttributes
|
||||
for (auto it = mAreaAttributesObjects.begin(); it != mAreaAttributesObjects.end(); it++)
|
||||
@@ -308,7 +308,7 @@ void CSceneManager::PickEnvironmentObjects()
|
||||
}
|
||||
}
|
||||
|
||||
CScriptNode* CSceneManager::ScriptNodeByID(u32 InstanceID)
|
||||
CScriptNode* CScene::ScriptNodeByID(u32 InstanceID)
|
||||
{
|
||||
auto it = mScriptNodeMap.find(InstanceID);
|
||||
|
||||
@@ -316,12 +316,12 @@ CScriptNode* CSceneManager::ScriptNodeByID(u32 InstanceID)
|
||||
else return nullptr;
|
||||
}
|
||||
|
||||
CScriptNode* CSceneManager::NodeForObject(CScriptObject *pObj)
|
||||
CScriptNode* CScene::NodeForObject(CScriptObject *pObj)
|
||||
{
|
||||
return ScriptNodeByID(pObj->InstanceID());
|
||||
}
|
||||
|
||||
CLightNode* CSceneManager::NodeForLight(CLight *pLight)
|
||||
CLightNode* CScene::NodeForLight(CLight *pLight)
|
||||
{
|
||||
// Slow. Is there a better way to do this?
|
||||
for (auto it = mLightNodes.begin(); it != mLightNodes.end(); it++)
|
||||
@@ -330,7 +330,7 @@ CLightNode* CSceneManager::NodeForLight(CLight *pLight)
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
CModel* CSceneManager::GetActiveSkybox()
|
||||
CModel* CScene::GetActiveSkybox()
|
||||
{
|
||||
if (mpActiveAreaAttributes)
|
||||
{
|
||||
@@ -347,7 +347,7 @@ CModel* CSceneManager::GetActiveSkybox()
|
||||
else return nullptr;
|
||||
}
|
||||
|
||||
CGameArea* CSceneManager::GetActiveArea()
|
||||
CGameArea* CScene::GetActiveArea()
|
||||
{
|
||||
return mpArea;
|
||||
}
|
||||
@@ -1,5 +1,5 @@
|
||||
#ifndef CSCENEMANAGER_h
|
||||
#define CSCENEMANAGER_h
|
||||
#ifndef CSCENE_H
|
||||
#define CSCENE_H
|
||||
|
||||
#include "CSceneNode.h"
|
||||
#include "CRootNode.h"
|
||||
@@ -19,7 +19,7 @@
|
||||
#include <unordered_map>
|
||||
#include <vector>
|
||||
|
||||
class CSceneManager
|
||||
class CScene
|
||||
{
|
||||
bool mSplitTerrain;
|
||||
|
||||
@@ -43,8 +43,8 @@ class CSceneManager
|
||||
std::unordered_map<u32, CScriptNode*> mScriptNodeMap;
|
||||
|
||||
public:
|
||||
CSceneManager();
|
||||
~CSceneManager();
|
||||
CScene();
|
||||
~CScene();
|
||||
|
||||
// Scene Management
|
||||
CModelNode* AddModel(CModel *mdl);
|
||||
@@ -67,4 +67,4 @@ public:
|
||||
CGameArea* GetActiveArea();
|
||||
};
|
||||
|
||||
#endif // CSCENEMANAGER_H
|
||||
#endif // CSCENE_H
|
||||
@@ -13,7 +13,7 @@
|
||||
u32 CSceneNode::smNumNodes = 0;
|
||||
CColor CSceneNode::skSelectionTint = CColor::Integral(39, 154, 167);
|
||||
|
||||
CSceneNode::CSceneNode(CSceneManager *pScene, CSceneNode *pParent)
|
||||
CSceneNode::CSceneNode(CScene *pScene, CSceneNode *pParent)
|
||||
{
|
||||
smNumNodes++;
|
||||
mpScene = pScene;
|
||||
@@ -322,7 +322,7 @@ CSceneNode* CSceneNode::Parent() const
|
||||
return mpParent;
|
||||
}
|
||||
|
||||
CSceneManager* CSceneNode::Scene() const
|
||||
CScene* CSceneNode::Scene() const
|
||||
{
|
||||
return mpScene;
|
||||
}
|
||||
|
||||
@@ -16,7 +16,7 @@
|
||||
#include <Math/ETransformSpace.h>
|
||||
|
||||
class CRenderer;
|
||||
class CSceneManager;
|
||||
class CScene;
|
||||
|
||||
class CSceneNode : public IRenderable
|
||||
{
|
||||
@@ -33,7 +33,7 @@ protected:
|
||||
static u32 smNumNodes;
|
||||
TString mName;
|
||||
CSceneNode *mpParent;
|
||||
CSceneManager *mpScene;
|
||||
CScene *mpScene;
|
||||
|
||||
CVector3f mPosition;
|
||||
CQuaternion mRotation;
|
||||
@@ -51,7 +51,7 @@ protected:
|
||||
CColor mAmbientColor;
|
||||
|
||||
public:
|
||||
explicit CSceneNode(CSceneManager *pScene, CSceneNode *pParent = 0);
|
||||
explicit CSceneNode(CScene *pScene, CSceneNode *pParent = 0);
|
||||
virtual ~CSceneNode();
|
||||
virtual ENodeType NodeType() = 0;
|
||||
virtual void AddToRenderer(CRenderer* /*pRenderer*/, const SViewInfo& /*ViewInfo*/) {}
|
||||
@@ -89,7 +89,7 @@ public:
|
||||
// Getters
|
||||
TString Name() const;
|
||||
CSceneNode* Parent() const;
|
||||
CSceneManager* Scene() const;
|
||||
CScene* Scene() const;
|
||||
CVector3f LocalPosition() const;
|
||||
CVector3f AbsolutePosition() const;
|
||||
CQuaternion LocalRotation() const;
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
#include "CScriptNode.h"
|
||||
#include "CSceneManager.h"
|
||||
#include "CScene.h"
|
||||
#include "Core/Render/CDrawUtil.h"
|
||||
#include "Core/Render/CGraphics.h"
|
||||
#include "Core/Render/CRenderer.h"
|
||||
@@ -10,7 +10,7 @@
|
||||
#include <Common/AnimUtil.h>
|
||||
#include <Math/MathUtil.h>
|
||||
|
||||
CScriptNode::CScriptNode(CSceneManager *pScene, CSceneNode *pParent, CScriptObject *pObject)
|
||||
CScriptNode::CScriptNode(CScene *pScene, CSceneNode *pParent, CScriptObject *pObject)
|
||||
: CSceneNode(pScene, pParent)
|
||||
{
|
||||
mpVolumePreviewNode = nullptr;
|
||||
|
||||
@@ -23,7 +23,7 @@ class CScriptNode : public CSceneNode
|
||||
CLightParameters *mpLightParameters;
|
||||
|
||||
public:
|
||||
CScriptNode(CSceneManager *pScene, CSceneNode *pParent = 0, CScriptObject *pObject = 0);
|
||||
CScriptNode(CScene *pScene, CSceneNode *pParent = 0, CScriptObject *pObject = 0);
|
||||
ENodeType NodeType();
|
||||
void AddToRenderer(CRenderer *pRenderer, const SViewInfo& ViewInfo);
|
||||
void Draw(FRenderOptions Options, int ComponentIndex, const SViewInfo& ViewInfo);
|
||||
|
||||
@@ -5,7 +5,7 @@
|
||||
#include <Common/AnimUtil.h>
|
||||
#include <Math/MathUtil.h>
|
||||
|
||||
CStaticNode::CStaticNode(CSceneManager *pScene, CSceneNode *pParent, CStaticModel *pModel)
|
||||
CStaticNode::CStaticNode(CScene *pScene, CSceneNode *pParent, CStaticModel *pModel)
|
||||
: CSceneNode(pScene, pParent)
|
||||
{
|
||||
mpModel = pModel;
|
||||
|
||||
@@ -9,7 +9,7 @@ class CStaticNode : public CSceneNode
|
||||
CStaticModel *mpModel;
|
||||
|
||||
public:
|
||||
CStaticNode(CSceneManager *pScene, CSceneNode *pParent = 0, CStaticModel *pModel = 0);
|
||||
CStaticNode(CScene *pScene, CSceneNode *pParent = 0, CStaticModel *pModel = 0);
|
||||
ENodeType NodeType();
|
||||
void AddToRenderer(CRenderer *pRenderer, const SViewInfo& ViewInfo);
|
||||
void Draw(FRenderOptions Options, int ComponentIndex, const SViewInfo& ViewInfo);
|
||||
|
||||
Reference in New Issue
Block a user