Commit 600a3873 authored by Matthias Möller's avatar Matthias Möller
Browse files

refs #285

replace glu calls by GLPrimitives in SkeletonNode

git-svn-id: http://www.openflipper.org/svnrepo/OpenFlipper/branches/Free@13484 383ad7c9-94d9-4d36-a494-682f7c89f535
parent adb7f7d5
...@@ -76,8 +76,6 @@ SkeletonNodeT<SkeletonType>::SkeletonNodeT(SkeletonType &_skeleton, BaseNode *_p ...@@ -76,8 +76,6 @@ SkeletonNodeT<SkeletonType>::SkeletonNodeT(SkeletonType &_skeleton, BaseNode *_p
bCoordFramesVisible_(false), bCoordFramesVisible_(false),
skeleton_(_skeleton), skeleton_(_skeleton),
hAni_(), hAni_(),
quadricInitialized_(false),
quadric_(0),
fFrameSize_(0.0) fFrameSize_(0.0)
{ {
this->multipassNodeSetActive(3, true); this->multipassNodeSetActive(3, true);
...@@ -94,9 +92,7 @@ SkeletonNodeT<SkeletonType>::SkeletonNodeT(SkeletonType &_skeleton, BaseNode *_p ...@@ -94,9 +92,7 @@ SkeletonNodeT<SkeletonType>::SkeletonNodeT(SkeletonType &_skeleton, BaseNode *_p
template <class SkeletonType> template <class SkeletonType>
SkeletonNodeT<SkeletonType>::~SkeletonNodeT() SkeletonNodeT<SkeletonType>::~SkeletonNodeT()
{ {
// delete quadric if initialized
if (quadricInitialized_)
gluDeleteQuadric(quadric_);
} }
...@@ -615,27 +611,16 @@ void SkeletonNodeT<SkeletonType>::draw_bone(GLState &_state, DrawModes::DrawMode ...@@ -615,27 +611,16 @@ void SkeletonNodeT<SkeletonType>::draw_bone(GLState &_state, DrawModes::DrawMode
else else
_state.rotate(rot_angle, 1, 0, 0); _state.rotate(rot_angle, 1, 0, 0);
if (!quadricInitialized_)
quadric_ = gluNewQuadric();
if ( _drawMode == DrawModes::WIREFRAME ){
gluQuadricDrawStyle(quadric_, GLU_LINE);
} else {
gluQuadricDrawStyle(quadric_, GLU_FILL);
}
gluQuadricNormals(quadric_, GLU_SMOOTH);
double boneLength = _axis.norm(); double boneLength = _axis.norm();
double radius = boneLength * 0.07; double radius = boneLength * 0.07;
//draw the large cone from midPoint to the end of the bone //draw the large cone from midPoint to the end of the bone
gluCylinder(quadric_, radius, 0, boneLength * 0.9, slices, stacks); GLCone cone = ACG::GLCone(slices,stacks,radius,0.0f,false,false);
cone.draw(_state,boneLength*0.9);
//rotate 180.0 and draw the the small cone from midPoint to the start //rotate 180.0 and draw the the small cone from midPoint to the start
_state.rotate(180.0, 1, 0, 0); _state.rotate(180.0, 1, 0, 0);
gluCylinder(quadric_, radius, 0, boneLength * 0.1, slices, stacks); cone.draw(_state,boneLength*0.1);
_state.pop_modelview_matrix(); _state.pop_modelview_matrix();
} }
......
...@@ -142,10 +142,6 @@ private: ...@@ -142,10 +142,6 @@ private:
/// The active pose, this one is going to be rendered /// The active pose, this one is going to be rendered
AnimationHandle hAni_; AnimationHandle hAni_;
///quadric for drawing cylinders
bool quadricInitialized_;
GLUquadricObj* quadric_;
/// size for the coord-frame /// size for the coord-frame
double fFrameSize_; double fFrameSize_;
......
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