Blue Brain BioExplorer
Core.cpp
Go to the documentation of this file.
1 /*
2  *
3  * The Blue Brain BioExplorer is a tool for scientists to extract and analyse
4  * scientific data from visualization
5  *
6  * This file is part of Blue Brain BioExplorer <https://github.com/BlueBrain/BioExplorer>
7  *
8  * Copyright 2020-2024 Blue BrainProject / EPFL
9  *
10  * This program is free software: you can redistribute it and/or modify it under
11  * the terms of the GNU General Public License as published by the Free Software
12  * Foundation, either version 3 of the License, or (at your option) any later
13  * version.
14  *
15  * This program is distributed in the hope that it will be useful, but WITHOUT
16  * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
17  * FOR A PARTICULAR PURPOSE. See the GNU General Public License for more
18  * details.
19  *
20  * You should have received a copy of the GNU General Public License along with
21  * this program. If not, see <https://www.gnu.org/licenses/>.
22  */
23 
24 #include "Core.h"
25 #include "EngineFactory.h"
26 #include "PluginManager.h"
27 
28 #include <Defines.h>
29 
39 
46 
49 
51 
52 #if PLATFORM_USE_LIBARCHIVE
54 #endif
55 
56 #ifdef USE_ASSIMP
58 #endif
59 
62 
64 
65 #include <mutex>
66 #include <thread>
67 
68 namespace
69 {
70 const float DEFAULT_MOTION_ACCELERATION = 1.5f;
71 
72 const core::Vector3f DEFAULT_SUN_DIRECTION = {1.f, -1.f, -1.f};
73 const core::Vector3f DEFAULT_SUN_COLOR = {0.9f, 0.9f, 0.9f};
74 constexpr double DEFAULT_SUN_ANGULAR_DIAMETER = 0.53;
75 constexpr double DEFAULT_SUN_INTENSITY = 1.0;
76 } // namespace
77 
78 namespace core
79 {
80 struct Core::Impl : public PluginAPI
81 {
82  Impl(int argc, const char** argv)
83  : _parametersManager{argc, argv}
84  , _engineFactory{argc, argv, _parametersManager}
85  , _pluginManager{argc, argv}
86  {
87  CORE_INFO("");
88  CORE_INFO(" _|_|_| ");
89  CORE_INFO(" _| _|_| _| _|_| _|_| ");
90  CORE_INFO(" _| _| _| _|_| _|_|_|_|");
91  CORE_INFO(" _| _| _| _| _| ");
92  CORE_INFO(" _|_|_| _|_| _| _|_|_|");
93  CORE_INFO("");
94 
95  // This initialization must happen before plugin intialization.
96  _createEngine();
97  _registerKeyboardShortcuts();
98  _setupCameraManipulator(CameraMode::inspect, false);
99 
100  // Loaders before plugin init since 'Brain Atlas' uses the mesh loader
101  _registerLoaders();
102 
103  // Plugin init before frame buffer creation needed by OpenDeck plugin
104  _pluginManager.initPlugins(this);
105  _createFrameBuffer();
106 
107  _loadData();
108 
109  _engine->getScene().commit(); // Needed to obtain a bounding box
110  _cameraManipulator->adjust(_engine->getScene().getBounds());
111  }
112 
114  {
115  // make sure that plugin objects are removed first, as plugins are
116  // destroyed before the engine, but plugin destruction still should have
117  // a valid engine and _api (aka this object).
118  _engine->getScene().getLoaderRegistry().clear();
119  _pluginManager.destroyPlugins();
120  }
121 
122  bool commit()
123  {
124  std::unique_lock<std::mutex> lock{_renderMutex, std::defer_lock};
125  if (!lock.try_lock())
126  return false;
127 
128  _pluginManager.preRender();
129 
130  auto& scene = _engine->getScene();
131  auto& lightManager = scene.getLightManager();
132  auto& camera = _engine->getCamera();
133  auto& renderer = _engine->getRenderer();
134  const auto& rp = _parametersManager.getRenderingParameters();
135 
136  // Need to update head light before scene is committed
137  if (renderer.getHeadLight() && (camera.isModified() || rp.isModified()))
138  {
139  const auto newDirection = glm::rotate(camera.getOrientation(), Vector3d(0, 0, -1));
140  _sunLight->_direction = newDirection;
141  lightManager.addLight(_sunLight);
142  }
143 
144  scene.commit();
145 
146  _engine->getStatistics().setSceneSizeInBytes(scene.getSizeInBytes());
147 
148  _parametersManager.getAnimationParameters().update();
149 
150  const auto windowSize = _parametersManager.getApplicationParameters().getWindowSize();
151 
152  if (camera.hasProperty(CAMERA_PROPERTY_ASPECT_RATIO.name))
153  camera.updateProperty(CAMERA_PROPERTY_ASPECT_RATIO.name,
154  static_cast<double>(windowSize.x) / static_cast<double>(windowSize.y));
155 
156  for (auto frameBuffer : _frameBuffers)
157  frameBuffer->resize(windowSize);
158 
159  _engine->preRender();
160 
161  camera.commit();
162 
163  _engine->commit();
164 
165  if (_parametersManager.isAnyModified() || camera.isModified() || scene.isModified() || renderer.isModified() ||
166  lightManager.isModified())
167  _engine->clearFrameBuffers();
168 
169  _parametersManager.resetModified();
170  camera.resetModified();
171  scene.resetModified();
172  renderer.resetModified();
173  lightManager.resetModified();
174 
175  return true;
176  }
177 
178  void render()
179  {
180  std::lock_guard<std::mutex> lock{_renderMutex};
181 
182  _renderTimer.start();
183  _engine->render();
184  _renderTimer.stop();
185  _lastFPS = _renderTimer.perSecondSmoothed();
186 
187  const auto& params = _parametersManager.getApplicationParameters();
188  const auto fps = params.getMaxRenderFPS();
189  const auto delta = _lastFPS - fps;
190  if (delta > 0)
191  {
192  const int64_t targetTime = (1. / fps) * 1000.f;
193  std::this_thread::sleep_for(std::chrono::milliseconds(targetTime - _renderTimer.milliseconds()));
194  }
195  }
196 
197  void postRender(RenderOutput* output)
198  {
199  if (output)
200  _updateRenderOutput(*output);
201 
202  _engine->getStatistics().setFPS(_lastFPS);
203 
204  _pluginManager.postRender();
205 
206  _engine->postRender();
207 
208  _engine->resetFrameBuffers();
209  _engine->getStatistics().resetModified();
210  }
211 
212  bool commit(const RenderInput& renderInput)
213  {
214  _engine->getCamera().set(renderInput.position, renderInput.orientation, renderInput.target);
215  _parametersManager.getApplicationParameters().setWindowSize(renderInput.windowSize);
216 
217  return commit();
218  }
219 
220  void _updateRenderOutput(RenderOutput& renderOutput)
221  {
222  FrameBuffer& frameBuffer = _engine->getFrameBuffer();
223  frameBuffer.map();
224  const Vector2i& frameSize = frameBuffer.getSize();
225  const auto colorBuffer = frameBuffer.getColorBuffer();
226  if (colorBuffer)
227  {
228  const size_t size = frameSize.x * frameSize.y * frameBuffer.getColorDepth();
229  renderOutput.colorBuffer.assign(colorBuffer, colorBuffer + size);
230  renderOutput.colorBufferFormat = frameBuffer.getFrameBufferFormat();
231  }
232 
233  const auto floatBuffer = frameBuffer.getFloatBuffer();
234  if (floatBuffer)
235  {
236  size_t size = frameSize.x * frameSize.y;
238  size *= sizeof(float);
239  renderOutput.floatBuffer.assign(floatBuffer, floatBuffer + size);
240  }
241 
242  renderOutput.frameSize = frameSize;
243 
244  frameBuffer.unmap();
245  }
246 
247  Engine& getEngine() final { return *_engine; }
248  ParametersManager& getParametersManager() final { return _parametersManager; }
249  KeyboardHandler& getKeyboardHandler() final { return _keyboardHandler; }
250  AbstractManipulator& getCameraManipulator() final { return *_cameraManipulator; }
251  Camera& getCamera() final { return _engine->getCamera(); }
252  Renderer& getRenderer() final { return _engine->getRenderer(); }
253  void triggerRender() final { _engine->triggerRender(); }
254  ActionInterface* getActionInterface() final { return _actionInterface.get(); }
255  void setActionInterface(const ActionInterfacePtr& interface) final { _actionInterface = interface; }
256  Scene& getScene() final { return _engine->getScene(); }
257 
258 private:
259  void _createEngine()
260  {
261  auto engineName = _parametersManager.getApplicationParameters().getEngine();
262 
263  _engine = _engineFactory.create(engineName);
264 
265  // Default sun light
266  _sunLight = std::make_shared<DirectionalLight>(DEFAULT_SUN_DIRECTION, DEFAULT_SUN_ANGULAR_DIAMETER,
267  DEFAULT_SUN_COLOR, DEFAULT_SUN_INTENSITY, false);
268  _engine->getScene().getLightManager().addLight(_sunLight);
269 
270  _engine->getCamera().setCurrentType(_parametersManager.getRenderingParameters().getCurrentCamera());
271  }
272 
273  void _createFrameBuffer()
274  {
275  if (!_engine->getFrameBuffers().empty())
276  return;
277 
278  const auto& ap = _parametersManager.getApplicationParameters();
279  const auto names = ap.isStereo() ? strings{"0L", "0R"} : strings{DEFAULT};
280  for (const auto& name : names)
281  _addFrameBuffer(name);
282  }
283 
284  void _addFrameBuffer(const std::string& name)
285  {
286  const auto& ap = _parametersManager.getApplicationParameters();
287  const auto frameSize = ap.getWindowSize();
288 
289  auto frameBuffer = _engine->createFrameBuffer(name, frameSize, FrameBufferFormat::rgba_i8);
290  _engine->addFrameBuffer(frameBuffer);
291  _frameBuffers.push_back(frameBuffer);
292  }
293 
294  void _registerLoaders()
295  {
296  auto& registry = _engine->getScene().getLoaderRegistry();
297  auto& scene = _engine->getScene();
298 
299  auto params = _parametersManager.getGeometryParameters();
300 
301  registry.registerLoader(std::make_unique<RawVolumeLoader>(scene));
302  registry.registerLoader(std::make_unique<MHDVolumeLoader>(scene));
303  registry.registerLoader(std::make_unique<XYZBLoader>(scene));
304 #ifdef USE_ASSIMP
305  registry.registerLoader(std::make_unique<MeshLoader>(scene, params));
306 #endif
307 #if PLATFORM_USE_LIBARCHIVE
308  registry.registerArchiveLoader(std::make_unique<ArchiveLoader>(scene, registry));
309 #endif
310  }
311 
312  void _loadData()
313  {
314  auto& scene = _engine->getScene();
315  const auto& registry = scene.getLoaderRegistry();
316 
317  const auto& paths = _parametersManager.getApplicationParameters().getInputPaths();
318  if (!paths.empty())
319  {
320  if (paths.size() == 1 && paths[0] == "demo")
321  {
322  _engine->getScene().buildDefault();
323  return;
324  }
325 
326  for (const auto& path : paths)
327  if (!registry.isSupportedFile(path))
328  throw std::runtime_error("No loader found for '" + path + "'");
329 
330  for (const auto& path : paths)
331  {
332  int percentageLast = 0;
333  std::string msgLast;
334  auto timeLast = std::chrono::steady_clock::now();
335 
336  CORE_INFO("Loading '" << path << "'");
337 
338  auto progress = [&](const std::string& msg, float t)
339  {
340  constexpr auto MIN_SECS = 5;
341  constexpr auto MIN_PERCENTAGE = 10;
342 
343  t = std::max(0.f, std::min(t, 1.f));
344  const int percentage = static_cast<int>(100.0f * t);
345  const auto time = std::chrono::steady_clock::now();
346  const auto secondsElapsed =
347  std::chrono::duration_cast<std::chrono::seconds>(time - timeLast).count();
348  const auto percentageElapsed = percentage - percentageLast;
349 
350  if ((secondsElapsed >= MIN_SECS && percentageElapsed > 0) || msgLast != msg ||
351  (percentageElapsed >= MIN_PERCENTAGE))
352  {
353  std::string p = std::to_string(percentage);
354  p.insert(p.begin(), 3 - p.size(), ' ');
355 
356  CORE_INFO("[" << p << "%] " << msg);
357  msgLast = msg;
358  percentageLast = percentage;
359  timeLast = time;
360  }
361  };
362 
363  // No properties passed, use command line defaults.
364  ModelParams params(path, path, {});
365  scene.loadModel(path, params, {progress});
366  }
367  }
368  scene.setEnvironmentMap(_parametersManager.getApplicationParameters().getEnvMap());
369  scene.markModified();
370  }
371 
372  void _setupCameraManipulator(const CameraMode mode, const bool adjust = true)
373  {
374  _cameraManipulator.reset();
375 
376  switch (mode)
377  {
378  case CameraMode::flying:
379  _cameraManipulator.reset(new FlyingModeManipulator(_engine->getCamera(), _keyboardHandler));
380  break;
381  case CameraMode::inspect:
382  _cameraManipulator.reset(new InspectCenterManipulator(_engine->getCamera(), _keyboardHandler));
383  break;
384  };
385 
386  if (adjust)
387  _cameraManipulator->adjust(_engine->getScene().getBounds());
388  }
389 
390  void _registerKeyboardShortcuts()
391  {
392  _keyboardHandler.registerKeyboardShortcut('[', "Decrease animation frame by 1",
393  std::bind(&Core::Impl::_decreaseAnimationFrame, this));
394  _keyboardHandler.registerKeyboardShortcut(']', "Increase animation frame by 1",
395  std::bind(&Core::Impl::_increaseAnimationFrame, this));
396  _keyboardHandler.registerKeyboardShortcut('f', "Enable fly mode",
397  [this]()
398  { Core::Impl::_setupCameraManipulator(CameraMode::flying); });
399  _keyboardHandler.registerKeyboardShortcut('i', "Enable inspect mode",
400  [this]()
401  { Core::Impl::_setupCameraManipulator(CameraMode::inspect); });
402  _keyboardHandler.registerKeyboardShortcut('r', "Set animation frame to 0",
403  std::bind(&Core::Impl::_resetAnimationFrame, this));
404  _keyboardHandler.registerKeyboardShortcut('p', "Enable/Disable animation playback",
405  std::bind(&Core::Impl::_toggleAnimationPlayback, this));
406  _keyboardHandler.registerKeyboardShortcut(' ', "Camera reset to initial state",
407  std::bind(&Core::Impl::_resetCamera, this));
408  _keyboardHandler.registerKeyboardShortcut('+', "Increase motion speed",
409  std::bind(&Core::Impl::_increaseMotionSpeed, this));
410  _keyboardHandler.registerKeyboardShortcut('-', "Decrease motion speed",
411  std::bind(&Core::Impl::_decreaseMotionSpeed, this));
412  _keyboardHandler.registerKeyboardShortcut('c', "Log current camera information",
413  std::bind(&Core::Impl::_displayCameraInformation, this));
414  _keyboardHandler.registerKeyboardShortcut('b', "Toggle benchmarking",
415  [this]()
416  {
417  auto& ap = _parametersManager.getApplicationParameters();
418  ap.setBenchmarking(!ap.isBenchmarking());
419  });
420  }
421 
422  void _increaseAnimationFrame() { _parametersManager.getAnimationParameters().jumpFrames(1); }
423 
424  void _decreaseAnimationFrame() { _parametersManager.getAnimationParameters().jumpFrames(-1); }
425 
426  void _resetAnimationFrame()
427  {
428  auto& animParams = _parametersManager.getAnimationParameters();
429  animParams.setFrame(0);
430  }
431 
432  void _toggleAnimationPlayback() { _parametersManager.getAnimationParameters().togglePlayback(); }
433 
434  void _resetCamera()
435  {
436  auto& scene = _engine->getScene();
437  scene.computeBounds();
438  const auto& bounds = scene.getBounds();
439  auto& camera = _engine->getCamera();
440  const auto size = bounds.getSize();
441  const double diag = 1.6 * std::max(std::max(size.x, size.y), size.z);
442  camera.setPosition(bounds.getCenter() + Vector3d(0.0, 0.0, diag));
443  camera.setTarget(bounds.getCenter());
444  camera.setOrientation(safeQuatlookAt(Vector3d(0.0, 0.0, -1.0)));
445  }
446 
447  void _increaseMotionSpeed() { _cameraManipulator->updateMotionSpeed(DEFAULT_MOTION_ACCELERATION); }
448 
449  void _decreaseMotionSpeed() { _cameraManipulator->updateMotionSpeed(1.f / DEFAULT_MOTION_ACCELERATION); }
450 
451  void _displayCameraInformation() { CORE_INFO(_engine->getCamera()); }
452 
453  ParametersManager _parametersManager;
454  EngineFactory _engineFactory;
455  PluginManager _pluginManager;
456  Engine* _engine{nullptr};
457  KeyboardHandler _keyboardHandler;
458  std::unique_ptr<AbstractManipulator> _cameraManipulator;
459  std::vector<FrameBufferPtr> _frameBuffers;
460 
461  // protect render() vs commit() when doing all the commits
462  std::mutex _renderMutex;
463 
464  Timer _renderTimer;
465  std::atomic<double> _lastFPS;
466 
467  std::shared_ptr<ActionInterface> _actionInterface;
468  std::shared_ptr<DirectionalLight> _sunLight;
469 };
470 
471 // -----------------------------------------------------------------------------
472 
473 Core::Core(int argc, const char** argv)
474  : _impl(std::make_unique<Impl>(argc, argv))
475 {
476 }
477 Core::~Core() = default;
478 
479 void Core::commitAndRender(const RenderInput& renderInput, RenderOutput& renderOutput)
480 {
481  if (_impl->commit(renderInput))
482  {
483  _impl->render();
484  _impl->postRender(&renderOutput);
485  }
486 }
487 
489 {
490  if (_impl->commit())
491  {
492  _impl->render();
493  _impl->postRender(nullptr);
494  }
495  return _impl->getEngine().getKeepRunning();
496 }
497 
499 {
500  return _impl->commit();
501 }
503 {
504  return _impl->render();
505 }
507 {
508  _impl->postRender(nullptr);
509 }
511 {
512  return _impl->getEngine();
513 }
515 {
516  return _impl->getParametersManager();
517 }
518 
520 {
521  return _impl->getKeyboardHandler();
522 }
523 
525 {
526  return _impl->getCameraManipulator();
527 }
528 } // namespace core
void setFrame(uint32_t value)
const strings & getInputPaths() const
const std::string & getEnvMap() const
void setWindowSize(const Vector2ui &size)
const std::string & getEngine() const
const Vector2ui getWindowSize() const
void resetModified()
Definition: BaseObject.h:64
The Camera class is an abstract interface for a camera in a 3D graphics application....
Definition: Camera.h:41
PLATFORM_API void set(const Vector3d &position, const Quaterniond &orientation, const Vector3d &target=Vector3d(0.0, 0.0, 0.0))
Sets the position, orientation quaternion, and target of the camera.
Definition: Camera.cpp:44
PLATFORM_API Engine & getEngine()
Definition: Core.cpp:510
PLATFORM_API void render()
Definition: Core.cpp:502
PLATFORM_API Core(int argc, const char **argv)
Definition: Core.cpp:473
PLATFORM_API void postRender()
Definition: Core.cpp:506
PLATFORM_API AbstractManipulator & getCameraManipulator()
Definition: Core.cpp:524
PLATFORM_API bool commitAndRender()
Definition: Core.cpp:488
PLATFORM_API ParametersManager & getParametersManager()
Definition: Core.cpp:514
PLATFORM_API KeyboardHandler & getKeyboardHandler()
Definition: Core.cpp:519
PLATFORM_API bool commit()
Definition: Core.cpp:498
PLATFORM_API ~Core()
Engine * create(const std::string &name)
Create an instance of the engine corresponding the given name. If the name is incorrect,...
Provides an abstract implementation of a ray-tracing engine.
Definition: Engine.h:59
virtual PLATFORM_API FrameBufferPtr createFrameBuffer(const std::string &name, const Vector2ui &frameSize, FrameBufferFormat frameBufferFormat) const =0
Factory method to create an engine-specific framebuffer.
PLATFORM_API FrameBuffer & getFrameBuffer()
Returns the frame buffer.
Definition: Engine.h:154
PLATFORM_API const std::vector< FrameBufferPtr > & getFrameBuffers() const
Returns all registered frame buffers that are used during rendering.
Definition: Engine.h:231
PLATFORM_API Renderer & getRenderer()
Returns the renderer.
Definition: Engine.cpp:72
PLATFORM_API std::function< void()> triggerRender
Callback when a new frame shall be triggered. Currently called by event plugins Deflect and Rockets.
Definition: Engine.h:174
PLATFORM_API Statistics & getStatistics()
Returns statistics information.
Definition: Engine.h:195
virtual PLATFORM_API void commit()
Commits changes to the engine. This includes scene modifications, camera modifications and renderer m...
Definition: Engine.cpp:41
PLATFORM_API Scene & getScene()
Returns the scene.
Definition: Engine.h:147
virtual PLATFORM_API void preRender()
Executes engine-specific pre-render operations.
Definition: Engine.cpp:46
PLATFORM_API void clearFrameBuffers()
Clears all frame buffers.
Definition: Engine.cpp:94
PLATFORM_API void render()
Renders the current scene and populates the frame buffer accordingly.
Definition: Engine.cpp:55
PLATFORM_API void addFrameBuffer(FrameBufferPtr frameBuffer)
Adds a frame buffer to the list to be filled during rendering.
Definition: Engine.cpp:84
virtual PLATFORM_API void postRender()
Executes engine-specific post-render operations.
Definition: Engine.cpp:66
PLATFORM_API void resetFrameBuffers()
Resets all frame buffers.
Definition: Engine.cpp:100
PLATFORM_API const Camera & getCamera() const
Returns the camera.
Definition: Engine.h:161
This class represents a frame buffer for an engine specific code. It provides an API for utilizing an...
Definition: FrameBuffer.h:39
PLATFORM_API FrameBufferFormat getFrameBufferFormat() const
Get the Frame Buffer Format object.
Definition: FrameBuffer.h:160
virtual PLATFORM_API const uint8_t * getColorBuffer() const =0
Get the Color Buffer object.
virtual PLATFORM_API void map()=0
Map the buffer for reading with get*Buffer().
PLATFORM_API size_t getColorDepth() const
Get the Color Depth object.
Definition: FrameBuffer.cpp:34
virtual PLATFORM_API Vector2ui getSize() const
Get the Size object.
Definition: FrameBuffer.h:97
virtual PLATFORM_API const float * getFloatBuffer() const =0
Get the Float Buffer object.
PLATFORM_API AccumulationType getAccumulationType() const
Get the Accumulation Type object.
Definition: FrameBuffer.h:204
virtual PLATFORM_API void unmap()=0
Unmap the buffer for reading with get*Buffer().
The KeyboardHandler class manages keyboard shortcuts and special keys.
void registerKeyboardShortcut(const unsigned char key, const std::string &description, std::function< void()> functor)
Registers a keyboard shortcut.
PLATFORM_API size_t addLight(LightPtr light)
addLight Attaches a light source to the scene.
PLATFORM_API GeometryParameters & getGeometryParameters()
PLATFORM_API ApplicationParameters & getApplicationParameters()
PLATFORM_API AnimationParameters & getAnimationParameters()
PLATFORM_API RenderingParameters & getRenderingParameters()
void initPlugins(PluginAPI *api)
void setCurrentType(const std::string &type)
Renderer class inherits from PropertyObject class The Renderer class has methods to render a FrameBuf...
Definition: Renderer.h:42
const std::string & getCurrentCamera() const
Scene object This object contains collections of geometries, materials and light sources that are use...
Definition: Scene.h:43
PLATFORM_API void computeBounds()
Compute the bounds of the geometry handled by the scene.
Definition: Scene.cpp:427
PLATFORM_API const Boxd & getBounds() const
Returns the bounding box of the scene.
Definition: Scene.h:69
virtual PLATFORM_API void commit()
Called after scene-related changes have been made before rendering the scene.
Definition: Scene.cpp:99
PLATFORM_API void buildDefault()
Builds a default scene made of a Cornell box, a reflective cube, and a transparent sphere.
Definition: Scene.cpp:250
PLATFORM_API LoaderRegistry & getLoaderRegistry()
Get the registry for all supported loaders of this scene.
Definition: Scene.h:214
PLATFORM_API LightManager & getLightManager()
Gets the light manager.
Definition: Scene.h:74
void setFPS(const double fps)
Definition: Statistics.h:36
void setSceneSizeInBytes(const size_t sceneSizeInBytes)
Definition: Statistics.h:38
double perSecondSmoothed() const
Definition: Timer.cpp:80
void start()
Definition: Timer.cpp:34
void stop()
Definition: Timer.cpp:44
int64_t milliseconds() const
Definition: Timer.cpp:65
Quaterniond safeQuatlookAt(const Vector3d &v)
Definition: MathTypes.h:155
glm::vec3 Vector3f
Definition: MathTypes.h:137
glm::vec< 2, int32_t > Vector2i
Definition: MathTypes.h:130
glm::vec< 3, double > Vector3d
Definition: MathTypes.h:143
CameraMode
Definition: Types.h:299
std::shared_ptr< ActionInterface > ActionInterfacePtr
Definition: Types.h:82
#define CORE_INFO(__msg)
Definition: Logs.h:33
std::vector< std::string > strings
Definition: Types.h:44
void _updateRenderOutput(RenderOutput &renderOutput)
Definition: Core.cpp:220
ActionInterface * getActionInterface() final
Definition: Core.cpp:254
bool commit(const RenderInput &renderInput)
Definition: Core.cpp:212
KeyboardHandler & getKeyboardHandler() final
Definition: Core.cpp:249
void triggerRender() final
Definition: Core.cpp:253
void render()
Definition: Core.cpp:178
Renderer & getRenderer() final
Definition: Core.cpp:252
bool commit()
Definition: Core.cpp:122
Scene & getScene() final
Definition: Core.cpp:256
Impl(int argc, const char **argv)
Definition: Core.cpp:82
ParametersManager & getParametersManager() final
Definition: Core.cpp:248
void setActionInterface(const ActionInterfacePtr &interface) final
Definition: Core.cpp:255
AbstractManipulator & getCameraManipulator() final
Definition: Core.cpp:250
void postRender(RenderOutput *output)
Definition: Core.cpp:197
Camera & getCamera() final
Definition: Core.cpp:251
Engine & getEngine() final
Definition: Core.cpp:247
Quaterniond orientation
Definition: Types.h:317
Vector3d target
Definition: Types.h:316
Vector3d position
Definition: Types.h:315
Vector2i windowSize
Definition: Types.h:313
floats floatBuffer
Definition: Types.h:324
Vector2i frameSize
Definition: Types.h:322
uint8_ts colorBuffer
Definition: Types.h:323
FrameBufferFormat colorBufferFormat
Definition: Types.h:325