コード例 #1
0
ファイル: dist.cpp プロジェクト: rpankka/micmac
REAL SegComp::square_dist_demi_droite(Pt2dr pt) const
{
    REAL a = abscisse(pt);
    REAL o2 =  ElSquare(ordonnee(pt));
 
    if (a < 0)
       return o2 + ElSquare(a);
    else
       return o2;
}
コード例 #2
0
ファイル: Ennemi.cpp プロジェクト: dwarfman78/tanks
void Ennemi::defRotation()
{
    sf::Vector2f abscisse(1,0);
    float rotationDeg = se::Utils::radsToDeg(se::Utils::getOrientedAngle(speed,abscisse));

    if(se::Utils::det(speed,abscisse)>0)
        rotationDeg*=-1;

    myEntity->setRotation(rotationDeg);
    myShadow->setRotation(rotationDeg);
}
コード例 #3
0
ファイル: dist.cpp プロジェクト: rpankka/micmac
REAL SegComp::square_dist_seg(Pt2dr pt) const
{
    REAL a = abscisse(pt);
    REAL o2 =  ElSquare(ordonnee(pt));
 
    if (a < 0)
    {
       return o2 + ElSquare(a);
    }
    else if (a < _a1)
    {
       return o2;
    }
    else
    {
       return o2 + ElSquare(a-_a1);
    }
}