-
Notifications
You must be signed in to change notification settings - Fork 20
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
7323f4f
commit 2ebe1c0
Showing
21 changed files
with
231 additions
and
152 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -6,7 +6,6 @@ | |
#pragma region | ||
|
||
#include "light\light.hpp" | ||
#include "memory\allocation.hpp" | ||
|
||
#pragma endregion | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -6,7 +6,6 @@ | |
#pragma region | ||
|
||
#include "light\light.hpp" | ||
#include "memory\allocation.hpp" | ||
|
||
#pragma endregion | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,77 @@ | ||
#pragma once | ||
|
||
//----------------------------------------------------------------------------- | ||
// Engine Includes | ||
//----------------------------------------------------------------------------- | ||
#pragma region | ||
|
||
#include "math\transform.hpp" | ||
#include "collection\collection.hpp" | ||
|
||
#pragma endregion | ||
|
||
//----------------------------------------------------------------------------- | ||
// Engine Declarations and Definitions | ||
//----------------------------------------------------------------------------- | ||
namespace mage { | ||
|
||
struct TransformGroup final { | ||
|
||
public: | ||
|
||
//--------------------------------------------------------------------- | ||
// Constructors and Destructors | ||
//--------------------------------------------------------------------- | ||
|
||
TransformGroup() = default; | ||
TransformGroup(Transform *transform) | ||
: TransformGroup() { | ||
AddTransform(transform); | ||
} | ||
TransformGroup(const TransformGroup &transform_group) = default; | ||
TransformGroup(TransformGroup &&transform_group) = default; | ||
~TransformGroup() { | ||
m_transforms.clear(); | ||
m_transform_groups.clear(); | ||
} | ||
|
||
//--------------------------------------------------------------------- | ||
// Assignment Operators | ||
//--------------------------------------------------------------------- | ||
|
||
TransformGroup &operator=(const TransformGroup &transform_group) = delete; | ||
TransformGroup &operator=(TransformGroup &&transform_group) = delete; | ||
|
||
//--------------------------------------------------------------------- | ||
// Member Methods | ||
//--------------------------------------------------------------------- | ||
|
||
void AddTransform(Transform *transform) { | ||
m_transforms.push_back(transform); | ||
} | ||
void AddTransform(const TransformGroup &transform) { | ||
m_transform_groups.push_back(transform); | ||
} | ||
|
||
template< typename ActionT > | ||
void ForEachTransform(ActionT action) const; | ||
|
||
private: | ||
|
||
//--------------------------------------------------------------------- | ||
// Member Variables | ||
//--------------------------------------------------------------------- | ||
|
||
vector< Transform * > m_transforms; | ||
vector< TransformGroup > m_transform_groups; | ||
}; | ||
} | ||
|
||
//----------------------------------------------------------------------------- | ||
// Engine Includes | ||
//----------------------------------------------------------------------------- | ||
#pragma region | ||
|
||
#include "math\transform_group.tpp" | ||
|
||
#pragma endregion |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
#pragma once | ||
|
||
//----------------------------------------------------------------------------- | ||
// Engine Definitions | ||
//----------------------------------------------------------------------------- | ||
namespace mage { | ||
|
||
template< typename ActionT > | ||
inline void TransformGroup::ForEachTransform(ActionT action) const { | ||
|
||
for (vector< Transform * >::const_iterator it = m_transforms.cbegin(); it != m_transforms.cend(); ++it) { | ||
action(**it); | ||
} | ||
|
||
for (vector< TransformGroup >::const_iterator it = m_transform_groups.cbegin(); it != m_transform_groups.cend(); ++it) { | ||
it->ForEachTransform(action); | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.