Nie możesz wybrać więcej, niż 25 tematów Tematy muszą się zaczynać od litery lub cyfry, mogą zawierać myślniki ('-') i mogą mieć do 35 znaków.

btphystest.h 2.4 KiB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586
  1. //
  2. // BtPhysTest
  3. //
  4. // Copyright: (c) 2009-2013 Benjamin "Touky" Huet <huet.benjamin@gmail.com>
  5. // (c) 2012 Sam Hocevar <sam@hocevar.net>
  6. //
  7. #if !defined __BTPHYSTEST_H__
  8. #define __BTPHYSTEST_H__
  9. class CatShaderData : public GpuShaderData
  10. {
  11. friend class CRenderer;
  12. public:
  13. //---
  14. CatShaderData(uint32_t vert_decl_flags, Shader* shader);
  15. //---
  16. void SetupDefaultData();
  17. virtual void SetupShaderDatas(mat4 const &model);
  18. //--
  19. virtual lol::String GetInVertexName() { return lol::String("in_vertex"); }
  20. virtual lol::String GetInNormalName() { return lol::String("in_normal"); }
  21. virtual lol::String GetInColorName() { return lol::String("in_color"); }
  22. virtual lol::String GetInTexCoordName() { return lol::String("in_texcoord"); }
  23. TextureUniform m_tex_uniform;
  24. float m_sprite_orientation;
  25. float m_sprite_flip;
  26. };
  27. class BtPhysTest : public WorldEntity
  28. {
  29. public:
  30. BtPhysTest(bool editor = false);
  31. virtual ~BtPhysTest();
  32. char const *GetName() { return "<BtPhysTest>"; }
  33. protected:
  34. virtual void TickGame(float seconds);
  35. virtual void TickDraw(float seconds);
  36. void InitApp();
  37. private:
  38. enum
  39. {
  40. KEY_MOVE_FORWARD,
  41. KEY_MOVE_BACK,
  42. KEY_MOVE_LEFT,
  43. KEY_MOVE_RIGHT,
  44. KEY_MOVE_UP,
  45. KEY_MOVE_DOWN,
  46. KEY_MOVE_JUMP,
  47. KEY_QUIT,
  48. KEY_MAX,
  49. };
  50. TileSet* m_cat_texture;
  51. Shader* m_cat_shader;
  52. CatShaderData* m_cat_sdata;
  53. Camera* m_camera;
  54. Controller * m_controller;
  55. Light * m_light1;
  56. Light * m_light2;
  57. int m_init_status;
  58. bool m_ready;
  59. lol::phys::Simulation* m_simulation;
  60. Array<EasyConstraint*> m_constraint_list;
  61. Array<PhysicsObject*, float> m_physobj_list;
  62. Array<PhysicsObject*> m_ground_list;
  63. Array<PhysicsObject*> m_platform_list;
  64. Array<PhysicsObject*> m_character_list;
  65. Array<PhysicsObject*> m_stairs_list;
  66. float m_loop_value;
  67. float m_target_timer;
  68. int m_cam_target;
  69. float m_fov_dp;
  70. float m_loc_dp;
  71. };
  72. #endif // __BTPHYSTEST_H__