Skip to content

Commit

Permalink
#80 Rename some module
Browse files Browse the repository at this point in the history
  • Loading branch information
ducphamhong committed Oct 23, 2021
1 parent 19256c4 commit 4e893a0
Show file tree
Hide file tree
Showing 11 changed files with 36 additions and 133 deletions.
3 changes: 0 additions & 3 deletions Projects/Editor/Source/Editor/CEditor.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,6 @@ This file is part of the "Skylicht Engine".

#include "SpaceController/CSceneController.h"
#include "SpaceController/CPropertyController.h"
#include "SpaceController/CCollisionController.h"

#include "AssetManager/CAssetManager.h"
#include "Selection/CSelection.h"
Expand Down Expand Up @@ -74,7 +73,6 @@ namespace Skylicht
m_spriteIcon->updateTexture();

// init controller
CCollisionController::createGetInstance();
CSceneController::createGetInstance()->initContextMenu(m_canvas);
CPropertyController::createGetInstance();
CSelection::createGetInstance();
Expand All @@ -87,7 +85,6 @@ namespace Skylicht
CEditorActivator::releaseInstance();
CPropertyController::releaseInstance();
CSceneController::releaseInstance();
CCollisionController::releaseInstance();
CSelection::releaseInstance();
CProjectSettings::releaseInstance();

Expand Down
7 changes: 3 additions & 4 deletions Projects/Editor/Source/Editor/Space/Scene/CSpaceScene.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,6 @@ This file is part of the "Skylicht Engine".
#include "Projective/CProjective.h"

#include "Editor/SpaceController/CSceneController.h"
#include "Editor/SpaceController/CCollisionController.h"

#include "Editor/Gizmos/Transform/CTransformGizmos.h"

