It’s not obvious what a plane is in a 2D physics engine.
Versions used below
Circles, rectangles and lines make sense in 2D but a plane feels more relevant in 3D worlds. Sure, a 2D world exists on one plane but that’s not what a plane is in p2.
Thinking about planes in p2
A plane is a shape that extends infinitely in three directions (e.g. left, down, right). There is a flat edge on the other, non-infinite side.
Planes as edges of the world
Planes have one flat edge and nothing can get around or behind them. This makes planes a good candidate for edges of the game world.
The default plane orientation acts as a floor. It stretches down, left and right forever.
Flipping it by 180 degrees makes a ceiling.
Increasing a body’s angle rotates it in the counterclockwise direction.
Right wall is rotated 90 degrees from the floor.
Left wall is rotated 270 degrees from the floor.
You can use any angle to get slopes.
Prefer planes over lines and rectangles
Lines and rectangles could be used for edges of the world but planes have a few advantages.
You don’t have to worry about planes being wide or tall enough. Nothing can get around or behind a plane.
Planes collide with more shapes than Lines and Rectangles do.
Position of a plane is a little weird to think about. I’ve found that a plane’s edge will intersect its position coordinate.
p2 is “y up”, y values increase as you go up. To put a floor 10 units above the origin I would use
To put a left wall 100 units to the right of the origin