source: trunk/games/demo-jnat/bo.h @ 1743

Last change on this file since 1743 was 1743, checked in by Jnat, 7 years ago
File size: 772 bytes
Line 
1//
2// demo-jnat
3//
4
5
6#if !defined __BO_H__
7#define __BO_H__
8
9class Bo : public WorldEntity
10{
11
12
13
14
15public:
16    Bo()
17      : m_ready(false)
18    {
19                m_bodymesh.Compile("[sc#f20 afcb15 2 2 0.4 tx7.5]");
20    }
21
22    ~Bo()
23    {
24
25    }
26
27    char const *GetName() { return "<bo>"; }
28
29protected:
30    virtual void TickGame(float seconds)
31    {
32        WorldEntity::TickGame(seconds);
33    }
34
35    virtual void TickDraw(float seconds)
36    {
37        WorldEntity::TickDraw(seconds);
38
39        if (!m_ready)
40        {
41            m_bodymesh.MeshConvert();
42            m_ready = true;
43        }
44
45        mat4 model = mat4::translate(m_position) * mat4(m_rotation);
46
47        m_bodymesh.Render(model);
48    }
49
50private:
51    EasyMesh m_bodymesh;
52    bool m_ready;
53
54};
55
56#endif /* __PLAYER_H__ */
57
Note: See TracBrowser for help on using the repository browser.