Code: Select all
if ( receiver.IsKeyDown(KEY_UP) )
{
render_mesh->setRotation( vector3df( 0 , cam_control->getRotation().Y-180 , 0 ) );
}
if ( receiver.IsKeyDown(KEY_RIGHT) )
{
render_mesh->setRotation( vector3df( 0 , cam_control->getRotation().Y-90 , 0 ) );
}
if ( receiver.IsKeyDown(KEY_LEFT) )
{
render_mesh->setRotation( vector3df( 0 , cam_control->getRotation().Y+90 , 0 ) );
}
if ( receiver.IsKeyDown(KEY_DOWN) )
{
render_mesh->setRotation( vector3df( 0 , cam_control->getRotation().Y , 0 ) );
}
if ( receiver.IsKeyDown(KEY_RIGHT) && receiver.IsKeyDown(KEY_UP) )
{
render_mesh->setRotation( vector3df( 0 , cam_control->getRotation().Y-135 , 0 ) );
}
if ( receiver.IsKeyDown(KEY_LEFT) && receiver.IsKeyDown(KEY_UP) )
{
render_mesh->setRotation( vector3df( 0 , cam_control->getRotation().Y+135 , 0 ) );
}
if ( receiver.IsKeyDown(KEY_RIGHT) && receiver.IsKeyDown(KEY_DOWN) )
{
render_mesh->setRotation( vector3df( 0 , cam_control->getRotation().Y-45 , 0 ) );
}
if ( receiver.IsKeyDown(KEY_LEFT) && receiver.IsKeyDown(KEY_DOWN) )
{
render_mesh->setRotation( vector3df( 0 , cam_control->getRotation().Y+45 , 0 ) );
}
I tried just rotating until it hit the value greater than what it should be but then adding an extra less than test made horribly buggy.
Should I use animators maybe?
Thanks

