Commit 68ec3267 authored by Jan Möbius's avatar Jan Möbius
Browse files

Added bounding box variable to glState

git-svn-id: http://www.openflipper.org/svnrepo/OpenFlipper/branches/Free@10131 383ad7c9-94d9-4d36-a494-682f7c89f535
parent dcd46d87
......@@ -75,6 +75,8 @@ const float GLState::default_shininess(100.0);
GLState::GLState(bool _updateGL)
: render_pass_(1),
max_render_passes_(1),
bb_min_(ACG::Vec3d(0.0,0.0,0.0)),
bb_max_(ACG::Vec3d(0.0,0.0,0.0)),
multisampling_(false),
allow_multisampling_(true),
mipmapping_(true),
......@@ -701,6 +703,20 @@ void GLState::set_line_width(float _f)
}
}
//-----------------------------------------------------------------------------
void GLState::set_bounding_box(ACG::Vec3d _min, ACG::Vec3d _max ) {
bb_min_ = _min;
bb_max_ = _max;
}
//-----------------------------------------------------------------------------
void GLState::get_bounding_box(ACG::Vec3d& _min, ACG::Vec3d& _max ) {
_min = bb_min_;
_max = bb_max_;
}
//-----------------------------------------------------------------------------
......
......@@ -423,7 +423,27 @@ private:
unsigned int max_render_passes_;
/** @} */
//===========================================================================
/** @name Scene Infos
* @{ */
//===========================================================================
public:
/// Provide scene Information about the boundingbox via this function
/// It is not computed by the state itself!!
void set_bounding_box(ACG::Vec3d _min, ACG::Vec3d _max );
/// Get the current bounding box of the scene.
/// This has to be set before traversal happens in the viewer by using set_bounding_box
void get_bounding_box(ACG::Vec3d& _min, ACG::Vec3d& _max );
private:
ACG::Vec3d bb_min_,bb_max_;
/** @} */
//--- misc ------------------------------------------------------------------
public:
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment