Annwvyn::AnnSplashLevel Class Reference

"Level" that display an image on a giant plane, then switchToLevel to another level after a timeout More...

#include <AnnSplashLevel.hpp>

Inheritance diagram for Annwvyn::AnnSplashLevel:
Collaboration diagram for Annwvyn::AnnSplashLevel:

Public Member Functions

 AnnSplashLevel (Ogre::String splashTexture, std::shared_ptr< AnnLevel > nextLevel=nullptr, float timeoutTime=10)
 
void load () override
 Load the level. This create a manual material and a manual object to present the splash image. More...
 
void runLogic () override
 Run the logic of the splash screen. This will check for the time and switchToLevel to next level if timeout. More...
 
void unload () override
 Clean up the manually allocated object. More...
 
void setBGM (std::string name, bool preload=true)
 Set the background music. More...
 
void setNextLevel (std::shared_ptr< AnnLevel > level)
 Set the level to switchToLevel to after timeout. More...
 
void setTimeout (float time)
 Set timeout time in seconds. More...
 
void setTimeoutMillisec (unsigned time)
 Set timeout time in milliseconds. More...
 
- Public Member Functions inherited from Annwvyn::AnnLevel
 AnnLevel ()
 Construct the level. More...
 
virtual ~AnnLevel ()
 Destroy the level. More...
 
AnnGameObjectListgetContent ()
 Get the list of objects. More...
 
AnnLightListgetLights ()
 Get the list of lights. More...
 
AnnTriggerObjectListgetTriggers ()
 Get the list of triggers. More...
 

Private Member Functions

void createSplashCurvedPlane ()
 Create the plane where the splash will go. More...
 
std::vector< AnnVect3createCurvedPlaneVertices (float curvature, float width, float height, float definition)
 
Ogre::HlmsUnlitDatablock * createSplashDatablock (Ogre::HlmsUnlit *unlit)
 

Private Attributes

float timeout
 Time values. More...
 
float currentTime
 
float startTime
 
std::weak_ptr< AnnLevelnext
 Pointer to the next level to load. More...
 
Ogre::ManualObject * CurvedPlane
 The plane that present the object. More...
 
Ogre::SceneNode * Splash
 Node where the splash screen is attached. More...
 
Ogre::String splashImageName
 Name of the image of the splash-screen. More...
 
bool hasBGM
 True if music is set. More...
 
std::string bgmName
 Path to the file that is loaded as an audio buffer. More...
 

Additional Inherited Members

- Protected Member Functions inherited from Annwvyn::AnnLevel
std::shared_ptr< AnnLightObjectaddLightObject (std::string id="")
 Add a light object to the level. More...
 
std::shared_ptr< AnnTriggerObjectaddTrggerObject (std::string id="")
 Add a trigger object to the level. More...
 
std::shared_ptr< AnnGameObjectaddGameObject (std::string entityName, std::string name="")
 Add a Game object to the level. More...
 
void addManualMovableObject (std::shared_ptr< AnnAbstractMovable > movable)
 Add a manual movable object. More...
 
template<class AbstractMovableType , class... Args>
decltype(auto) addManualMovableObject (Args &&... args)
 Construct+add a manual movable object. More...
 
- Protected Attributes inherited from Annwvyn::AnnLevel
AnnGameObjectList levelContent
 
AnnLightList levelLighting
 
AnnTriggerObjectList levelTrigger
 
std::vector< std::shared_ptr< AnnAbstractMovable > > levelMovable
 List of movable on the level. More...
 
std::string name
 Name of the level. More...
 

Detailed Description

"Level" that display an image on a giant plane, then switchToLevel to another level after a timeout

Definition at line 16 of file AnnSplashLevel.hpp.

Constructor & Destructor Documentation

◆ AnnSplashLevel()

AnnSplashLevel::AnnSplashLevel ( Ogre::String  splashTexture,
std::shared_ptr< AnnLevel nextLevel = nullptr,
float  timeoutTime = 10 
)

Construct a SplashLevel.

Parameters
splashTextureName of the resource (image) to put in front of the player

Definition at line 13 of file AnnSplashLevel.cpp.

Member Function Documentation

◆ createCurvedPlaneVertices()

std::vector< AnnVect3 > AnnSplashLevel::createCurvedPlaneVertices ( float  curvature,
float  width,
float  height,
float  definition 
)
private

