openframeworks / openframeworks/openFrameworks
make ofEasyCam::reset() virtual, or allow non-default reset positions
Nobody has claimed this yet.
- Dominant language
- C++
- Stars
- 10.4k
- Forks
- 2.6k
- Avg merge
- 1d 21h
- Merged PRs (30d)
- 9
Description
i want to have the double-click behavior return ofEasyCam to a nonstandard resting position. i thought i could do this by inheriting ofEasyCam and overriding reset(), but it's not a virtual method.
in the meantime i've done something really terrible in my code. please forgive me.
ofVec3f position = getPosition();
ofVec3f basePosition = ofVec3f(0, 0, getDistance());
if(position == basePosition) {
// reset to a better position
}
if this function is called by update() or draw() it causes a one-frame flicker where the usual ofEasyCam default position appears for a moment, and then it flips it to the "correct" spot.
in theory the user could move the camera to a spot that causes it to reset, but in practice i think it's very unlikely. regardless, the above solution is "wrong" and it would be better to have virtual method or reset position settings.
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start with ofEasyCam::reset() and inspect how it is reached from update() or draw(). Determine whether the requested behavior should support overriding reset() or configuring a non-default reset position, then verify that double-click reset reaches the chosen resting position without a one-frame flicker.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- cpp
- Domain
- computer-graphics
- Issue type
- Feature
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100