osgjs
osgjs copied to clipboard
FirstPersonManipulator does not compute home position as expected.
Pressing space bar when using FPS should get always the same position.
To reproduce you can try in the new sound-3D example. Move around and press space bar.
Hmm computeHomePosition works the same way as the orbitManipulator. It keeps the rotation but simply translate the eye at the right distance (from the bounding sphere/box).
It's more intuitive with orbitManipulator; e.g, if you see a model from behind, computeHomePosition will simply zoom out and won't screw your rotation.
There could be 2 functions, one that always returns the same camera, and one that would be consistent (override position/rotation). I don't really have strong opinion on it.
@cedricpinson
In CADManipulator I implemented the setHomePosition method (https://github.com/cedricpinson/osgjs/blob/master/sources/osgGA/CADManipulator.js#L192), which also exists in OSG.
When computing home position I was expecting the "home" to be always the same, and also you can set it from outside, which I believe is the behaviour in OSG.
Also maybe manipulators are needing a revamp. So I leave this issue for the record.