humanoid_specs.h 2.3 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364
  1. #pragma once
  2. #include <cstdint>
  3. namespace Render::GL {
  4. struct HumanProportions {
  5. static constexpr float TOTAL_HEIGHT = 1.80F;
  6. static constexpr float HEADS_TALL = 7.5F;
  7. static constexpr float HEAD_HEIGHT = TOTAL_HEIGHT / HEADS_TALL;
  8. static constexpr float GROUND_Y = 0.0F;
  9. static constexpr float HEAD_TOP_Y = GROUND_Y + TOTAL_HEIGHT;
  10. static constexpr float CHIN_Y = HEAD_TOP_Y - HEAD_HEIGHT;
  11. static constexpr float HEAD_NECK_OVERLAP = 0.025F;
  12. static constexpr float HEAD_CENTER_Y =
  13. (HEAD_TOP_Y + CHIN_Y) * 0.5F - HEAD_NECK_OVERLAP;
  14. static constexpr float NECK_BASE_Y = CHIN_Y - 0.045F;
  15. static constexpr float SHOULDER_Y = NECK_BASE_Y - 0.09F;
  16. static constexpr float CHEST_Y = SHOULDER_Y - 0.27F;
  17. static constexpr float WAIST_Y = CHEST_Y - 0.18F;
  18. static constexpr float UPPER_LEG_LEN = 0.50F;
  19. static constexpr float LOWER_LEG_LEN = 0.47F;
  20. static constexpr float KNEE_Y = WAIST_Y - UPPER_LEG_LEN;
  21. static constexpr float SHOULDER_WIDTH = HEAD_HEIGHT * 1.82F;
  22. static constexpr float HEAD_RADIUS = HEAD_HEIGHT * 0.41F;
  23. static constexpr float NECK_RADIUS = HEAD_RADIUS * 0.39F;
  24. static constexpr float TORSO_TOP_R = HEAD_RADIUS * 1.25F;
  25. static constexpr float TORSO_BOT_R = HEAD_RADIUS * 1.12F;
  26. static constexpr float UPPER_ARM_R = HEAD_RADIUS * 0.45F;
  27. static constexpr float FORE_ARM_R = HEAD_RADIUS * 0.32F;
  28. static constexpr float HAND_RADIUS = HEAD_RADIUS * 0.28F;
  29. static constexpr float UPPER_LEG_R = HEAD_RADIUS * 0.64F;
  30. static constexpr float LOWER_LEG_R = HEAD_RADIUS * 0.44F;
  31. static constexpr float UPPER_ARM_LEN = 0.32F;
  32. static constexpr float FORE_ARM_LEN = 0.27F;
  33. static constexpr float HIP_LATERAL_OFFSET = 0.10F;
  34. static constexpr float HIP_VERTICAL_OFFSET = -0.02F;
  35. static constexpr float FOOT_Y_OFFSET_DEFAULT = 0.022F;
  36. static constexpr float TORSO_DEPTH_FACTOR_BASE = 0.55F;
  37. static constexpr float TORSO_DEPTH_FACTOR_MIN = 0.40F;
  38. static constexpr float TORSO_DEPTH_FACTOR_MAX = 0.85F;
  39. static constexpr float TORSO_TOP_COVER_OFFSET = -0.03F;
  40. static constexpr float EPSILON_SMALL = 1e-5F;
  41. static constexpr float EPSILON_TINY = 1e-6F;
  42. static constexpr float EPSILON_VECTOR = 1e-8F;
  43. };
  44. enum class MaterialType : uint8_t {
  45. Cloth = 0,
  46. Leather = 1,
  47. Metal = 2,
  48. Wood = 3,
  49. Skin = 4
  50. };
  51. } // namespace Render::GL