32 #ifndef TrackballManipulator_INCLUDE_ONCE 33 #define TrackballManipulator_INCLUDE_ONCE 44 class ActorCollection;
66 typedef enum { NoMode, RotationMode, TranslationMode, ZoomMode }
ETrackballMode;
72 mRotationSpeed(1.0f), mTranslationSpeed(1.0f), mZoomSpeed(1.0f)
74 VL_DEBUG_SET_OBJECT_NAME()
83 virtual void mouseMoveEvent(
int x,
int y);
85 virtual void enableEvent(
bool enabled);
166 void adjustView(
const AABB& aabb,
const vec3& dir,
const vec3& up, real bias=1.0f);
175 void adjustView(
Rendering* rendering,
const vec3& dir,
const vec3& up, real bias=1.0f);
179 mat4 trackballRotation(
int x,
int y);
181 vec3 computeVector(
int x,
int y);
184 ETrackballMode
mode()
const {
return mMode; }
vec3 pivot() const
The center point around which the camera will rotate.
int rotationButton() const
Mouse button used to rotate.
virtual void initEvent()
Event generated when the bound OpenGLContext bocomes initialized or when the event listener is bound ...
The UIEventListener class listens to the events emitted by an OpenGLContext.
void setRotationButton(int mouse_button)
Mouse button used to rotate.
virtual void fileDroppedEvent(const std::vector< String > &)
Event generated when one or more files are dropped on the bound OpenGLContext's area.
ETrackballMode mode() const
Returns the current trackball manipulator state.
This class lets you rotate a Camera or a Transform node using a virtual trackball.
Transform * transform()
If NULL the trackball will manipulate the camera transform, if non NULL the trackball will manipulate...
Represents an OpenGL context, possibly a widget or a pbuffer, which can also respond to keyboard...
TrackballManipulator()
Constructor.
virtual void visibilityEvent(bool)
Event generated when the bound OpenGLContext is shown or hidden.
virtual void destroyEvent()
Event generated right before the bound OpenGLContext is destroyed.
void setCamera(Camera *camera)
The camera through which the trackball manipulator is used.
void setRotationSpeed(float speed)
Rotation speed multiplicative factor (default = 1).
#define VL_INSTRUMENT_CLASS(ClassName, BaseClass)
Visualization Library main namespace.
ref< Transform > mTransform
int translationButton() const
Mouse button used to translate the view.
void setTransform(Transform *tr)
If NULL the trackball will manipulate the camera transform, if non NULL the trackball will manipulate...
The AABB class implements an axis-aligned bounding box using vl::real precision.
void setTranslationButton(int mouse_button)
Mouse button used to translate the view.
virtual void resizeEvent(int, int)
Event generated when the bound OpenGLContext is resized.
The SceneManager class is the base class for all the scene managers.
virtual void addedListenerEvent(OpenGLContext *)
Event generated whenever a listener is bound to an OpenGLContext context.
The Rendering class collects all the information to perform the rendering of a scene.
#define VLGRAPHICS_EXPORT
float rotationSpeed() const
Rotation speed multiplicative factor (default = 1).
Defined as a simple subclass of Collection<Actor>, see Collection for more information.
float translationSpeed() const
Translation speed multiplicative factor (default = 1).
float zoomSpeed() const
Zoom speed multiplicative factor (default = 1).
virtual void updateEvent()
Event generated when the bound OpenGLContext does not have any other message to process and OpenGLCon...
The ref<> class is used to reference-count an Object.
Represents a virtual camera defining, among other things, the point of view from which scenes can be ...
void setPivot(vec3 pivot)
The center point around which the camera will rotate.
void setTranslationSpeed(float speed)
Translation speed multiplicative factor (default = 1).
virtual void keyReleaseEvent(unsigned short, EKey)
Event generated when a key is released.
virtual void mouseWheelEvent(int)
Event generated when the mouse wheel rotated.
int zoomButton() const
Mouse button used to zoom.
virtual void removedListenerEvent(OpenGLContext *)
Event generated whenever a listener is unbound from an OpenGLContext context.
void setZoomSpeed(float speed)
Zoom speed multiplicative factor (default = 1).
void setZoomButton(int mouse_button)
Mouse button used to zoom.
Camera * camera()
The camera through which the trackball manipulator is used.
virtual void keyPressEvent(unsigned short, EKey)
Event generated when a key is pressed.