Files
OpenSpace/include/openspace/flare/flare.h
Jonas Strandstedt 472869e1db Fix for Flare
- Fixed timestep error in Flare
- Added option to compile openspace with Flare only
2014-05-22 12:57:54 -04:00

93 lines
3.4 KiB
C++

/*****************************************************************************************
* *
* OpenSpace *
* *
* Copyright (c) 2014 *
* *
* Permission is hereby granted, free of charge, to any person obtaining a copy of this *
* software and associated documentation files (the "Software"), to deal in the Software *
* without restriction, including without limitation the rights to use, copy, modify, *
* merge, publish, distribute, sublicense, and/or sell copies of the Software, and to *
* permit persons to whom the Software is furnished to do so, subject to the following *
* conditions: *
* *
* The above copyright notice and this permission notice shall be included in all copies *
* or substantial portions of the Software. *
* *
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, *
* INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A *
* PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT *
* HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF *
* CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE *
* OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. *
****************************************************************************************/
#ifndef __FLARE_H__
#define __FLARE_H__
#include <GL/glew.h>
#include <ghoul/logging/logmanager.h>
#define SGCT_WINDOWS_INCLUDE
#include <sgct.h>
#include <openspace/flare/Animator.h>
#include <openspace/flare/Raycaster.h>
#include <openspace/flare/Config.h>
#include <openspace/rendering/renderable.h>
namespace openspace {
class Flare: public Renderable {
public:
Flare();
~Flare();
bool initialize();
bool deinitialize();
virtual void render(const Camera *camera, const psc& thisPosition);
virtual void update();
void render();
void initNavigation();
void keyboard(int key, int action);
void mouse(int button, int action);
void preSync();
void postSyncPreDraw();
void postDraw();
void encode();
void decode();
private:
void init();
osp::Config* _config;
osp::Raycaster* _raycaster;
osp::Animator* _animator;
sgct::SharedInt _timeStep;
sgct::SharedBool _animationPaused;
sgct::SharedBool _fpsMode;
sgct::SharedFloat _elapsedTime;
sgct::SharedInt _manualTimestep;
sgct::SharedFloat _pitch;
sgct::SharedFloat _yaw;
sgct::SharedFloat _roll;
sgct::SharedFloat _translateX;
sgct::SharedFloat _translateY;
sgct::SharedFloat _translateZ;
sgct::SharedBool _reloadFlag;
float _oldTime;
float _currentTime;
bool _leftMouseButton;
double _currentMouseX;
double _currentMouseY;
double _lastMouseX;
double _lastMouseY;
};
} // namespace openspace
#endif // __FLARE_H__