Orxonox
0.0.5 Codename: Arcturus
|
The SkyboxGenerator class is a singleton that allows for the creation of a skybox from a level by taking pictures to all 6 sides. More...
#include </home/jenkins/workspace/orxonox_doxygen_trunk/src/modules/designtools/SkyboxGenerator.h>
Public Member Functions | |
SkyboxGenerator () | |
Constructor. More... | |
virtual | ~SkyboxGenerator () |
Destructor. More... | |
void | setConfigValues (void) |
Sets some config values. More... | |
void | setSize (unsigned int size) |
Set the size of the skybox faces to be generated. More... | |
virtual void | tick (float dt) override |
This is where the skybox generation happens. More... | |
Public Member Functions inherited from orxonox::Configurable | |
Configurable () | |
void | setConfigValues () |
Function to collect the SetConfigValue-macro calls. More... | |
Public Member Functions inherited from orxonox::Listable | |
Listable () | |
Constructor: Allocates space in the element list. More... | |
Listable (Context *context) | |
Constructor: Allocates space in the element list and assigns the context. More... | |
virtual | ~Listable () |
Destructor: Removes the object from the object-lists. More... | |
Context * | getContext () const |
void | setContext (Context *context) |
Changes the context. More... | |
void | unregisterObject () |
Removes this object from the object-lists. More... | |
Public Member Functions inherited from orxonox::Identifiable | |
Identifiable () | |
Constructor: Sets the default values. More... | |
virtual | ~Identifiable () |
ORX_FORCEINLINE void * | getDerivedPointer (unsigned int classID) |
Returns a valid pointer of any derived type that is registered in the class hierarchy. More... | |
template<class T > | |
ORX_FORCEINLINE T * | getDerivedPointer (unsigned int classID) |
Version of getDerivedPointer with template. More... | |
template<class T > | |
ORX_FORCEINLINE const T * | getDerivedPointer (unsigned int classID) const |
Const version of getDerivedPointer with template. More... | |
Identifier * | getIdentifier () const |
Returns the Identifier of the object. More... | |
bool | isA (const Identifier *identifier) |
Returns true if the object's class is of the given type or a derivative. More... | |
template<class B > | |
bool | isA (const SubclassIdentifier< B > *identifier) |
Returns true if the object's class is of the given type or a derivative. More... | |
bool | isA (const Identifiable *object) |
Returns true if the object's class is of the given type or a derivative. More... | |
bool | isChildOf (const Identifier *identifier) |
Returns true if the object's class is a child of the given type. More... | |
template<class B > | |
bool | isChildOf (const SubclassIdentifier< B > *identifier) |
Returns true if the object's class is a child of the given type. More... | |
bool | isChildOf (const Identifiable *object) |
Returns true if the object's class is a child of the given type. More... | |
bool | isDirectChildOf (const Identifier *identifier) |
Returns true if the object's class is a direct child of the given type. More... | |
template<class B > | |
bool | isDirectChildOf (const SubclassIdentifier< B > *identifier) |
Returns true if the object's class is a direct child of the given type. More... | |
bool | isDirectChildOf (const Identifiable *object) |
Returns true if the object's class is a direct child of the given type. More... | |
bool | isDirectParentOf (const Identifier *identifier) |
Returns true if the object's class is a direct parent of the given type. More... | |
template<class B > | |
bool | isDirectParentOf (const SubclassIdentifier< B > *identifier) |
Returns true if the object's class is a direct parent of the given type. More... | |
bool | isDirectParentOf (const Identifiable *object) |
Returns true if the object's class is a direct child of the given type. More... | |
bool | isExactlyA (const Identifier *identifier) |
Returns true if the object's class is exactly of the given type. More... | |
template<class B > | |
bool | isExactlyA (const SubclassIdentifier< B > *identifier) |
Returns true if the object's class is exactly of the given type. More... | |
bool | isExactlyA (const Identifiable *object) |
Returns true if the object's class is exactly of the given type. More... | |
bool | isParentOf (const Identifier *identifier) |
Returns true if the object's class is a parent of the given type. More... | |
template<class B > | |
bool | isParentOf (const SubclassIdentifier< B > *identifier) |
Returns true if the object's class is a parent of the given type. More... | |
bool | isParentOf (const Identifiable *object) |
Returns true if the object's class is a parent of the given type. More... | |
Public Member Functions inherited from orxonox::OrxonoxInterface | |
OrxonoxInterface () | |
Public Member Functions inherited from orxonox::Destroyable | |
Destroyable () | |
Constructor: Sets the default values. More... | |
virtual | ~Destroyable () |
Destructor: Notifies all DestructionListener (for example weak pointers) that this object is being deleted. More... | |
void | destroy () |
Deletes the object if no strong pointers point to this object. More... | |
void | destroyLater () |
Works like destroy() but doesn't destroy the object until the current tick has ended. More... | |
unsigned int | getReferenceCount () const |
Returns the number of strong pointers that point to this object. More... | |
Static Public Member Functions | |
static void | createSkybox (void) |
Generate the 6 faces of a skybox. More... | |
Static Public Member Functions inherited from orxonox::Singleton< SkyboxGenerator > | |
static bool | exists () |
Tells whether the singleton has been created. More... | |
static SkyboxGenerator & | getInstance () |
Returns a reference to the singleton instance. More... | |
Protected Member Functions | |
void | startSkyboxGeneration (void) |
Starts the generation of the skybox. More... | |
Protected Member Functions inherited from orxonox::Singleton< SkyboxGenerator > | |
Singleton () | |
Constructor sets the singleton instance pointer. More... | |
virtual | ~Singleton () |
Destructor resets the singleton instance pointer. More... | |
Protected Member Functions inherited from orxonox::Tickable | |
Tickable () | |
Constructor: Registers the object in the Tickable-list. More... | |
Protected Member Functions inherited from orxonox::Destroyable | |
virtual void | preDestroy () |
This virtual function is called if destroy() is called and no StrongPtr points to this object. More... | |
Private Member Functions | |
void | restoreRenderWindow (Ogre::RenderWindow *renderWindow) |
Restore the render window. More... | |
void | saveImage (Ogre::Image *image, const std::string &name) const |
Resizes and saves the input image under the input name. More... | |
void | setupCamera (Ogre::Camera *camera) |
Set up the input camera to be ready to generate a skybox face. More... | |
void | setupRenderWindow (Ogre::RenderWindow *renderWindow) |
Setup the input render window to be ready to generate the skybox. More... | |
Private Attributes | |
float | aspectRatio_ |
The backed up aspect ratio of the camera. More... | |
bool | bCaptionsRemoved_ |
Whether the overlays have been removed. More... | |
bool | bCleanup_ |
Whether the generator is being cleaned up. More... | |
bool | bCreateFace_ |
Whether the faces are being created,. More... | |
bool | bGenerateSkybox_ |
Whether a skybox is currently being generated. More... | |
bool | bSetup_ |
Whether the render window is being setup. More... | |
bool | bWait_ |
Whether we have to wait for the setup to take effect. More... | |
unsigned int | faceCounter_ |
Counter to keep track of which skybox face is being created. More... | |
Ogre::Radian | fovy_ |
The backed up field of view of the camera. More... | |
unsigned int | gridSize_ |
The backed up grid size of the ScreenshotManager. More... | |
std::string | imageExtension_ |
Extension of the generated image files. More... | |
std::vector< std::string > | names_ |
The names of the image files for the skybox faces to be generated. More... | |
std::vector< std::pair< int, int > > | rotations_ |
The rotation in yaw an pitch direction that is applied to the camera after a specific face has been generated. More... | |
unsigned int | size_ |
The desired size of the skybox faces. More... | |
std::string | skyboxPrefix_ |
Prefix for the generated image files. More... | |
bool | windowFullScreen_ |
Whether the window was in fullscreen mode. More... | |
unsigned int | windowHeight_ |
The backed up window height. More... | |
unsigned int | windowWidth_ |
The backed up window width. More... | |
Static Private Attributes | |
static SkyboxGenerator * | singletonPtr_s |
Singleton pointer. More... | |
Friends | |
class | Singleton< SkyboxGenerator > |
The SkyboxGenerator class is a singleton that allows for the creation of a skybox from a level by taking pictures to all 6 sides.
The 6 images created by the createSkybox() method are placed in the log folder in your build directory.
The image filename prefix and the file extension can both be adjusted as config values, so can the desired size of the skybox faces.
orxonox::SkyboxGenerator::SkyboxGenerator | ( | ) |
Constructor.
Registers and initializes the singleton.
|
virtual |
Destructor.
|
private |
Restore the render window.
Reset the window size, reset the grid size of the ScreenshotManager.
renderWindow | The render window to be restored. |
|
private |
Resizes and saves the input image under the input name.
image | A pointer to the image to be saved. The image is deleted afterwards, |
name | The desired filename of the image. |
|
inline |
Set the size of the skybox faces to be generated.
size | The size in pixels. |
|
private |
Set up the input camera to be ready to generate a skybox face.
camera | The camera to be set up. |
|
private |
Setup the input render window to be ready to generate the skybox.
renderWindow | The render window to be set up. |
Starts the generation of the skybox.
|
overridevirtual |
This is where the skybox generation happens.
Generating a skybox takes several (up to 10) ticks.
Reimplemented from orxonox::Tickable.
|
friend |
|
private |
The backed up aspect ratio of the camera.
|
private |
Whether the overlays have been removed.
|
private |
Whether the generator is being cleaned up.
|
private |
Whether the faces are being created,.
|
private |
Whether a skybox is currently being generated.
|
private |
Whether the render window is being setup.
|
private |
Whether we have to wait for the setup to take effect.
|
private |
Counter to keep track of which skybox face is being created.
|
private |
The backed up field of view of the camera.
|
private |
The backed up grid size of the ScreenshotManager.
|
private |
Extension of the generated image files.
|
private |
The names of the image files for the skybox faces to be generated.
|
private |
The rotation in yaw an pitch direction that is applied to the camera after a specific face has been generated.
|
staticprivate |
Singleton pointer.
|
private |
The desired size of the skybox faces.
|
private |
Prefix for the generated image files.
|
private |
Whether the window was in fullscreen mode.
|
private |
The backed up window height.
|
private |
The backed up window width.