Length of BezierCurve

Hi there,

I am planning on doing an AI Pathfinding kind of program where the agent searches a path and then moves along it. For the path I want to use a BezierCurve. This works quite nicely at the moment but my problem is that no matter how long the BezierCurve is, the agent walks along it always requiers the same amount of time (1s), which means that the agent is travelling at different speeds for different length of paths. In order to adjust the speed I would need to know the length of the BezierCurve but I do not see a function for this. Can anybody give me a hint on how to tackle this? 

quick google turned up these threads:



seems it can't be solved analytically, so you would have to find the best approximation for your needs. be it knowing the paths so you can calculate stuff offline, or dynamic so you need something rought and realtime…

Thanks for the hint but hm, that does not look promising. During my search I found that Catmull-Rom curves seem to be a better solution anyway since every point in the path has to be visited (Unlike the "shortcuts" with Bezier). So I will probably use that even though the web did not give me a quick answer of how to calculate the length of such a curve. I know that there exists a post about Catmull-Rom in this forum but it does not answer the question about length. So, does anybody has an idea? Also it would be very interesting to me how others have solved the path-curve problem within jME.