Example #1
0
void OGPhysic::shoot(float power, int angle){
    Vector3d direction = pov->getDirection();
    direction.y = sin(angle);
    direction = direction.getNormalized() * power;
    Vector3d p = ball->getPosition();
    ball->setSpeed(0,0,0);
    ball->setPosition(p.x, p.y + ball->getRadius() + 0.01, p.z);
    ball->setSpeed(direction.x, direction.y, direction.z);
    
}