public static Rectangle CalculateBoundingBox(Character character)
        {
            Rectangle boundingBox = new Rectangle(character.WorldPosition.ToPoint(), Point.Zero);

            void addPointsToBBox(float extentX, float extentY, Vector2 worldPos, Vector2 origin, float rotation)
            {
                float sinRotation = (float)Math.Sin((double)rotation);
                float cosRotation = (float)Math.Cos((double)rotation);

                origin = new Vector2(
                    origin.X * cosRotation + origin.Y * sinRotation,
                    origin.X * sinRotation - origin.Y * cosRotation);
                var limbPos = worldPos.ToPoint();

                boundingBox.AddPoint(limbPos);
                Vector2 xExtend = new Vector2((extentX * cosRotation), (extentX * sinRotation));
                Vector2 yExtend = new Vector2((extentY * sinRotation), (-extentY * cosRotation));

                boundingBox.AddPoint(limbPos + (xExtend + yExtend - origin).ToPoint());
                boundingBox.AddPoint(limbPos + (xExtend - yExtend - origin).ToPoint());
                boundingBox.AddPoint(limbPos + (-xExtend - yExtend - origin).ToPoint());
                boundingBox.AddPoint(limbPos + (-xExtend + yExtend - origin).ToPoint());
            }

            foreach (Limb limb in character.AnimController.Limbs)
            {
                if (limb.ActiveSprite == null)
                {
                    continue;
                }
                float extentX = (float)limb.ActiveSprite.size.X * limb.Scale * limb.TextureScale * 0.5f;
                //extentX = ConvertUnits.ToDisplayUnits(extentX);
                float extentY = (float)limb.ActiveSprite.size.Y * limb.Scale * limb.TextureScale * 0.5f;
                //extentY = ConvertUnits.ToDisplayUnits(extentY);

                Vector2 origin = (limb.ActiveSprite.Origin - (limb.ActiveSprite.SourceRect.Size.ToVector2() * 0.5f)) * limb.Scale * limb.TextureScale;
                addPointsToBBox(extentX, extentY, limb.WorldPosition, origin, limb.body.Rotation);
            }


            if (character.Inventory != null)
            {
                foreach (var item in character.Inventory.AllItems)
                {
                    if (item?.Sprite != null && item?.body != null)
                    {
                        float extentX = (float)item.Sprite.size.X * item.Scale * 0.5f;
                        //extentX = ConvertUnits.ToDisplayUnits(extentX);
                        float extentY = (float)item.Sprite.size.Y * item.Scale * 0.5f;
                        //extentY = ConvertUnits.ToDisplayUnits(extentY);

                        Vector2 origin = (item.Sprite.Origin - (item.Sprite.SourceRect.Size.ToVector2() * 0.5f)) * item.Scale;
                        addPointsToBBox(extentX, extentY, item.WorldPosition, origin, item.body.Rotation);
                    }
                }
            }

            boundingBox.X     -= 25; boundingBox.Y -= 25;
            boundingBox.Width += 50; boundingBox.Height += 50;

            return(boundingBox);
        }