first things first does anyone know how to call the animated sydney node when a key is pressed,I loaded the sydney mesh but its constantly playing.
second,i started going into collisions with the terrain i managed to collide my mesh using the camera like in the tutorial. does anyone know how to mix user control with the WASD keys and collison?Thanks.
[/code]
Movement and Animation
-
- Posts: 5
- Joined: Sun Jul 26, 2009 12:44 am
Movement and Animation
Last edited by SilentScope2190 on Sat Aug 01, 2009 1:55 am, edited 1 time in total.
I'm actually looking for a similar answer. I would assume node->setAnimationSpeed(0); would stop the animation. node->setAnimationSpeed(4); would start it back up.
But that seems like a hack?
But that seems like a hack?
My game: Star Sonata
Star Sonata is a massively multiplayer space game.
Star Sonata is a massively multiplayer space game.
as for me, i always save two variables. one the currentAnim, what i override at every frame, and one the previous animation.
so
note that i just wrote this from my head, maybe there are typos or something...
and u have to do the keyboard checking etc by yourself, im just giving an example for u.
so
Code: Select all
enum PLAYER_ANIMATION
{
PA_STAND,
PA_WALK,
PA_RUN
// etc
};
int pAnim, cAnim;
then in the control loop
cAnim = PA_STAND;
if (up && !shift)
cAnim = PA_WALK
else if (up)
cAnim = PA_RUN;
// etc
if (cAnim != pAnim)
node->setAnimation(/*the frames, for me, i have them it in an array*/anims[cAnim][0], anims[cAnim][1]);
pAnim = cAnim;
and u have to do the keyboard checking etc by yourself, im just giving an example for u.