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