meshes.lua 3.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145
  1. -- Meshes
  2. local S = minetest.get_translator("testnodes")
  3. local ocorner_cbox = {
  4. type = "fixed",
  5. fixed = {
  6. {-0.5, -0.5, -0.5, 0.5, -0.25, 0.5},
  7. {-0.5, -0.25, -0.25, 0.25, 0, 0.5},
  8. {-0.5, 0, 0, 0, 0.25, 0.5},
  9. {-0.5, 0.25, 0.25, -0.25, 0.5, 0.5}
  10. }
  11. }
  12. local tall_pyr_cbox = {
  13. type = "fixed",
  14. fixed = {
  15. { -0.5, -0.5, -0.5, 0.5, -0.25, 0.5 },
  16. { -0.375, -0.25, -0.375, 0.375, 0, 0.375},
  17. { -0.25, 0, -0.25, 0.25, 0.25, 0.25},
  18. { -0.125, 0.25, -0.125, 0.125, 0.5, 0.125}
  19. }
  20. }
  21. -- Normal mesh
  22. minetest.register_node("testnodes:mesh", {
  23. description = S("Mesh Test Node"),
  24. drawtype = "mesh",
  25. mesh = "testnodes_pyramid.obj",
  26. tiles = {"testnodes_mesh_stripes2.png"},
  27. paramtype = "light",
  28. collision_box = tall_pyr_cbox,
  29. groups = {dig_immediate=3},
  30. })
  31. -- Facedir mesh: outer corner slope
  32. minetest.register_node("testnodes:mesh_facedir", {
  33. description = S("Facedir Mesh Test Node"),
  34. drawtype = "mesh",
  35. mesh = "testnodes_ocorner.obj",
  36. tiles = {"testnodes_mesh_stripes.png"},
  37. paramtype = "light",
  38. paramtype2 = "facedir",
  39. collision_box = ocorner_cbox,
  40. groups = {dig_immediate=3},
  41. })
  42. minetest.register_node("testnodes:mesh_colorfacedir", {
  43. description = S("Color Facedir Mesh Test Node"),
  44. drawtype = "mesh",
  45. mesh = "testnodes_ocorner.obj",
  46. tiles = {"testnodes_mesh_stripes3.png"},
  47. paramtype = "light",
  48. paramtype2 = "colorfacedir",
  49. palette = "testnodes_palette_facedir.png",
  50. collision_box = ocorner_cbox,
  51. groups = {dig_immediate=3},
  52. })
  53. -- Wallmounted mesh: pyramid
  54. minetest.register_node("testnodes:mesh_wallmounted", {
  55. description = S("Wallmounted Mesh Test Node"),
  56. drawtype = "mesh",
  57. mesh = "testnodes_pyramid.obj",
  58. tiles = {"testnodes_mesh_stripes2.png"},
  59. paramtype = "light",
  60. paramtype2 = "wallmounted",
  61. collision_box = tall_pyr_cbox,
  62. groups = {dig_immediate=3},
  63. })
  64. minetest.register_node("testnodes:mesh_colorwallmounted", {
  65. description = S("Color Wallmounted Mesh Test Node"),
  66. drawtype = "mesh",
  67. mesh = "testnodes_pyramid.obj",
  68. tiles = {"testnodes_mesh_stripes3.png"},
  69. paramtype = "light",
  70. paramtype2 = "colorwallmounted",
  71. palette = "testnodes_palette_wallmounted.png",
  72. collision_box = tall_pyr_cbox,
  73. groups = {dig_immediate=3},
  74. })
  75. minetest.register_node("testnodes:mesh_double", {
  76. description = S("Double-sized Mesh Test Node"),
  77. drawtype = "mesh",
  78. mesh = "testnodes_pyramid.obj",
  79. tiles = {"testnodes_mesh_stripes2.png"},
  80. paramtype = "light",
  81. collision_box = tall_pyr_cbox,
  82. visual_scale = 2,
  83. groups = {dig_immediate=3},
  84. })
  85. minetest.register_node("testnodes:mesh_half", {
  86. description = S("Half-sized Mesh Test Node"),
  87. drawtype = "mesh",
  88. mesh = "testnodes_pyramid.obj",
  89. tiles = {"testnodes_mesh_stripes2.png"},
  90. paramtype = "light",
  91. collision_box = tall_pyr_cbox,
  92. visual_scale = 0.5,
  93. groups = {dig_immediate=3},
  94. })
  95. minetest.register_node("testnodes:mesh_waving1", {
  96. description = S("Plantlike-waving Mesh Test Node"),
  97. drawtype = "mesh",
  98. mesh = "testnodes_pyramid.obj",
  99. tiles = {"testnodes_mesh_stripes4.png^[multiply:#B0FFB0"},
  100. paramtype = "light",
  101. collision_box = tall_pyr_cbox,
  102. waving = 1,
  103. groups = {dig_immediate=3},
  104. })
  105. minetest.register_node("testnodes:mesh_waving2", {
  106. description = S("Leaflike-waving Mesh Test Node"),
  107. drawtype = "mesh",
  108. mesh = "testnodes_pyramid.obj",
  109. tiles = {"testnodes_mesh_stripes4.png^[multiply:#FFFFB0"},
  110. paramtype = "light",
  111. collision_box = tall_pyr_cbox,
  112. waving = 2,
  113. groups = {dig_immediate=3},
  114. })
  115. minetest.register_node("testnodes:mesh_waving3", {
  116. description = S("Liquidlike-waving Mesh Test Node"),
  117. drawtype = "mesh",
  118. mesh = "testnodes_pyramid.obj",
  119. tiles = {"testnodes_mesh_stripes4.png^[multiply:#B0B0FF"},
  120. paramtype = "light",
  121. collision_box = tall_pyr_cbox,
  122. waving = 3,
  123. groups = {dig_immediate=3},
  124. })