Ok thanks for the advice
Added after 1 57 minutes:
i change my code littel like that
now i can make animation only when i clic on the button
i make like that
connect(repo_cam, SIGNAL(clicked()), this, SLOT( makeanim()));
void Coordinate3dWidget::makeanim()
{
bool istrue=true;
emit newbool(istrue);
}
connect(repo_cam, SIGNAL(clicked()), this, SLOT( makeanim()));
void Coordinate3dWidget::makeanim()
{
bool istrue=true;
emit newbool(istrue);
}
To copy to clipboard, switch view to plain text mode
and
connect(page_14, SIGNAL(newbool(bool)), mQOgreWidget , SLOT(animat(bool)));
connect(page_14, SIGNAL(newbool(bool)), mQOgreWidget , SLOT(animat(bool)));
To copy to clipboard, switch view to plain text mode
and in animat
void QOgreWidget::animat(bool istrue)
{
while(istrue)
{
mDistance -= move;
if (mDistance <= 0.0f)
{
mNode->setPosition(mDestination);
mDirection = Ogre::Vector3::ZERO;
istrue=false;
// Set animation based on if the robot has another point to walk to.
if (! nextLocation())
{
// Set Idle animation
/* mAnimationState = mEntity->getAnimationState("Idle");
mAnimationState->setLoop(true);
mAnimationState->setEnabled(true);*/
}
else
{
// Rotation Code will go here later
}
}
else
{
mNode->translate(mDirection * move);
}
}
}
void QOgreWidget::animat(bool istrue)
{
while(istrue)
{
mDistance -= move;
if (mDistance <= 0.0f)
{
mNode->setPosition(mDestination);
mDirection = Ogre::Vector3::ZERO;
istrue=false;
// Set animation based on if the robot has another point to walk to.
if (! nextLocation())
{
// Set Idle animation
/* mAnimationState = mEntity->getAnimationState("Idle");
mAnimationState->setLoop(true);
mAnimationState->setEnabled(true);*/
}
else
{
// Rotation Code will go here later
}
}
else
{
mNode->translate(mDirection * move);
}
}
}
To copy to clipboard, switch view to plain text mode
Bookmarks