本文整理汇总了C++中Bone::draw方法的典型用法代码示例。如果您正苦于以下问题:C++ Bone::draw方法的具体用法?C++ Bone::draw怎么用?C++ Bone::draw使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Bone
的用法示例。
在下文中一共展示了Bone::draw方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: draw
void Chain::draw() {
Bone *current = this->root;
int depth = 0;
//Matrix4f transform;
glPushMatrix();
while (current != NULL) {
glMultMatrixf(current->getTransformationMatrix().data());
current->draw(BONE_RADIUS, BONE_FACES);
//transform = current->getTransformationMatrix();
current = current->getChild(0);
}
glPopMatrix();
}
示例2: draw
/**
* Draws the skeleton.
* \param mode bitmask of RENDER_WIREFRAME, RENDER_FEEDBACK or RENDER_OUTPUT,
* determines how the primitives are drawn.
* \param active active state
**/
void Skeleton::draw(int mode, int active)
{
unsigned hit = 0;
SelectItem *selected = NULL;
if (selector->getPickLayer()
&& selector->getPickLayer()->getSkeleton() == this) {
hit = selector->getHitCount();
selected = selector->getSelected();
}
// select objects from the selection buffer
pJoint = NULL;
pBone = NULL;
for (unsigned int i = 0; i < hit; i++) {
if (selected->type == Selection::SELECT_JOINT &&
((ui->settings.mode == ANIMATA_MODE_CREATE_JOINT) ||
(ui->settings.mode == ANIMATA_MODE_SKELETON_SELECT) ||
(ui->settings.mode == ANIMATA_MODE_SKELETON_DELETE) ||
(ui->settings.mode == ANIMATA_MODE_CREATE_BONE))) {
/* joints are prefered to bones if they overlap */
pJoint = (*joints)[selected->name];
pBone = NULL;
break;
}
else if (selected->type == Selection::SELECT_BONE &&
(ui->settings.mode != ANIMATA_MODE_CREATE_BONE)) {
pBone = (*bones)[selected->name];
}
selected++;
}
if ((mode & RENDER_WIREFRAME)
&& ((!(mode & RENDER_OUTPUT)
&& ui->settings.display_elements & DISPLAY_EDITOR_BONE)
|| ((mode & RENDER_OUTPUT)
&& ui->settings.display_elements & DISPLAY_OUTPUT_BONE)))
{
glLoadName(Selection::SELECT_BONE); /* type of primitive */
glPushName(0); /* id of primitive */
for (unsigned i = 0; i < bones->size(); i++) {
Bone *bone = (*bones)[i];
glLoadName(i);
if (mode & RENDER_OUTPUT)
bone->draw(false);
else
bone->draw(bone == pBone, active);
}
glPopName();
}
if (mode & RENDER_FEEDBACK) {
for (unsigned i = 0; i < joints->size(); i++) {
Joint *joint = (*joints)[i];
glPassThrough(i);
glBegin(GL_POINTS);
glVertex2f(joint->position.x, joint->position.y);
glEnd();
}
}
else if ((mode & RENDER_WIREFRAME) &&
((!(mode & RENDER_OUTPUT)
&& ui->settings.display_elements & DISPLAY_EDITOR_JOINT) ||
((mode & RENDER_OUTPUT)
&& ui->settings.display_elements & DISPLAY_OUTPUT_JOINT)))
{
glLoadName(Selection::SELECT_JOINT); /* type of primitive */
glPushName(0); /* id of primitive */
for (unsigned i = 0; i < joints->size(); i++) {
Joint *joint = (*joints)[i];
glLoadName(i);
if (mode & RENDER_OUTPUT)
joint->draw(false);
else
joint->draw(joint == pJoint, active);
}
glPopName();
}
}