IrrModel.h
Go to the documentation of this file.
1 #ifndef __IRR_MODEL_H__
2 #define __IRR_MODEL_H__
3 
4 #include <irrlicht/irrlicht.h>
5 #include <hrpModel/ModelLoaderUtil.h>
6 
7 class GLbody;
8 class GLcamera;
9 class GLlink;
10 
11 class GLscene
12 {
13 public:
14  GLscene();
15  ~GLscene();
16  static GLscene *getInstance();
17  bool init(int w=640, int h=480);
18  void draw();
19  GLbody *addBody(OpenHRP::BodyInfo_var i_binfo);
20  void setCamera(GLcamera *i_camera);
22  irr::scene::ISceneManager *getSceneManager();
23  irr::video::IVideoDriver *getVideoDriver();
24 private:
25  static GLscene *m_scene;
26  irr::IrrlichtDevice *m_device;
28  irr::scene::ICameraSceneNode *m_cnode;
29  irr::IEventReceiver *m_receiver;
30 };
31 
32 class GLcamera
33 {
34 public:
35  GLcamera(const OpenHRP::SensorInfo& i_info,
36  irr::scene::ISceneNode *i_node);
37  GLcamera(irr::scene::ISceneNode *i_node);
38  void setCameraParameters(irr::scene::ICameraSceneNode *i_camera);
39  void updateCameraTransform(irr::scene::ICameraSceneNode *i_camera);
40  const char *name();
41  int width();
42  int height();
43  float near();
44  float far();
45  float fovy();
46  void getAbsTransform(double *o_T);
47 private:
48  irr::scene::ISceneNode *m_node;
49  float m_near, m_far, m_fovy;
50  int m_width, m_height;
51 };
52 
53 class GLbody : public irr::scene::ISceneNode
54 {
55 public:
56  GLbody(irr::scene::ISceneNode *i_parent,
57  irr::scene::ISceneManager *i_mgr,
58  irr::s32 i_id,
59  OpenHRP::BodyInfo_var i_binfo);
60  virtual void render() {}
61  virtual const irr::core::aabbox3d<irr::f32>& getBoundingBox() const {
62  return m_box;
63  }
64  void setPosture(double *i_angles, double *i_pos, double *i_rpy);
65  GLcamera *findCamera(const char *i_name);
66 private:
67  irr::core::aabbox3d<irr::f32> m_box;
68  std::vector<GLlink *> m_links;
69  GLlink *m_root;
70 };
71 
72 #endif
GLscene()
Definition: GLmodel.cpp:347
void init()
Definition: GLmodel.cpp:362
void addBody(GLbody *i_body)
Definition: GLmodel.cpp:293
png_infop png_charpp name
virtual void render()
Definition: IrrModel.h:60
irr::scene::ISceneNode * m_node
Definition: IrrModel.h:48
GLcamera * m_camera
Definition: GLmodel.h:98
png_infop png_uint_32 * width
GLcamera * m_defaultCamera
Definition: IrrModel.h:27
Definition: GLbody.h:11
GLcamera * getCamera()
Definition: GLmodel.cpp:429
static GLscene * getInstance()
Definition: GLmodel.cpp:332
static GLscene * m_scene
Definition: GLmodel.h:96
png_infop png_uint_32 png_uint_32 * height
irr::IEventReceiver * m_receiver
Definition: IrrModel.h:29
irr::IrrlichtDevice * m_device
Definition: IrrModel.h:26
irr::scene::ISceneManager * getSceneManager()
Definition: IrrModel.cpp:572
void draw()
Definition: IrrModel.cpp:496
void setCamera(GLcamera *i_camera)
Definition: GLmodel.cpp:420
irr::scene::ICameraSceneNode * m_cnode
Definition: IrrModel.h:28
irr::video::IVideoDriver * getVideoDriver()
Definition: IrrModel.cpp:577
~GLscene()
Definition: GLmodel.cpp:357
irr::core::aabbox3d< irr::f32 > m_box
Definition: IrrModel.h:67
float m_near
Definition: IrrModel.h:49
virtual const irr::core::aabbox3d< irr::f32 > & getBoundingBox() const
Definition: IrrModel.h:61


hrpsys
Author(s): AIST, Fumio Kanehiro
autogenerated on Sat Dec 17 2022 03:52:20