The space in which gameobjects exist. More...
#include <Scene.h>
Inherited by NullScene.
Detailed Description
The space in which gameobjects exist.
The scene object is where the user puts together GameObjects and other classes to form levels. The scene class takes care of updating all GameObjects that are registered within their specified managers.
When deriving a new scene, the user must implement the two pure virtual functions:
- Initialize(): Code to be called upon initialization of the scene.
- SceneEnd(): Code to be called upon the end of the scene.
The scene class also allows access to setting/getting the current camera and registering collision pairs.
Public Member Functions | |
virtual void | Initialize ()=0 |
Function to be called upon initialization of the scene. More... | |
virtual void | SceneEnd ()=0 |
Function to be called upon the end of the scene. More... | |
Camera * | GetCamera3D () |
Function to get the current scene's camera. More... | |
Camera * | GetCamera2D () |
Function to get the current scene's 2D camera. More... | |
void | SetCamera (IonCamera *cam) |
Function to set the current scene's IonCamera. More... | |
void | SetTerrain (const char *Terrain_Asset_Key) |
Function to set the current scene's Terrain. More... | |
Terrain * | GetCurTerrain () |
Function to get the current scene's Terrain. More... | |
void | SetSkyBox (const char *Sky_Asset_Key) |
Function to set the current scene's SkyBox. More... | |
Protected Member Functions | |
template<typename C1 , typename C2 > | |
void | SetCollisionPair () |
Registers two Collidable class types to test for collision. | |
template<typename C > | |
void | SetCollisionSelf () |
Registers Collidable class type to test for collision with itself. | |
template<typename C > | |
void | SetCollisionTerrain () |
Registers Collidable class type to test for collision with Terrain. | |
Member Function Documentation
|
inline |
Function to get the current scene's 2D camera.
- Returns
- Pointer to camera object.
|
inline |
Function to get the current scene's camera.
- Returns
- Pointer to camera object.
Terrain* Scene::GetCurTerrain | ( | ) |
|
pure virtual |
Function to be called upon initialization of the scene.
This function is a pure virtual function to be overriden by the user. Code within this function will be called upon the initialization of this scene. Therefore, construction and registration of objects for the scene should be placed here.
|
pure virtual |
Function to be called upon the end of the scene.
This function is a pure virtual function to be overriden by the user. Code within this function will be called upon the end of this scene. Therefore, destruction and deregistration of objects for the scene should be placed here.
|
inline |
void Scene::SetSkyBox | ( | const char * | Sky_Asset_Key | ) |
Function to set the current scene's SkyBox.
This function sets the current scene's skybox based off a key stored in SkyBoxAssets. If no skybox is set then the scene's skybox is Null.
- Parameters
-
Sky_Asset_Key const char pointer for key stored in SkyBoxAssets.
void Scene::SetTerrain | ( | const char * | Terrain_Asset_Key | ) |
Function to set the current scene's Terrain.
This function sets the current scene's terrain based off a key stored in TerrainAssets. If no Terrain is set then the scene's terrain is Null.
- Parameters
-
Terrain_Asset_Key const char pointer for key stored in TerrainAssets.