-
Notifications
You must be signed in to change notification settings - Fork 3
/
RobotUpdator.h
51 lines (44 loc) · 1.2 KB
/
RobotUpdator.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
//
// RobotData.h
// testlibx
//
// Created by MayoKaze on 4/28/13.
// Copyright (c) 2013 MayoKaze. All rights reserved.
//
#ifndef __testlibx__RobotData__
#define __testlibx__RobotData__
#include <osg/Node>
#include <osgSim/DOFTransform>
#include <osg/NodeVisitor>
#include <osg/MatrixTransform>
#include <osg/Geode>
#include <osg/Geometry>
#include <osg/Drawable>
#include <osg/ShapeDrawable>
#include <osg/Material>
#include <map>
#include "Commander.h"
#include "util"
class RobotUpdator : public osg::Referenced
{
public:
RobotUpdator(osg::Node*,double* as=NULL);
virtual ~RobotUpdator();
// void applyRotation();
void pressKey(char key);
void releaseKey(char key);
void updateRotation();
inline bool onRotation(){
return NULL != onRotCmd;
};
protected:
osg::Node* robot;
Commander *onRotCmd;
std::map<char,Commander*> commandMap;
// std::map<const char*,osg::Vec4f> rotMap;
osg::Switch* findSwitch(osg::Group* node);
// void setGeodeColor( osg::Geode* node, const osg::Vec4& color );
// void setNodeColor( osg::Node* node, const osg::Vec4& newColor );
// void resetNodeColor(osg::Node* node);
};
#endif /* defined(__testlibx__RobotData__) */