shapes in the body / quick question

hello!

i'm doing a mario-style game, and my hero has a feetShape, which i would like to use for collision detection. so my heroBody has two shapes, but how do i make sure that the feet shape (which is a rectangle) is at the bottom of my hero's body?

pretty please, give me a hint at least, i'm quite desperate ^^

thanks!
Z
When you create the shapes, position in a lower position of the body using SetAsOrientedBox method of your shape. You can pass a b2V2 as the center position of the shape.

Unless the feet are very important or physically standing from the body, I'd skip it completely though.
oh, interesting, thank you! 🙂

if you would avoid using the feetShape, how would you detect whether the hero's feet are on the ground? (i dont want him to be able to jump when he's touching a wall with his body)

thanks again,
Z.
It depends on how you are building your game logic. I prefer to have states to control the behavior of the several game tokens. If the current state was NONE or RUN it would be possible to JUMP. If the state was CLIMBING (assuming that's what you mean by touching a wall with the body) then JUMP would not be possible.
alright, thank you, Vlad 🙂

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