Hi everyone, i'm newbie in osg, trying to learn from the osg tutorials. Now i'm 
trying to implement tutorial 9.1 (Basic Keyboard Input) that allow the tank to 
move forward, started with Tutorial 9 from NPS that allow a tank to rotate his 
gun.

I tried to follow the tutorial step by step,i t seems that i'm close but i'm 
getting 2 erros when compiling:

1>.\testKeyboard.cpp(35) : error C2061: syntax error : identifier 
'tankInputDeviceStateType'
1>.\testKeyboard.cpp(35) : fatal error C1903: unable to recover from previous 
error(s); stopping compilation

refering to tankInputDeviceStateType that is present in myKeyboardEventHandler 
class:


Code:

class myKeyboardEventHandler : public osgGA::GUIEventHandler
        {
        public:
                myKeyboardEventHandler(tankInputDeviceStateType* tids)
                {
                        tankInputDeviceState = tids;
                }
                
                virtual bool handle(const osgGA::GUIEventAdapter& 
ea,osgGA::GUIActionAdapter&);
                virtual void accept(osgGA::GUIEventHandlerVisitor& v)   { 
v.visit(*this); };
        };

        bool myKeyboardEventHandler::handle(const osgGA::GUIEventAdapter& 
ea,osgGA::GUIActionAdapter& aa)
        {
                switch(ea.getEventType())
                {
                case(osgGA::GUIEventAdapter::KEYDOWN):
                {
                        switch(ea.getKey())
                        {
                        case 'w':
                                tankInputDeviceState->moveFwdRequest = true;
                                return false;
                                break;
                        default:
                        return false;
                        } 
                }
        default:
        return false;
                }
    }





Thanks for any help.

------------------
Read this topic online here:
http://forum.openscenegraph.org/viewtopic.php?p=44978#44978





_______________________________________________
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org

Reply via email to