Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

Comparing changes

Choose two branches to see what's changed or to start a new pull request. If you need to, you can also compare across forks.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also compare across forks.
  • 2 commits
  • 3 files changed
  • 0 commit comments
  • 1 contributor
Showing with 24 additions and 0 deletions.
  1. +15 −0 kglt/frustum.h
  2. +2 −0  kglt/scene.cpp
  3. +7 −0 kglt/scene.h
View
15 kglt/frustum.h
@@ -51,6 +51,21 @@ class Frustum {
return kmVec3Length(&diff);
}
+ double near_width() const {
+ assert(initialized_);
+ kmVec3 diff;
+ kmVec3Subtract(&diff, &near_corners_[FRUSTUM_CORNER_BOTTOM_LEFT], &near_corners_[FRUSTUM_CORNER_BOTTOM_RIGHT]);
+ return kmVec3Length(&diff);
+ }
+
+ double far_width() const {
+ assert(initialized_);
+ kmVec3 diff;
+ kmVec3Subtract(&diff, &far_corners_[FRUSTUM_CORNER_BOTTOM_LEFT], &far_corners_[FRUSTUM_CORNER_BOTTOM_RIGHT]);
+ return kmVec3Length(&diff);
+ }
+
+
double depth() const {
assert(initialized_);
View
2  kglt/scene.cpp
@@ -263,9 +263,11 @@ void Scene::render() {
pass.renderer().set_options(render_options);
pass.viewport().update_opengl();
+ signal_render_pass_started_(pass);
pass.renderer().start_render();
this->accept(pass.renderer());
pass.renderer().finish_render();
+ signal_render_pass_finished_(pass);
}
}
View
7 kglt/scene.h
@@ -1,6 +1,7 @@
#ifndef SCENE_H_INCLUDED
#define SCENE_H_INCLUDED
+#include <sigc++/sigc++.h>
#include <boost/any.hpp>
#include <boost/thread/mutex.hpp>
@@ -151,6 +152,9 @@ class Scene : public Object, public Loadable {
Background& background() { return background_; }
UI& ui() { return ui_interface_; }
+
+ sigc::signal<void, Pass&>& signal_render_pass_started() { return signal_render_pass_started_; }
+ sigc::signal<void, Pass&>& signal_render_pass_finished() { return signal_render_pass_finished_; }
private:
std::map<MeshID, Mesh::ptr> meshes_;
std::map<CameraID, Camera::ptr> cameras_;
@@ -172,6 +176,9 @@ class Scene : public Object, public Loadable {
std::vector<Pass> passes_;
mutable boost::mutex scene_lock_;
+
+ sigc::signal<void, Pass&> signal_render_pass_started_;
+ sigc::signal<void, Pass&> signal_render_pass_finished_;
};
}

No commit comments for this range

Something went wrong with that request. Please try again.