You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

пре 12 година
пре 11 година
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081
  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. ShaderTexture m_shader_texture;
  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. private:
  37. enum
  38. {
  39. KEY_MOVE_FORWARD,
  40. KEY_MOVE_BACK,
  41. KEY_MOVE_LEFT,
  42. KEY_MOVE_RIGHT,
  43. KEY_MOVE_UP,
  44. KEY_MOVE_DOWN,
  45. KEY_MOVE_JUMP,
  46. KEY_QUIT,
  47. KEY_MAX,
  48. };
  49. TileSet* m_cat_texture;
  50. Shader* m_cat_shader;
  51. CatShaderData* m_cat_sdata;
  52. Camera* m_camera;
  53. Controller * m_controller;
  54. Light * m_light1;
  55. Light * m_light2;
  56. bool m_ready;
  57. lol::phys::Simulation* m_simulation;
  58. Array<EasyConstraint*> m_constraint_list;
  59. Array<PhysicsObject*, float> m_physobj_list;
  60. Array<PhysicsObject*> m_ground_list;
  61. Array<PhysicsObject*> m_platform_list;
  62. Array<PhysicsObject*> m_character_list;
  63. Array<PhysicsObject*> m_stairs_list;
  64. float m_loop_value;
  65. float m_target_timer;
  66. int m_cam_target;
  67. };
  68. #endif // __BTPHYSTEST_H__