Expand Down Expand Up @@ -63,7 +62,7 @@ namespace Skylicht
m_view(NULL),
m_handlesRenderer(NULL),
m_gizmosRenderer(NULL),
m_pickSystem(NULL),
m_selectObjectSystem(NULL),
m_enableRender(true)
{
initDefaultScene();
Expand Down Expand Up @@ -238,8 +237,8 @@ namespace Skylicht
// add handle renderer
CEntityManager* entityMgr = m_scene->getEntityManager();

m_pickSystem = entityMgr->addSystem<CPickCollisionSystem>();
m_pickSystem->setCullingCamera(m_editorCamera);
m_selectObjectSystem = entityMgr->addSystem<CSelectObjectSystem>();
m_selectObjectSystem->setCullingCamera(m_editorCamera);

m_handlesRenderer = entityMgr->addRenderSystem<CHandlesRenderer>();
m_gizmosRenderer = entityMgr->addRenderSystem<CGizmosRenderer>();
Expand Down
4 changes: 2 additions & 2 deletions Projects/Editor/Source/Editor/Space/Scene/CSpaceScene.h
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ This file is part of the "Skylicht Engine".
#include "Editor/History/CSceneHistory.h"
#include "EditorComponents/Handles/CHandlesRenderer.h"
#include "EditorComponents/Gizmos/CGizmosRenderer.h"
#include "EditorComponents/PickCollision/CPickCollisionSystem.h"
#include "EditorComponents/SelectObject/CSelectObjectSystem.h"

#include "CViewpointController.h"

Expand Down Expand Up @@ -85,7 +85,7 @@ namespace Skylicht
CHandlesRenderer* m_handlesRenderer;
CGizmosRenderer* m_gizmosRenderer;

CPickCollisionSystem* m_pickSystem;
CSelectObjectSystem* m_selectObjectSystem;

GUI::CButton* m_toolbarButton[ToolbarCount];

Expand Down

This file was deleted.

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,6 @@ This file is part of the "Skylicht Engine".

#include "CSceneController.h"
#include "CPropertyController.h"
#include "CCollisionController.h"

#include "Selection/CSelection.h"

Expand Down Expand Up @@ -140,7 +139,6 @@ namespace Skylicht
// clear current scene gui
CSelection::getInstance()->clear();
CPropertyController::getInstance()->setProperty(NULL);
CCollisionController::getInstance()->clear();

CHandles::getInstance()->end();
CHandles::getInstance()->setNullRenderer();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ This file is part of the "Skylicht Engine".
#include "Editor/CEditor.h"
#include "Handles/CHandles.h"

#include "Editor/SpaceController/CCollisionController.h"
#include "EditorComponents/SelectObject/CSelectObjectData.h"

namespace Skylicht
{
Expand Down Expand Up @@ -73,9 +73,10 @@ namespace Skylicht
// pick collision
CEntity* entity = m_gameObject->getEntity();
entity->addData<CWorldInverseTransformData>();
CPickCollisionData* pickData = entity->addData<CPickCollisionData>();
pickData->GameObject = m_gameObject;
pickData->BBox = m_defaultBBox;

CSelectObjectData* selectObject = entity->addData<CSelectObjectData>();
selectObject->GameObject = m_gameObject;
selectObject->BBox = m_defaultBBox;
}

void CGDirectionLight::updateComponent()
Expand All @@ -89,10 +90,9 @@ namespace Skylicht

// update collision bbox
float boxScale = m_sprite->getViewScale() * 10.0f;
CPickCollisionData* pickData = m_gameObject->getEntity()->getData<CPickCollisionData>();
pickData->GameObject = m_gameObject;
pickData->BBox.MinEdge = m_defaultBBox.MinEdge * boxScale;
pickData->BBox.MaxEdge = m_defaultBBox.MaxEdge * boxScale;
CSelectObjectData* selectObject = m_gameObject->getEntity()->getData<CSelectObjectData>();
selectObject->BBox.MinEdge = m_defaultBBox.MinEdge * boxScale;
selectObject->BBox.MaxEdge = m_defaultBBox.MaxEdge * boxScale;
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -23,18 +23,18 @@ This file is part of the "Skylicht Engine".
*/

#include "pch.h"
#include "CPickCollisionData.h"
#include "CSelectObjectData.h"

namespace Skylicht
{
namespace Editor
{
CPickCollisionData::CPickCollisionData()
CSelectObjectData::CSelectObjectData()
{

}

CPickCollisionData::~CPickCollisionData()
CSelectObjectData::~CSelectObjectData()
{
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,17 +31,17 @@ namespace Skylicht
{
namespace Editor
{
class CPickCollisionData : public IEntityData
class CSelectObjectData : public IEntityData
{
public:
CGameObject* GameObject;

core::aabbox3df BBox;

public:
CPickCollisionData();
CSelectObjectData();

virtual ~CPickCollisionData();
virtual ~CSelectObjectData();
};
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,7 @@ This file is part of the "Skylicht Engine".
*/

#include "pch.h"
#include "CPickCollisionSystem.h"
#include "Editor/SpaceController/CCollisionController.h"
#include "CSelectObjectSystem.h"

#include "Culling/CCullingData.h"
#include "Culling/CVisibleData.h"
Expand All @@ -35,18 +34,18 @@ namespace Skylicht
{
namespace Editor
{
CPickCollisionSystem::CPickCollisionSystem() :
CSelectObjectSystem::CSelectObjectSystem() :
m_cullingCamera(NULL)
{

}

CPickCollisionSystem::~CPickCollisionSystem()
CSelectObjectSystem::~CSelectObjectSystem()
{

}

void CPickCollisionSystem::beginQuery(CEntityManager* entityManager)
void CSelectObjectSystem::beginQuery(CEntityManager* entityManager)
{
if (entityManager->getCamera() != m_cullingCamera)
{
Expand All @@ -62,7 +61,7 @@ namespace Skylicht
m_skipUpdate = false;
}

void CPickCollisionSystem::onQuery(CEntityManager* entityManager, CEntity* entity)
void CSelectObjectSystem::onQuery(CEntityManager* entityManager, CEntity* entity)
{
if (m_skipUpdate)
return;
Expand All @@ -77,7 +76,7 @@ namespace Skylicht
if (visibleData != NULL && !visibleData->Visible)
return;

CPickCollisionData* collisionData = entity->getData<CPickCollisionData>();
CSelectObjectData* collisionData = entity->getData<CSelectObjectData>();
if (collisionData != NULL)
{
CWorldTransformData* transform = entity->getData<CWorldTransformData>();
Expand All @@ -89,17 +88,17 @@ namespace Skylicht
}
}

void CPickCollisionSystem::init(CEntityManager* entityManager)
void CSelectObjectSystem::init(CEntityManager* entityManager)
{

}

void CPickCollisionSystem::update(CEntityManager* entityManager)
void CSelectObjectSystem::update(CEntityManager* entityManager)
{
if (m_skipUpdate)
return;

CPickCollisionData** collisions = m_collision.pointer();
CSelectObjectData** collisions = m_collision.pointer();
CWorldTransformData** transforms = m_transform.pointer();
CWorldInverseTransformData** invTransforms = m_invTransform.pointer();

Expand All @@ -112,7 +111,7 @@ namespace Skylicht
{
CWorldTransformData* transform = transforms[i];
CWorldInverseTransformData* invTransform = invTransforms[i];
CPickCollisionData* collision = collisions[i];
CSelectObjectData* collision = collisions[i];

core::aabbox3df transformBBox = collision->BBox;
transform->World.transformBoxEx(transformBBox);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ This file is part of the "Skylicht Engine".
#include "Entity/IEntityData.h"
#include "Entity/IEntitySystem.h"

#include "CPickCollisionData.h"
#include "CSelectObjectData.h"
#include "Transform/CWorldTransformData.h"
#include "Transform/CWorldInverseTransformData.h"

Expand All @@ -37,12 +37,12 @@ namespace Skylicht
{
namespace Editor
{
class CPickCollisionSystem : public IEntitySystem
class CSelectObjectSystem : public IEntitySystem
{
protected:
core::array<CPickCollisionData*> m_results;
core::array<CSelectObjectData*> m_results;

core::array<CPickCollisionData*> m_collision;
core::array<CSelectObjectData*> m_collision;
core::array<CWorldTransformData*> m_transform;
core::array<CWorldInverseTransformData*> m_invTransform;

Expand All @@ -51,9 +51,9 @@ namespace Skylicht
bool m_skipUpdate;

public:
CPickCollisionSystem();
CSelectObjectSystem();

virtual ~CPickCollisionSystem();
virtual ~CSelectObjectSystem();

virtual void beginQuery(CEntityManager* entityManager);

Expand All @@ -68,7 +68,7 @@ namespace Skylicht
m_cullingCamera = camera;
}

inline core::array<CPickCollisionData*>& getCulledCollision()
inline core::array<CSelectObjectData*>& getCulledCollision()
{
return m_results;
}
Expand Down

0 comments on commit 4e893a0

Please sign in to comment.