Difference between revisions of "pointed thing"

From Minetest Developer Wiki
Jump to navigation Jump to search
(→‎Examples: ?sort)
(→‎Examples: use a wikitable)
Line 18: Line 18:
 
{type="object", ref=ObjectRef}
 
{type="object", ref=ObjectRef}
 
</source>
 
</source>
 +
{| class="wikitable"
 +
!image
 +
!Node coordinates
 +
!pointed_thing.above
 +
!pointed_thing.under
 +
|-
 +
| [[File:pointed_thing_1.png|200px]]
 +
| <code>(49,6,-13)</code>
 +
| <code>{x = 49, y = 7, z = -13}</code>
 +
| <code>{x = 49, y = 6, z = -13}</code>
 +
|-
 +
| [[File:pointed_thing_2.png|200px]]
  
[[File:pointed_thing_1.png|200px]]
+
| <code>(50,7,-13)</code>
 
+
| <code>{x = 49, y = 7, z = -13}</code>
Node coordinates are <code>(49,6,-13)</code>, <code>pointed_thing</code> is <code>{type = "node", above = {x = 49, y = 7, z = -13}, under = {x = 49, y = 6, z = -13}}</code>
+
| <code>{x = 50, y = 7, z = -13}</code>
 
+
|-
[[File:pointed_thing_2.png|200px]]
+
| [[File:pointed_thing_3.png|200px]]
 
 
Node coordinates are <code>(50,7,-13)</code>, <code>pointed_thing</code> is <code>{type = "node", above = {x = 49, y = 7, z = -13}, under = {x = 50, y = 7, z = -13}}</code>
 
 
 
[[File:pointed_thing_3.png|200px]]
 
 
 
Node coordinates are <code>(49,7,-14)</code>, <code>pointed_thing</code> is <code>{type = "node", above = {x = 49, y = 7, z = -13}, under = {x = 49, y = 7,  z = -14}}</code>
 
  
 +
| <code>(49,7,-14)</code>
 +
| <code>{x = 49, y = 7, z = -13}</code>
 +
| <code>{x = 49, y = 7,  z = -14}</code>
 +
|}
 
[[Category:Types]]
 
[[Category:Types]]

Revision as of 16:42, 6 February 2014

Table {type = …, under = …, above = …, ref = …}

  • type
  • "nothing"
  • "node"
  • "object"

Notes

  • The utility function minetest.get_pointed_thing_position(pointed_thing, above) can be used to calculate the position of pointed_thing without having to distinguish all possible types.

Examples

{type="nothing"}
{type="node", under=pos, above=pos}
{type="object", ref=ObjectRef}
image Node coordinates pointed_thing.above pointed_thing.under
pointed thing 1.png (49,6,-13) {x = 49, y = 7, z = -13} {x = 49, y = 6, z = -13}
pointed thing 2.png (50,7,-13) {x = 49, y = 7, z = -13} {x = 50, y = 7, z = -13}
pointed thing 3.png (49,7,-14) {x = 49, y = 7, z = -13} {x = 49, y = 7, z = -14}