Minetest Mod: Adds animations to the players' head.
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.

73 lines
1.9KB

  1. -- Bone alias
  2. local BODY = "Body"
  3. local HEAD = "Head"
  4. local CAPE = "Cape"
  5. local LARM = "Arm_Left"
  6. local RARM = "Arm_Right"
  7. local LLEG = "Leg_Left"
  8. local RLEG = "Leg_Right"
  9. local BONE_POSITIONS = {
  10. MTG_0_4_x = {
  11. [BODY] = {x = 0, y = -3.5, z = 0},
  12. [HEAD] = {x = 0, y = 6.5, z = 0},
  13. [CAPE] = {x = 0, y = 6.5, z = 1.2},
  14. [LARM] = {x = 3, y = 5.5, z = 0},
  15. [RARM] = {x = -3, y = 5.5, z = 0},
  16. [LLEG] = {x = 1, y = 0, z = 0},
  17. [RLEG] = {x = -1, y = 0, z = 0},
  18. body_sit = {x = 0, y = -5.5, z = 0},
  19. body_lay = {x = 0, y = -5.5, z = 0},
  20. },
  21. MTG_5_0_x = {
  22. [BODY] = {x = 0, y = 6.25, z = 0},
  23. [HEAD] = {x = 0, y = 6.5, z = 0},
  24. [CAPE] = {x = 0, y = 6.5, z = 1.2},
  25. [LARM] = {x = 3, y = 5.5, z = 0},
  26. [RARM] = {x = -3, y = 5.5, z = 0},
  27. [LLEG] = {x = 1, y = 0, z = 0},
  28. [RLEG] = {x = -1, y = 0, z = 0},
  29. body_sit = {x = 0, y = -5, z = 0},
  30. body_lay = {x = 0, y = -5, z = 0},
  31. },
  32. }
  33. local BONE_ROTATIONS = {
  34. MTG_0_4_x = {
  35. [BODY] = {x = 0, y = 0, z = 0},
  36. [HEAD] = {x = 0, y = 0, z = 0},
  37. [CAPE] = {x = 0, y = 0, z = 0},
  38. [LARM] = {x = 0, y = 0, z = 0},
  39. [RARM] = {x = 0, y = 0, z = 0},
  40. [LLEG] = {x = 0, y = 0, z = 0},
  41. [RLEG] = {x = 0, y = 0, z = 0},
  42. body_sit = {x = 0, y = 0, z = 0},
  43. body_lay = {x = 270, y = 0, z = 0},
  44. },
  45. MTG_5_0_x = {
  46. [BODY] = {x = 0, y = 0, z = 0},
  47. [HEAD] = {x = 0, y = 0, z = 0},
  48. [CAPE] = {x = 0, y = 0, z = 0},
  49. [LARM] = {x = 0, y = 0, z = 0},
  50. [RARM] = {x = 0, y = 0, z = 0},
  51. [LLEG] = {x = 0, y = 0, z = 0},
  52. [RLEG] = {x = 0, y = 0, z = 0},
  53. body_sit = {x = 0, y = 0, z = 0},
  54. body_lay = {x = 270, y = 0, z = 0},
  55. },
  56. }
  57. local model = minetest.global_exists("player_api") and "MTG_5_0_x" or "MTG_0_4_x"
  58. local BONE_POSITION = BONE_POSITIONS[model]
  59. local BONE_ROTATION = BONE_ROTATIONS[model]
  60. if not BONE_POSITION or not BONE_ROTATION then
  61. error("Internal error: invalid player_model_version: " .. PLAYER_MODEL_VERSION)
  62. end
  63. return BONE_POSITION, BONE_ROTATION