23 const float spriteHeight,
const float scale)
25 return {x + (spriteWidth * scale) / 2.0f, y + (spriteHeight * scale) / 2.0f};
38 return {(spriteWidth * scale) / 2.0f, (spriteHeight * scale) / 2.0f};
51 const float spriteHeight,
const float scale)
54 return {centerX - x, centerY - y};
std::pair< float, float > calculateHitboxOffsets(const float spriteWidth, const float spriteHeight, const float scale)
Calculate hitbox offsets to center the hitbox on the sprite.
std::pair< float, float > calculateHitboxOffsetsRelative(const float x, const float y, const float spriteWidth, const float spriteHeight, const float scale)
Calculate hitbox offsets relative to sprite position.
std::pair< float, float > calculateSpriteCenter(const float x, const float y, const float spriteWidth, const float spriteHeight, const float scale)
Calculate the center position of a sprite.