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

Fixed missing update for plane node

git-svn-id: http://www.openflipper.org/svnrepo/OpenFlipper/branches/Free@17380 383ad7c9-94d9-4d36-a494-682f7c89f535
parent 46f2425b
......@@ -307,12 +307,15 @@ addSphereAt(ACG::Vec3d _pos, ACG::IRenderer* _renderer, ACG::GLState& _state, A
sphere_->addToRenderer(_renderer, _ro, sphereSize, ACG::Vec3f(_pos));
}
void PlaneNode::update() {
updateVBO();
}
//----------------------------------------------------------------------------
void PlaneNode::updateVBO()
{
if ( !vbo_ ) {
std::cerr << "Generating" << std::endl;
glGenBuffersARB(1, &vbo_);
}
......
......@@ -120,11 +120,15 @@ public:
*/
void getRenderObjects(ACG::IRenderer* _renderer, ACG::GLState& _state , const ACG::SceneGraph::DrawModes::DrawMode& _drawMode , const ACG::SceneGraph::Material* _mat);
/// Force an update of the vbo data
void update();
private:
void drawPlane(ACG::GLState & _state);
void drawManipulator(ACG::GLState & _state);
void drawPlanePick(ACG::GLState & _state);
void drawManipulatorPick(ACG::GLState & _state);
/// create and update VBO
void updateVBO();
......
......@@ -199,6 +199,14 @@ QString PlaneObject::getObjectinfo() {
return output;
}
// ===============================================================================
// Content
// ===============================================================================
void PlaneObject::update(UpdateType _type) {
if (planeNode_)
planeNode_->update();
}
// ===============================================================================
// Data
......
......@@ -118,6 +118,21 @@ class DLLEXPORT PlaneObject : public BaseObjectData {
Plane plane_;
/** @} */
//===========================================================================
/** @name Content
* @{ */
//===========================================================================
public:
/** \brief This function is called to update the object
*
* If the object changes, the core will call this function. This function
* triggers an vbo update in the plane node.
*
* \note Do not call this function yourself to avoid unnecessary overhead(the core will call it when it is required)
*/
void update(UpdateType _type = UPDATE_ALL );
//===========================================================================
/** @name Visualization
......
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