//------------------------------------------------------------------------------
// Réinitialisation d'un ennemi avec un nouveau mesh (obsolète)
//------------------------------------------------------------------------------


void ReinitialiserMesh ( struct mesh_struct * mesh, struct mesh_struct * mesh_old )
{
    mesh->liste_de_faces = mesh_old->liste_de_faces ;
    mesh->liste_de_points = mesh_old->liste_de_points ;
    mesh->liste_faces_normales = mesh_old->liste_faces_normales ;
    mesh->liste_points_normales = mesh_old->liste_points_normales ;
    mesh->liste_uv = mesh_old->liste_uv ;
    mesh->liste_uvfaces = mesh_old->liste_uvfaces ;
    mesh->nb_faces = mesh_old->nb_faces ;
    mesh->nb_points = mesh_old->nb_points ;
    mesh->nb_uv = mesh_old->nb_uv ;
    mesh->nb_uvfaces = mesh_old->nb_uvfaces ;
    mesh->posx = mesh_old->posx;
    mesh->posy = mesh_old->posy ;
    mesh->posz = mesh_old->posz ;
}

//------------------------------------------------------------------------------
// Initialisation d'un ennemi (obsolète)
//------------------------------------------------------------------------------


int EnnemiInit ( struct mesh_struct * mesh )
{
    mesh->posx = rand ( ) % 100 / 10.0f-5;
    mesh->posy = rand ( ) % 100 / 10.0f-5;
    mesh->posz = -100;
    return 0;
}


//------------------------------------------------------------------------------
// Déplacement d'un ennemi
//------------------------------------------------------------------------------


int EnnemiMove ( struct mesh_struct * mesh )
{
    // TimeStep corrigé pour les ennemi (03 février 2004)
    mesh->posz += 0.4f*temps.ecart*100;
    if ( mesh->posz > 0 ) return 1;
    else return 0;
}


//------------------------------------------------------------------------------
// Collision entre le vaisseau et l'ennemiFin Du Fichier
//------------------------------------------------------------------------------

//-------------- NEW NEW 2003 03 06 -------------------------------//
bool EnnemiCollision ( struct mesh_struct * mesh1, struct mesh_struct * mesh2 )
{
    if (
    ( mesh1->posx > mesh2->posx - 1.0f ) && ( mesh1->posx < mesh2->posx + 1.0f )
    &&
    ( mesh1->posy > mesh2->posy - 1.0f ) && ( mesh1->posy < mesh2->posy + 1.0f )
    &&
    ( mesh1->posz > mesh2->posz - 1 ) && ( mesh1->posz < mesh2->posz + 1 )
    )
    {
        mesh1->vie -= 25;
        mesh2->posz = 100;
        if (mesh1->vie == 0) exit ( 0 );
        return true;
    }
    return false;
}
//-------------- NEW NEW 2003 03 06 -------------------------------//

//------------------------------------------------------------------------------
// Tonneau du vaisseau ( touche entrée )
//------------------------------------------------------------------------------


int Tonneau ( struct mesh_struct * mesh )
{
    // TimeStep corrigé pour le tonneau (03 février 2004)
    if ( tonneau == true ) mesh->rotz+=10*temps.ecart*100;
    if ( mesh->rotz >= 360 ) { tonneau = false; mesh->rotz=0; }
    return 0;
}


//------------------------------------------------------------------------------
// Fin Du Fichier
//------------------------------------------------------------------------------