Line | |
---|
1 | // |
---|
2 | // demo-jnat |
---|
3 | // |
---|
4 | |
---|
5 | |
---|
6 | #if !defined __BO_H__ |
---|
7 | #define __BO_H__ |
---|
8 | |
---|
9 | class Bo : public WorldEntity |
---|
10 | { |
---|
11 | |
---|
12 | |
---|
13 | |
---|
14 | |
---|
15 | public: |
---|
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 | |
---|
29 | protected: |
---|
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 | |
---|
50 | private: |
---|
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.