#include <SceneLoader.h>
Public Member Functions | |
SceneLoader (std::string scenePath, MaterialLoader *mats=0) | |
virtual | ~SceneLoader () |
Scene * | getScene () |
Camera * | getCamera () |
bool | goToFrame (const int &n) |
bool | nextFrame () |
const std::vector < ObjectLoader * > & | getObjectLoaders () |
Private Member Functions | |
void | init () |
void | initCameras () |
void | initObjects () |
void | initLights () |
Private Attributes | |
Scene | scene |
MaterialLoader * | materials |
std::vector < Traceable * > | traceables |
std::vector < ObjectLoader * > | objects |
std::vector < LightLoader * > | lights |
std::vector < CameraLoader * > | cameras |
bool | initialised |
bool | addedTraceables |
Definition at line 20 of file SceneLoader.h.
rcrt::SceneLoader::SceneLoader | ( | std::string | scenePath, | |
MaterialLoader * | mats = 0 | |||
) |
Definition at line 8 of file SceneLoader.cpp.
rcrt::SceneLoader::~SceneLoader | ( | ) | [virtual] |
Definition at line 13 of file SceneLoader.cpp.
void rcrt::SceneLoader::init | ( | ) | [private] |
Definition at line 17 of file SceneLoader.cpp.
References initCameras(), initialised, initLights(), initObjects(), rcrt::XMLLoader::nextStartTag(), rcrt::XMLLoader::parser, scene, and rcrt::Scene::setName().
Referenced by goToFrame(), and nextFrame().
void rcrt::SceneLoader::initCameras | ( | ) | [private] |
Definition at line 31 of file SceneLoader.cpp.
References cameras, rcrt::XMLLoader::nextStartTag(), and rcrt::XMLLoader::parser.
Referenced by init().
void rcrt::SceneLoader::initObjects | ( | ) | [private] |
Definition at line 50 of file SceneLoader.cpp.
References materials, rcrt::XMLLoader::nextStartTag(), objects, and rcrt::XMLLoader::parser.
Referenced by init().
void rcrt::SceneLoader::initLights | ( | ) | [private] |
Definition at line 66 of file SceneLoader.cpp.
References lights, rcrt::XMLLoader::nextStartTag(), and rcrt::XMLLoader::parser.
Referenced by init().
Scene * rcrt::SceneLoader::getScene | ( | ) |
Definition at line 81 of file SceneLoader.cpp.
References scene.
Referenced by rcrt::AnimLoader::getScene(), and testLoaders().
Camera * rcrt::SceneLoader::getCamera | ( | ) |
Definition at line 86 of file SceneLoader.cpp.
References cameras.
Referenced by rcrt::AnimLoader::getCamera(), and testLoaders().
bool rcrt::SceneLoader::goToFrame | ( | const int & | n | ) | [virtual] |
Loads info of frame n.
Implements rcrt::XMLLoader.
Definition at line 129 of file SceneLoader.cpp.
References addedTraceables, rcrt::Scene::addLight(), cameras, rcrt::XMLLoader::currentFrame, rcrt::Light::getObject(), init(), initialised, lights, objects, scene, rcrt::Scene::setTraceables(), and traceables.
Referenced by rcrt::AnimLoader::goToFrame().
bool rcrt::SceneLoader::nextFrame | ( | ) | [virtual] |
Loads info from next frame. If on starting tag of frame, load this one, else go to next frame starting tag and load from that.
Implements rcrt::XMLLoader.
Definition at line 96 of file SceneLoader.cpp.
References addedTraceables, rcrt::Scene::addLight(), cameras, rcrt::XMLLoader::currentFrame, rcrt::Light::getObject(), init(), initialised, lights, objects, scene, rcrt::Scene::setTraceables(), and traceables.
Referenced by rcrt::AnimLoader::nextFrame().
const vector< ObjectLoader * > & rcrt::SceneLoader::getObjectLoaders | ( | ) |
Scene rcrt::SceneLoader::scene [private] |
Definition at line 23 of file SceneLoader.h.
Referenced by getScene(), goToFrame(), init(), and nextFrame().
MaterialLoader* rcrt::SceneLoader::materials [private] |
std::vector<Traceable*> rcrt::SceneLoader::traceables [private] |
std::vector<ObjectLoader*> rcrt::SceneLoader::objects [private] |
Definition at line 26 of file SceneLoader.h.
Referenced by getObjectLoaders(), goToFrame(), initObjects(), and nextFrame().
std::vector<LightLoader*> rcrt::SceneLoader::lights [private] |
Definition at line 27 of file SceneLoader.h.
Referenced by goToFrame(), initLights(), and nextFrame().
std::vector<CameraLoader*> rcrt::SceneLoader::cameras [private] |
Definition at line 28 of file SceneLoader.h.
Referenced by getCamera(), goToFrame(), initCameras(), and nextFrame().
bool rcrt::SceneLoader::initialised [private] |
bool rcrt::SceneLoader::addedTraceables [private] |