Example #1
0
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;
}
Example #2
0
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);
}
Example #3
0
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);
    }
}