VISH
0.2
|
Implementation of a camera which interacts with the mouse. More...
#include </home/werner/origo/vish/ocean/vcamera/VCameraNavigator.hpp>
Implementation of a camera which interacts with the mouse.
It is a VEnvironmentRenderObject, i.e. its settings of the OpenGL state influences all consecutive layers.
Three functions need to be overloaded:
A fourth function is optional:
Note that environment_render() may be called any time and more often than update(), in any case independently. It may even be called in a thread simulateneously, so it must be thread safe. In no case the render() function may change the object or static variables. All state variables that need to be transported from one render to the next call need to be placed in the local context state.
bool CameraNavigator::request | ( | VRequest & | request, |
double | precision, | ||
const WeakVObjectPtr & | ImmediateRequestor, | ||
const WeakVObjectPtr & | RootRequestor | ||
) | [virtual] |
Request an action, to be performed with a certain precision.
Its main purpose is to iterate all parameters and forward the request to them. If this all parameters have fullfilled their request(), then the virtual update() function is called.
In rare case, an object might want to overload this function, for instance when request shall be forwarded to input objects only under certain circumstances (e.g. an Viewer object that is not visible at the moment).
VRequest::Incomplete | might occur if a synchroneous request is issued but some operations are still in asynchroneous construction. This is the case when a synchroneous request is issued after an asynchroneous one that has not yet been completed. In such a case, the caller may just repeat the same request. The caller may and should do something else in the meantime, as the async request may still take a while to finish. |
Check the age of the local state
Some parameter has changed, so call object's update().
Reimplemented from Wizt::VObject.
bool CameraNavigator::update | ( | VRequest & | , |
double | precision | ||
) | [virtual] |
Virtual update function that implements some heavy action on the object.
Update function.
It is called only if any input object is newer than the current object. It must return true on successful completion. However, the object may touch() itself in the update() routine. Then, it will get a newer time than all input objects, which will trigger all dependent objects as well.
Reimplemented from Wizt::VObject.