3
$\begingroup$

I'm trying to give shapes in my physics engine roundness/ curvature.

I am aware of various methods for mathematically defining curvature such as bezier-curves, ellipses, etc; but I'm not sure which methods are most appropriate for use in a physics engine. I must consider the speed, flexibility, and difficulty of constructing/joining the curves when choosing my approach. The ideal is a system where a user could easily construct and collide a large amount of curved, aesthetic polygon bodies together, yet I could still maintain a satisfactory framerate. However it's inevitable that ease-of-use and other attributes will suffer.

NOTE: my physics engine is continuous, which means I must pre-calculate the times at which polygons will collide. Keep in mind that the curve's route my not be linear.


For each suggestion please give the positives/negatives!

  • What techniques are there for mathematically defining a 2D curve?

  • Advantages/Disadvantages (speed, flexibility, ease of construction/use)?

  • Is the technique feasible for an engine where predictability of collisions is crucial?

  • 1
    Piecewise linear curves are speedy, easy to handle and able to approximate smooth and non-smooth curves...2011-12-14
  • 2
    "a system in which a user can easily form fairly complex curves, but still make the intersection calculations simple and fast." - this sounds very Scylla and Charybdis to me...2011-12-14
  • 0
    If you have the curve's equation, several software tools would allow you to find the intersection easily specially if the curves are functions in one variables. If you have data points and you want to find curves that represent them (interpolation, extrapolation,etc.), again, there are tools for that. Assuming that the process is manual, I could point you to some sources if you are interested or you could simply search the net.2011-12-14
  • 0
    @Emmad That would be great! What software/ math libs do you suggest for finding intersections? I'm pretty sure I can get the movement of all the edges of my bodies down to a single equation that depends on time.2011-12-14
  • 0
    Are your bodies getting deformed?2012-08-17
  • 0
    @JayeshBadwaik Yes, they are2012-08-17

2 Answers 2