#include "SimpleAnimationScene.h" #include using namespace std; namespace X3DTK { SimpleAnimationScene::SimpleAnimationScene() : SimpleX3DGLScene(), _time(0.0f) { _glSimpleAnimator = Singleton::getInstance(); _translator = Singleton::getInstance(); } void SimpleAnimationScene::load(const char *file, bool fileValidation) { //Overloading the load method, to apply the WorldCoordTranslator processor to the scene. loadFile(file, fileValidation); _translator->translate(scene); computeBBox(); buildGLScene(); } void SimpleAnimationScene::init() { _time = 0.0f; if (scene != 0) _glSimpleAnimator->setBBoxSize(scene->getBBoxSize()); } void SimpleAnimationScene::animate() { _time += 0.03f; _glSimpleAnimator->animate(glscene, _time); } }