Finding the lowest point on a Body

I am working on some elements of a platform game and having a slight issue regarding ground detection.

I have a rectangle object, wider than high. When its angle is 0, it is easy to find the offset to check bellow for a ground/platform collision. But, if I rotate the body 90 degrees, the offset is much lower causing problems for finding a platform collision. The body is also animated, and in doing so, the ratio of width/height is altered.

What I really need is a way to find the lowest point of the Body so I can use the Y position to correctly find a platform using a point check.

I know I can use another rectangle slightly larger than the object mentioned and set that as a sensor, but I wanted to avoid using that if possible as the areas I need to detect are quite specific.

Any help would be great!
If all you're needing to do is find the lowest 'y' value for an oriented rectangle, that's easy enough to do.

To do this, you can use the method used in the SAT (separating axis test) for finding the projection of a box onto an axis. You'll need the center of the box, its two orthonormal basis vectors (which can be computed from its angle), and its two extents (half-width and half-height).

The projected radius of the box with respect to the y axis is then:

Code:
vector2 axis(0, 1);
float radius =
    abs(dot(box.x_axis, axis)) * box.x_extent +
    abs(dot(box.y_axis, axis)) * box.y_extent;

Which can be reduced to:

Code:
float radius = abs(box.x_axis.y) * box.x_extent + abs(box.y_axis.y) * box.y_extent;

The minimum y value can then be computed as follows:

Code:
float min_y = box.center.y - radius;

Or, you can just compute the four corners of the box and find the one with the lowest y value (which will give you not only the lowest y value, but the lowest supporting feature as well).
There is a method on b2PolygonSHape to support this. It's called "Support" or something similar.
Thanks for the help, I did it like this in the end. Perhaps not the best way, but it does work!
Code:
static inline float LowestYvector(Actor* actor)
{
   float radians = actor->Body->GetAngle();
   float s = fastSinf(radians);
   float c = cosf(radians);
   b2Vec2 centre = actor->Body->GetLocalCenter();
   float Y;
   
    float LowY = ((actor->PolygonShape->GetVertex(0).y - centre.x) *c + (actor->PolygonShape->GetVertex(0).x - centre.y) *s) + centre.y;
   float HighY = LowY;
    for(int i=0; i<actor->PolygonShape->GetVertexCount(); i++)
    {
      Y = ((actor->PolygonShape->GetVertex(i).y - centre.x) *c + (actor->PolygonShape->GetVertex(i).x - centre.y) *s) + centre.y;
        if (Y < LowY) LowY = Y;
      if (Y > HighY) HighY = Y;
    }
   return (HighY - LowY) /2.0f;
}


I have only been coding C for 4 months, so am happy to hear any amendments/suggestions.

Original thread: https://box2d.org/forum/viewtopic.php?t=4782