Commit e91b1821 authored by Heng Liu's avatar Heng Liu

add GlutPrimitiveNode-ConeSupport

parent e35e0232
......@@ -75,6 +75,7 @@ GlutPrimitiveNode::GlutPrimitiveNode( BaseNode* _parent,
const int stacks = 20;
sphere_ = new ACG::GLSphere(slices,stacks);
cone_ = new ACG::GLCone(slices, stacks, 1.0, 0, true, false);
};
//----------------------------------------------------------------------------
......@@ -93,6 +94,7 @@ GlutPrimitiveNode::GlutPrimitiveNode(GlutPrimitiveType _type,
primitives_.push_back(p);
sphere_ = new ACG::GLSphere(slices, stacks);
cone_ = new ACG::GLCone(slices, stacks, 1.0, 0, true, false);
}
void
......@@ -451,7 +453,12 @@ getRenderObjects(IRenderer* _renderer, GLState& _state , const DrawModes::DrawM
ro.debugName = std::string("glutprimitive.sphere no ") + std::to_string(i) + ": " + name();
sphere_->addToRenderer(_renderer, &ro, primitives_[i].size);
break;
case CONE:
//Cone
ro.debugName = std::string("glutprimitive.cone no ") + std::to_string(i) + ": " + name();
cone_->addToRenderer(_renderer, &ro, primitives_[i].innersize);
break;
default:
......
......@@ -178,7 +178,12 @@ public:
/// destructor
virtual ~GlutPrimitiveNode() {}
virtual ~GlutPrimitiveNode() {
if(sphere_)
delete sphere_;
if(cone_)
delete cone_;
}
/**
* Adds a primitive and returns its index.
......@@ -241,6 +246,7 @@ private:
// Sphere rendering
ACG::GLSphere* sphere_;
ACG::GLCone* cone_;
};
......
Markdown is supported
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