I could use some advice on a collision response issue that I’m having, please.
My current project has all interactions in 2D, and thus far I haven’t been using the built-in collision systems, save for picking (which is done as described here, followed by 2D point-in-rectangle checks, as I recall). Floors are line segments along which objects are moved (if said objects are under the influence of gravity and are not in mid-air), and walls have thus far been vertical lines and some x- and z- testing. My objects are currently all dealt with internally as rectangular boxes.
However, I’ve found myself wanting for a more complex wall system, primarily for objects that are moving through the air, whether flying or having been pushed: I would like to have walls at arbitrary angles, but I’m also concerned about performance (especially given the performance that my hardware is thus far providing), which leaves me uncertain of what method to pick.
The options that I have in mind are these:
Python-based line-segment to line-segment collision, with objects being represented by four line segments (one from each corner of their box representations along their displacement in this or the last update). I’ve had a shot at this, and I’ve found it to be perhaps slower than I’d like, and alas suffers from objects sometimes penetrating.
The built-in Panda collision system. This would presumably mean adding collision solids to all objects, and representing my walls as other shapes - perhaps Collision -Tubes, -Boxes or -Polygons. I’d want to be careful to not let them be moved along the y-axis, however, and, given that I intend a fair few objects, I worry about the overhead of all of this.
Using one of the other collision systems, such as Bullet. It might enable me to include more complex physics than I had intended for this game, but I wonder at what cost in performance.
Does anyone have any insight that might aid me?