BrainTrain
All Classes Namespaces Files Functions Variables Macros Pages
brtr::DrunkenInteractionCallback Class Reference

Callback for the drunk effect. More...

#include <DrunkenInteractionCallback.h>

Inheritance diagram for brtr::DrunkenInteractionCallback:
brtr::BaseInteractionCallback

Public Member Functions

 DrunkenInteractionCallback (osg::Node *camera, osg::Camera *hudCam, osg::Switch *geometrySwitch, int width, int height)
 Constructor. More...
 
virtual void setText ()
 sets the text on screen. Subclasses must override to set its own (info)text More...
 
- Public Member Functions inherited from brtr::BaseInteractionCallback
 BaseInteractionCallback (osg::Node *attachTo, osg::Camera *hudCam, int width, int height)
 Constructor. More...
 
virtual void operator() (osg::Node *node, osg::NodeVisitor *nv)
 
void clearText ()
 
void reactivate ()
 
osg::ref_ptr< osg::Node > getNode () const
 
void setNode (osg::ref_ptr< osg::Node > val)
 

Protected Member Functions

virtual void interact (osg::Node *, osg::NodeVisitor *)
 Drunk effect is simulated by changing the FOV of the projection matrix. More...
 

Private Attributes

int _startTime
 
osg::ref_ptr< osg::Switch > _geometrySwitch
 
osg::ref_ptr
< osgAnimation::LinearMotion > 
_motion
 
bool _backwards
 

Additional Inherited Members

- Protected Attributes inherited from brtr::BaseInteractionCallback
osg::ref_ptr< osg::Node > _attachTo
 
osg::ref_ptr< osg::Camera > _hudCam
 
bool _done
 
osg::ref_ptr< osgText::Text > _text
 

Detailed Description

Callback for the drunk effect.

Author
Gleb Ostrowski
Version
1.0
Date
2014

Definition at line 15 of file DrunkenInteractionCallback.h.

Constructor & Destructor Documentation

brtr::DrunkenInteractionCallback::DrunkenInteractionCallback ( osg::Node *  camera,
osg::Camera *  hudCam,
osg::Switch *  geometrySwitch,
int  width,
int  height 
)

Constructor.

Parameters
camerathe camera, whichs projection matrix will be manipulated
hudCam
geometrySwitchswitch containing the bottle, for removing it after the interaction
widthscreenwidth
heightscreenheight

Definition at line 5 of file DrunkenInteractionCallback.cpp.

Member Function Documentation

void brtr::DrunkenInteractionCallback::interact ( osg::Node *  node,
osg::NodeVisitor *  nv 
)
protectedvirtual

Drunk effect is simulated by changing the FOV of the projection matrix.

Parameters
notneeded
notneeded

Implements brtr::BaseInteractionCallback.

Definition at line 13 of file DrunkenInteractionCallback.cpp.

void brtr::DrunkenInteractionCallback::setText ( )
virtual

sets the text on screen. Subclasses must override to set its own (info)text

Implements brtr::BaseInteractionCallback.

Definition at line 44 of file DrunkenInteractionCallback.cpp.

Member Data Documentation

bool brtr::DrunkenInteractionCallback::_backwards
private

Definition at line 42 of file DrunkenInteractionCallback.h.

osg::ref_ptr<osg::Switch> brtr::DrunkenInteractionCallback::_geometrySwitch
private

Definition at line 40 of file DrunkenInteractionCallback.h.

osg::ref_ptr<osgAnimation::LinearMotion> brtr::DrunkenInteractionCallback::_motion
private

Definition at line 41 of file DrunkenInteractionCallback.h.

int brtr::DrunkenInteractionCallback::_startTime
private

Definition at line 39 of file DrunkenInteractionCallback.h.


The documentation for this class was generated from the following files: