Aether3D Game Engine
Public Member Functions | List of all members
Scene Class Referenceabstract

Stores scene in a scene graph. More...

#include <Scene.hpp>

Public Member Functions

virtual ~Scene ()
 
virtual void Add (Camera *camera)=0
 
virtual void Add (Light *light)=0
 
virtual void Add (Model *model)=0
 
virtual void Remove (SceneGraphNode *node)=0
 
virtual CameraGetNonRTCamera ()=0
 
virtual MaterialGetMaterial (const char *name)=0
 
virtual ModelGetModel (const char *name)=0
 
virtual std::list< std::pair< Model *, std::list< std::string > > > GetColliders (int screenX, int screenY, CollisionTest collisionTest, float maxDepth) const =0
 
virtual std::list< std::pair< Model *, std::list< std::string > > > GetColliders (const Vec3 &aabbMin, const Vec3 &aabbMax, CollisionTest collisionTest) const =0
 
virtual bool LoadFromFile (const std::string &path)=0
 
virtual bool SaveToFile (const char *path)=0
 
virtual SceneGraphNodeRootNode ()=0
 
virtual void SetSkybox (const Texture *cubeMap)=0
 
virtual void OnNodeAdded (SceneGraphNode *node)=0
 

Detailed Description

Stores scene in a scene graph.

Constructor & Destructor Documentation

virtual Scene::~Scene ( )
inlinevirtual

Destructor.

Member Function Documentation

virtual void Scene::Add ( Camera camera)
pure virtual
Parameters
cameraCamera.
virtual void Scene::Add ( Light light)
pure virtual
Parameters
lightLight.
virtual void Scene::Add ( Model model)
pure virtual
Parameters
modelModel.
virtual std::list< std::pair< Model*, std::list< std::string > > > Scene::GetColliders ( int  screenX,
int  screenY,
CollisionTest  collisionTest,
float  maxDepth 
) const
pure virtual

Gets colliders for a ray shot through a screen point. The first object's first mesh is the closest.

Parameters
screenXScreen x coordinate in pixels.
screenYScreen y coordinate in pixels.
collisionTestCollision test to perform.
maxDepthMaximum depth where collisions are tested.
Returns
List of (Model, collided mesh names)
virtual std::list< std::pair< Model*, std::list< std::string > > > Scene::GetColliders ( const Vec3 aabbMin,
const Vec3 aabbMax,
CollisionTest  collisionTest 
) const
pure virtual

Gets colliders for an AABB. Note that collision with a model's AABB does not necessarily mean that any of the meshes were included in the collision.

Parameters
aabbMinAABB's min value in world-space.
aabbMaxAABB's max value in world-space.
collisionTestCollision test to perform.
Returns
List of (Model, collided mesh names)
virtual Material* Scene::GetMaterial ( const char *  name)
pure virtual

Finds a material that was loaded from a .scene file.

Parameters
nameMaterial's name.
Returns
Material or null if Scene does not contain a Material named name.
virtual Model* Scene::GetModel ( const char *  name)
pure virtual

Finds a model.

Parameters
nameModel's name.
Returns
Model or null if Scene does not contain a Model named name.
virtual Camera* Scene::GetNonRTCamera ( )
pure virtual
Returns
The camera that is not set to render into a texture or nullptr if there is no such camera.
virtual bool Scene::LoadFromFile ( const std::string &  path)
pure virtual

Loads a scene from a text file. Does not empty current scene contents.

Parameters
path.scene file.
Returns
True on success, false on failure. Failure reason is printed into console.
virtual void Scene::OnNodeAdded ( SceneGraphNode node)
pure virtual

Called automatically when a node is added into scene to update Scene's internal representation.

Parameters
nodeNode.
virtual void Scene::Remove ( SceneGraphNode node)
pure virtual
Parameters
nodeNode to be removed from the scene graph.
virtual SceneGraphNode& Scene::RootNode ( )
pure virtual
Returns
Root node.
virtual bool Scene::SaveToFile ( const char *  path)
pure virtual

Saves the scene into an ascii file.

Parameters
path.scene file.
Returns
True, if succeeded, false otherwise.
virtual void Scene::SetSkybox ( const Texture cubeMap)
pure virtual
Parameters
cubeMapCube map that's used for skybox cube mesh.

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