firing_char_single_img_c/Graphical.h
/**
 * Assumes the base of the image is at its mid-left point. This isn't a
 * problem if you're drawing your images with the appropriated
 * GRAL_DrawImage* call.
 */
Assumes the base of the image is at its mid-left point. This isn't a
problem if you're drawing your images with the appropriated
GRAL_DrawImage* call.
Assumes the base of the image is at its mid - left point . This isn ' t a problem if you ' re drawing your images with the appropriated GRAL_DrawImage * call .
static inline vec2f
GRAL_ImageCenterForBaseAt(GRAL_Image *img,
                          vec2f base,
                          vec2f unit_direction)
{
  return add_2f(base, mul_2f(unit_direction, 0.5f*img->h));
}
static inline vec2f GRAL_ImageCenterForBaseAt ( GRAL_Image * img , vec2f base , vec2f unit_direction ) { return add_2f ( base , mul_2f ( unit_direction , 0.5f * img -> h ) ) ; }
Assumes the base of the image is at its mid-left point.
Assumes the base of the image is at its mid - left point .
// Notice that unit_direction.x() is the cosine of the angle for // that direction. Also unit_direction.y() is the sine of the angle // for the direction.