vrecko
virtual reality framework
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
subblock.h
Go to the documentation of this file.
1 #ifndef _SUBBLOCK
2 #define _SUBBLOCK 1
3 
4 #include <string>
5 #include "subblock_animation.h"
6 
7 
8 //using namespace vrecko;
9 using namespace std;
10 
11 namespace ArtificialWorld
12 {
14  class SubBlock{
15  public:
16  SubBlock(void);
17  ~SubBlock(void){};
18 
20  void SetFileName(string fname) { filename = fname; };
22  void SetPosition(osg::Vec3 pos) { position = pos; };
24  void SetRotation(osg::Quat rot) { rotation = rot; };
26  void SetMaxVisibleDistance(unsigned long dist) { maxVisibleDistance = dist; hasMaxVisibleDistance = true; };
28  void SetSubBlockType(string sbType) { subBlockType = sbType; };
29 
31  bool HasMaxVisibleDistance(void) { return hasMaxVisibleDistance; };
32 
34  osg::Vec3 GetPosition(void) { return position; };
36  osg::Quat GetRotation(void) { return rotation; };
38  string GetFileName(void) { return filename; };
40  unsigned long GetMaxVisibleDistance(void) { return maxVisibleDistance; };
42  string GetSubBlockType(void) { return subBlockType; };
43 
46  if(hasAnimation)
47  return &animation;
48  else
49  return NULL;
50  };
52  void SetAnimation(void)
53  {
54  hasAnimation = true;
55  };
57  bool HasAnimation(void){ return hasAnimation; };
59  void DeleteAnimation(void){
60  hasAnimation = false;
61  animation.ClearAnimation();
62  };
63 
64  protected:
66  osg::Vec3 position;
68  osg::Quat rotation;
70  unsigned long maxVisibleDistance;
72  string filename;
74  string subBlockType;
75 
78 
83  };
84 }
85 
86 #endif
87