Bonjour,
j'ai ajouter une animation pour mes objets
mais le problème elle se lance automatiquement quand je lance mon programme malgré j'ai ajouter un button voir ce que j'ai fait
dans mainwindow
Code : Sélectionner tout - Visualiser dans une fenêtre à part
connect(Move, SIGNAL(clicked()), mOgreWidget, SLOT( animat()));
et dans qogrewidget j'ai définit animat comme slot
Code : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
bool OgreWidget::frameRenderingQueued(const Ogre::FrameEvent &evt){  
if (mDirection == Ogre::Vector3::ZERO)  
{  
if (nextLocation())  
{  
 
}  
}  
else  
{  
move = mWalkSpeed * evt.timeSinceLastFrame;  
animat();  
 
}  
return true;  
 
}  
void OgreWidget::animat()  
{  
mDistance -= move;  
if (mDistance <= 0.0f)  
{  
mNode->setPosition(mDestination);  
mDirection = Ogre::Vector3::ZERO;  
// Set animation based on if the robot has another point to walk to.  
if (! nextLocation())  
{  
 
}  
else  
{  
// Rotation Code will go here later  
}  
}  
else  
{  
mNode->translate(mDirection * move);  
} // else  
} // if
mais il reste se lance l'animation automatiquement