-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
add comfortable object configuration
- Loading branch information
Showing
3 changed files
with
171 additions
and
0 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
#include "ObjectConfiguration.h" | ||
|
||
|
||
|
||
ObjectConfiguration::ObjectConfiguration() | ||
{ | ||
object = new ObjectConfigurationContextForObject; | ||
node = new ObjectConfigurationContextForNode; | ||
mesh = new ObjectConfigurationContextForMesh; | ||
materials = new ObjectConfigurationContextForMaterials; | ||
files = new ObjectConfigurationContextForFiles; | ||
} | ||
|
||
|
||
|
||
ObjectConfiguration::~ObjectConfiguration() | ||
{ | ||
// Niemals droppen, wenn Objekt nicht durch "create" erzeugt wurde! | ||
delete files; | ||
delete materials; | ||
delete mesh; | ||
delete node; | ||
delete object; | ||
} |
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,46 @@ | ||
/*! \file ObjectConfiguration.h | ||
* \brief Informationen zur Erstellung eines 3D-Objektes. | ||
*/ | ||
|
||
#ifndef _OBJECTCONFIGURATION_HEADER | ||
#define _OBJECTCONFIGURATION_HEADER | ||
|
||
#include <irrlicht.h> | ||
#include "ObjectConfigurationContext.hpp" | ||
|
||
using namespace irr; | ||
|
||
/*! \class ObjectConfiguration ObjectConfiguration.h "ObjectConfiguration.h" | ||
* \brief Informationen zur Erstellung eines 3D-Objektes. | ||
* \note Instanzierung: `ObjectConfiguration* myObjectConfiguration = new ObjectConfiguration();` | ||
* \n Benutzen: `myObjectConfiguration->node->name;` | ||
*/ | ||
class ObjectConfiguration | ||
{ | ||
|
||
public: | ||
|
||
ObjectConfigurationContextForObject* object; | ||
ObjectConfigurationContextForNode* node; | ||
ObjectConfigurationContextForMesh* mesh; | ||
ObjectConfigurationContextForMaterials* materials; | ||
ObjectConfigurationContextForFiles* files; | ||
|
||
/*! \brief Konstruktor. | ||
* \param - | ||
* \return Zeiger auf das instanzierte Klassenobjekt | ||
*/ | ||
ObjectConfiguration(); | ||
|
||
/*! \brief Destruktor | ||
*/ | ||
~ObjectConfiguration(); | ||
|
||
private: | ||
|
||
ObjectConfiguration( const ObjectConfiguration& ); | ||
ObjectConfiguration& operator=( const ObjectConfiguration& ); | ||
|
||
}; | ||
|
||
#endif |
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,101 @@ | ||
/*! \file ObjectConfigurationContext.h | ||
* \brief Untergruppen für ein Konfigurationsobjekt. | ||
*/ | ||
|
||
#ifndef _OBJECTCONFIGURATIONCONTEXT_HEADER | ||
#define _OBJECTCONFIGURATIONCONTEXT_HEADER | ||
|
||
#include <irrlicht.h> | ||
#include "Constants.h" | ||
|
||
using namespace irr; | ||
|
||
/*! \class ObjectConfigurationContextForObject ObjectConfigurationContextForObject.h "ObjectConfigurationContextForObject.h" | ||
* \brief High-Level-Informationen über das zu erstellende 3D-Object. | ||
*/ | ||
class ObjectConfigurationContextForObject | ||
{ | ||
|
||
public: | ||
|
||
enum ObjectType { | ||
DEKORATION, | ||
GESCHOSS, | ||
WETTER, | ||
HINDERNIS, | ||
INTERAKTIV, | ||
INVENTAR, | ||
LEBEWESEN, | ||
LEICHE, | ||
BEGEHBAR, | ||
MAUSPFEILREAKTIV | ||
}; // TODO auslagern nach Constants.h und ersetzen aller Vorkommen von `core::stringc type` | ||
|
||
ObjectType type; | ||
|
||
ObjectConfigurationContextForObject() : type(DEKORATION) {} | ||
|
||
}; | ||
|
||
/*! \class ObjectConfigurationContextForNode ObjectConfigurationContextForNode.h "ObjectConfigurationContextForNode.h" | ||
* \brief Informationen über den zu erstellenden Szenenknoten. | ||
*/ | ||
class ObjectConfigurationContextForNode | ||
{ | ||
|
||
public: | ||
|
||
core::stringc name; | ||
|
||
ObjectConfigurationContextForNode() : name("<noname>") {} | ||
|
||
}; | ||
|
||
/*! \class ObjectConfigurationContextForMesh ObjectConfigurationContextForMesh.h "ObjectConfigurationContextForMesh.h" | ||
* \brief Informationen über das zu erstellende Mesh. | ||
*/ | ||
class ObjectConfigurationContextForMesh | ||
{ | ||
|
||
public: | ||
|
||
core::vector3df position, offset, scale, rotation; | ||
|
||
ObjectConfigurationContextForMesh() | ||
: position(VEC_3DF_NULL), offset(VEC_3DF_NULL), scale(core::vector3df( 1.0f )), rotation(VEC_3DF_NULL) | ||
{} | ||
|
||
}; | ||
|
||
/*! \class ObjectConfigurationContextForMaterials ObjectConfigurationContextForMaterials.h "ObjectConfigurationContextForMaterials.h" | ||
* \brief Informationen über die Materialien des zu erstellenden 3D-Objects. | ||
*/ | ||
class ObjectConfigurationContextForMaterials | ||
{ | ||
|
||
public: | ||
|
||
core::array<bool> isTransparent, isBackFaceCulled; | ||
|
||
ObjectConfigurationContextForMaterials() { | ||
isTransparent.clear(); | ||
isBackFaceCulled.clear(); | ||
} | ||
|
||
}; | ||
|
||
/*! \class ObjectConfigurationContextForFiles ObjectConfigurationContextForFiles.h "ObjectConfigurationContextForFiles.h" | ||
* \brief Dateipfade des 3D-Objects. | ||
*/ | ||
class ObjectConfigurationContextForFiles | ||
{ | ||
|
||
public: | ||
|
||
io::path mesh; | ||
|
||
ObjectConfigurationContextForFiles() : mesh("") {} | ||
|
||
}; | ||
|
||
#endif |
9962550
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
belongs to #35