25개 이상의 토픽을 선택하실 수 없습니다. Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 

84 lines
2.4 KiB

  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. #pragma once
  8. class CatShaderData : public GpuShaderData
  9. {
  10. friend class CRenderer;
  11. public:
  12. //---
  13. CatShaderData(uint32_t vert_decl_flags, Shader* shader);
  14. //---
  15. void SetupDefaultData();
  16. virtual void SetupShaderDatas(mat4 const &model);
  17. //--
  18. virtual lol::String GetInVertexName() { return lol::String("in_vertex"); }
  19. virtual lol::String GetInNormalName() { return lol::String("in_normal"); }
  20. virtual lol::String GetInColorName() { return lol::String("in_color"); }
  21. virtual lol::String GetInTexCoordName() { return lol::String("in_texcoord"); }
  22. TextureUniform m_tex_uniform;
  23. float m_sprite_orientation;
  24. float m_sprite_flip;
  25. };
  26. class BtPhysTest : public WorldEntity
  27. {
  28. public:
  29. BtPhysTest(bool editor = false);
  30. virtual ~BtPhysTest();
  31. char const *GetName() { return "<BtPhysTest>"; }
  32. protected:
  33. virtual void TickGame(float seconds);
  34. virtual void TickDraw(float seconds, Scene &scene);
  35. void InitApp();
  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. int m_init_status;
  57. bool m_ready;
  58. lol::phys::Simulation* m_simulation;
  59. array<EasyConstraint*> m_constraint_list;
  60. array<PhysicsObject*, float> m_physobj_list;
  61. array<PhysicsObject*> m_ground_list;
  62. array<PhysicsObject*> m_platform_list;
  63. array<PhysicsObject*> m_character_list;
  64. array<PhysicsObject*> m_stairs_list;
  65. float m_loop_value;
  66. float m_target_timer;
  67. int m_cam_target;
  68. float m_fov_dp;
  69. float m_loc_dp;
  70. };