Hi people, I've been working on my physics engine. I recently do a performance testing of each integration steps (broadphase, narrowphase, solver, etc), and found out that the narrowphase took the most out of execution time. I thought it was reasonable because I simply use EPA to generate contact point. Now most presentation of physics for games that I read suggest using gjk + core shapes to generate contact point. I already have the gjk part implemented nice and sound. Now, how do I inflate/deflate the convex shapes though? scaling by its center would result in non-uniform scale, that is, the distance of the "inflated" to the core shape is non-uniform. Here's a picture showing the non-uniform scaling problem.
the green box is the core shape, the red one is the inflated shape, scaled up to 1,5x. but now the distance between the core and the inflated one is non uniform (Here, dX should equal dY!). I've been thinking of how to solve this, but to no avail. How would I generate the inflated shape based on the core shape + margin?