Create and return the list of points to describe the wanted "curved" plane. Pivot is plane center

Parameters
curvatureThe curve is parabolic. The equation that define each Z point is [Z = - (1/curvature) * X^2] (higher values makes plane flatter)
widththe Width of the plane
heightthe Height of the plane
definitionThe number of points used to describe the plane in the X axis. Higher values makes smoother planes.

Definition at line 24 of file AnnSplashLevel.cpp.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ createSplashCurvedPlane()

void AnnSplashLevel::createSplashCurvedPlane ( )
private

Create the plane where the splash will go.

Definition at line 59 of file AnnSplashLevel.cpp.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ createSplashDatablock()

Ogre::HlmsUnlitDatablock * AnnSplashLevel::createSplashDatablock ( Ogre::HlmsUnlit *  unlit)
private

Create the hlms unlit datablock.

Parameters
unlitpointer to the HlmsUnlit object

Definition at line 90 of file AnnSplashLevel.cpp.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ load()

void AnnSplashLevel::load ( )
overridevirtual

Load the level. This create a manual material and a manual object to present the splash image.

Implements Annwvyn::AnnLevel.

Definition at line 105 of file AnnSplashLevel.cpp.

Here is the call graph for this function:

◆ runLogic()

void AnnSplashLevel::runLogic ( )
overridevirtual

Run the logic of the splash screen. This will check for the time and switchToLevel to next level if timeout.

Implements Annwvyn::AnnLevel.

Definition at line 147 of file AnnSplashLevel.cpp.

Here is the call graph for this function:

◆ setBGM()

void AnnSplashLevel::setBGM ( std::string  name,
bool  preload = true 
)

Set the background music.

Definition at line 140 of file AnnSplashLevel.cpp.

Here is the call graph for this function:

◆ setNextLevel()

void AnnSplashLevel::setNextLevel ( std::shared_ptr< AnnLevel level)

Set the level to switchToLevel to after timeout.

Definition at line 198 of file AnnSplashLevel.cpp.

◆ setTimeout()

void AnnSplashLevel::setTimeout ( float  time)

Set timeout time in seconds.

Definition at line 203 of file AnnSplashLevel.cpp.

◆ setTimeoutMillisec()

void AnnSplashLevel::setTimeoutMillisec ( unsigned  time)

Set timeout time in milliseconds.

Definition at line 208 of file AnnSplashLevel.cpp.

◆ unload()

void AnnSplashLevel::unload ( )
overridevirtual

Clean up the manually allocated object.

Reimplemented from Annwvyn::AnnLevel.

Definition at line 182 of file AnnSplashLevel.cpp.

Here is the call graph for this function:

Member Data Documentation

◆ bgmName

std::string Annwvyn::AnnSplashLevel::bgmName
private

Path to the file that is loaded as an audio buffer.

Definition at line 78 of file AnnSplashLevel.hpp.

◆ currentTime

float Annwvyn::AnnSplashLevel::currentTime
private

Definition at line 60 of file AnnSplashLevel.hpp.

◆ CurvedPlane

Ogre::ManualObject* Annwvyn::AnnSplashLevel::CurvedPlane
private

The plane that present the object.

Definition at line 66 of file AnnSplashLevel.hpp.

◆ hasBGM

bool Annwvyn::AnnSplashLevel::hasBGM
private

True if music is set.

Definition at line 75 of file AnnSplashLevel.hpp.

◆ next

std::weak_ptr<AnnLevel> Annwvyn::AnnSplashLevel::next
private

Pointer to the next level to load.

Definition at line 63 of file AnnSplashLevel.hpp.

◆ Splash

Ogre::SceneNode* Annwvyn::AnnSplashLevel::Splash
private

Node where the splash screen is attached.

Definition at line 69 of file AnnSplashLevel.hpp.

◆ splashImageName

Ogre::String Annwvyn::AnnSplashLevel::splashImageName
private

Name of the image of the splash-screen.

Definition at line 72 of file AnnSplashLevel.hpp.

◆ startTime

float Annwvyn::AnnSplashLevel::startTime
private

Definition at line 60 of file AnnSplashLevel.hpp.

◆ timeout

float Annwvyn::AnnSplashLevel::timeout
private

Time values.

Definition at line 60 of file AnnSplashLevel.hpp.


The documentation for this class was generated from the following files: