Enabled by "useConstantSpeed" parameter.
This is done by creating new spline which resamples original spline proportionally to linear-piece-wise integrated length of segments of the original spline.
It's not perfect, but speed-wise it should be better, especially when the original spline has very different lengths of segments.
New spline may have a bit different shape though (Catmull-Rom spline guarantees that it will pass through control points, but with more dense control points it may get kinks in between). You may control density of resampling by "resamplingCoef" parameter of the PathCamera.
No more need for manual update hack.
Problems with keeping constant speed are still there. Added debug particles sampled along the spline - seems problems come from spline, samples have weird distribution.
To be used like this:
python convert_obj_threejs_slim.py -i model.obj -m morph*.obj -o model.js
Morph filename strings can contain wildcards "*,?,[]".
For including morphs from multiple folders, use quotes and separate filename patterns by space:
python convert_obj_threejs_slim.py -i model.obj -m "folderA/morphA*.obj folderB/morphB*.obj ..." -o model.js
PathCamera automatically follows path passing through waypoints (interpolated via Catmull-Rom spline). View angles can be constrained and controlled by mouse.
Work in progress, there are still some issued to be solved (constant movement speed, broken automatic update, broken frustum culling).
Gah, that was painful. Obvious solution with object.lookAt doesn't work, forward facing direction (heading and attitude) is fine, but banking gets messed up:( Tried many fixes, none worked, so I just resorted to simple rotation around Y-axis based on direction vector.
Spline control points shouldn't be cycled, this produces freaky behaviors near start and end of path. Instead they have to be capped.
Also did some refactoring.