dimforge / rapier

2D and 3D physics engines focused on performance.
https://rapier.rs
Apache License 2.0
3.93k stars 244 forks source link

Support top-down 2-D movement in character controller #449

Open ndarilek opened 1 year ago

ndarilek commented 1 year ago

I'd like to set up a character controller for a top-down 2-D game. There would be no up vector. The controller would focus on maintaining separation between the character and walls, and possibly sliding along wall angles.

I'm not immediately sure how the existing support could be made to work with this. If I wanted a character to slide along walls, it seems like I could fake it in some circumstances. But then the character might get stuck if attempting to slide along a wall perpendicular to the unused up vector, resulting in slides in some situations but not others. Maybe that's inaccurate but it seems like it'd be true.

Thanks.

a-type commented 1 year ago

In a 2D game, isn't Up just the 3rd axis - pointing toward the 'camera'? For example, if your 2d objects are laid out along the X and Y axes, up would be (0,0,1). If everything is on a flat 2d plane, you'd never have a wall that was perpendicular to the Z axis (that would be a ceiling, technically).

ndarilek commented 1 year ago

Sure, but you can't specify a Vec3 as an up vector nor can you specify ZERO or None.

AndriBaal commented 7 months ago

Is there any progress / plans for this?