Commit c1bc6783 authored by Isaak Lim's avatar Isaak Lim
Browse files

fixed a scaling issue when rendering TextNodes in order to show indices for SkeletonObjects

closes #932

git-svn-id: http://www.openflipper.org/svnrepo/OpenFlipper/branches/Free@14759 383ad7c9-94d9-4d36-a494-682f7c89f535
parent 6f1e9964
......@@ -154,6 +154,16 @@ DrawModes::DrawMode SkeletonNodeT<SkeletonType>::availableDrawModes() const
//----------------------------------------------------------------------------
template <class SkeletonType>
double SkeletonNodeT<SkeletonType>::frameSize() {
return fFrameSize_;
}
//----------------------------------------------------------------------------
/** \brief Normalizes a coordinate frame defined by the given matrix
*
*/
......
......@@ -113,6 +113,9 @@ public:
void showCoordFrames(bool _bVisible = true);
bool coordFramesVisible();
/// returns the size of the rendered coordinate system
double frameSize();
private:
/// Pick method for vertices
......
......@@ -329,6 +329,7 @@ void SkeletonObject::updateIndices(const AnimationHandle &_hAni)
pTransNode->loadIdentity();
pTransNode->translate(pose->globalTranslation(i));
pTransNode->scale(skeletonNode_->frameSize()*0.5);
}
// find and prune redundant nodes
......@@ -425,6 +426,7 @@ void SkeletonObject::showIndices(bool _bVisible)
}
pTransNode->loadIdentity();
pTransNode->translate(ref->globalTranslation(i));
pTransNode->scale(skeletonNode_->frameSize()*0.5);
ACG::SceneGraph::MaterialNode *pSubMatNode;
if(!getAdditionalNode(pSubMatNode, "SkeletonPlugin", nameSubMatNode.c_str()))
......@@ -439,11 +441,12 @@ void SkeletonObject::showIndices(bool _bVisible)
{
pTextNode = new ACG::SceneGraph::TextNode(pSubMatNode,
nameTextNode.c_str(),
ACG::SceneGraph::TextNode::SCREEN_ALIGNED);
ACG::SceneGraph::TextNode::SCREEN_ALIGNED,
true);
addAdditionalNode(pTextNode, "SkeletonPlugin", nameTextNode.c_str());
}
pTextNode->setText(" " + nameJoint);
pTextNode->setSize(50);
pTextNode->setSize(1);
pTextNode->multipassNodeSetActive(8, true);
}
......
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