Compare commits

...

4 Commits

  1. 2
      README.md
  2. BIN
      docs/screenshot.png
  3. 89
      entity.lua
  4. 6
      init.lua
  5. BIN
      models/arrows.blend
  6. 265
      models/nc_extended_rotating_corner.obj
  7. 469
      models/nc_extended_rotating_edge.obj
  8. 223
      models/nc_extended_rotating_face.obj
  9. 2
      state.lua
  10. BIN
      textures/nc_extended_rotating_arrows.png
  11. 9
      utility.lua

@ -5,6 +5,8 @@ This mod follows in the footsteps of the useful [Extended Placement] mod for
as optics and doors easily, without having to cycle through all possible
rotations every time.
![Screenshot](docs/screenshot.png)
Rotating a node can be done in three ways:
- Click near the center of a face, and the node rotates 90° around it.

Binary file not shown.

After

Width:  |  Height:  |  Size: 205 KiB

@ -0,0 +1,89 @@
local minetest, vector, math_rad, math_random
= minetest, vector, math.rad, math.random
local get_node_active_selection_box = nc_extended_rotating.utility.get_node_active_selection_box;
local TAU = math.pi * 2
local MOD_NAME = minetest.get_current_modname()
local ARROWS_FACE = MOD_NAME .. ":arrows_face"
local ARROWS_EDGE = MOD_NAME .. ":arrows_edge"
local ARROWS_CORNER = MOD_NAME .. ":arrows_corner"
local entities_per_player = {}
local function register_entity(name, mesh, rot_speed)
minetest.register_entity(name, {
initial_properties = {
visual = "mesh",
mesh = mesh,
textures = { "nc_extended_rotating_arrows.png^[opacity:192" },
use_texture_alpha = true,
pointable = false, -- Can't be interacted with.
static_save = false, -- Doesn't get saved.
automatic_rotate = math_rad(rot_speed), -- Rotation in degrees per second.
},
on_deactivate = function(self, removal)
if not self.player_name then return end
entities_per_player[self.player_name] = nil
end,
})
end
register_entity(ARROWS_FACE , "nc_extended_rotating_face.obj" , 120)
register_entity(ARROWS_EDGE , "nc_extended_rotating_edge.obj" , 60)
register_entity(ARROWS_CORNER, "nc_extended_rotating_corner.obj", 120)
minetest.register_on_leaveplayer(function(player, timed_out)
local name = player:get_player_name()
local arrows = entities_per_player[name]
if arrows then arrows.object:remove() end
end)
local entity = {}
function entity.update_entity_hint(player, state)
local name = player:get_player_name()
local arrows = entities_per_player[name]
if state then
if arrows then
if state.pos == arrows.prev_pos and state.axis == arrows.prev_axis and state.invert == arrows.prev_invert then
-- No changes were made, so skip creating a new entity.
return
else
-- Changes were made, delete the old entity.
-- We do this to avoid rotation interpolation from `set_rotation`.
arrows.object:remove()
arrows = nil
end
end
local ent, off
if state.mode == "face" then ent, off = ARROWS_FACE , state.axis / 1.85
elseif state.mode == "edge" then ent, off = ARROWS_EDGE , vector.new(0, 0, 0)
elseif state.mode == "corner" then ent, off = ARROWS_CORNER, state.axis / 2.65
end
local box = get_node_active_selection_box(state.node)
local max = box.max - box.min
local pos = state.pos + off:multiply(max)
local rot = vector.dir_to_rotation(state.axis)
rot.x = rot.x + (state.invert and -TAU/4 or TAU/4)
arrows = minetest.add_entity(pos, ent):get_luaentity()
arrows.object:set_properties({ visual_size = max })
arrows.object:set_rotation(rot)
arrows.player_name = name
arrows.prev_pos = state.pos
arrows.prev_axis = state.axis
arrows.prev_invert = state.invert
entities_per_player[name] = arrows
elseif arrows then
arrows.object:remove()
end
end
return entity

@ -6,8 +6,10 @@ nc_extended_rotating.hud = include("hud")
nc_extended_rotating.registry = include("registry")
nc_extended_rotating.rotate = include("rotate")
nc_extended_rotating.utility = include("utility") -- Depends on `rotate`.
nc_extended_rotating.entity = include("entity") -- Depends on `utility`.
nc_extended_rotating.state = include("state") -- Depends on `registry`, `rotate` and `utility`.
local update_entity_hint = nc_extended_rotating.entity.update_entity_hint
local update_player_hud = nc_extended_rotating.hud.update_player_hud
local is_rotatable = nc_extended_rotating.registry.is_rotatable
local register_rotatable = nc_extended_rotating.registry.register_rotatable;
@ -16,16 +18,14 @@ local update_rotating_state = nc_extended_rotating.state.update_rotating_state
local get_rotating_state = nc_extended_rotating.state.get_rotating_state
-- TODO: Fix HUD showing rotation hint when we wouldn't / can't rotate.
-- TODO: Add crosshair indicators for rotating around corners.
-- TODO: Use Aux1 control to use NodeCore's built-in rotation?
-- TODO: Add some more comments.
-- TODO: Add particles to preview rotation?
nodecore.register_playerstep({
label = "nc_extended_rotating:update",
action = function(player, data)
local state = update_rotating_state(player, data)
update_player_hud(player, state)
update_entity_hint(player, state)
end,
})

Binary file not shown.

@ -0,0 +1,265 @@
# Blender v3.6.4 OBJ File: 'arrows.blend'
# www.blender.org
mtllib nc_extended_rotating_corner.mtl
v 3.215449 0.117188 -2.148493
v 2.700978 0.117188 -1.804735
v 0.633739 -0.117188 -3.186019
v 2.148494 0.117188 -3.215449
v 0.754451 -0.117188 -3.792881
v 1.804735 -0.117188 -2.700977
v 1.804735 0.117188 -2.700977
v 2.148494 -0.117188 -3.215449
v 2.700978 -0.117188 -1.804735
v 0.754451 0.117188 -3.792881
v 3.215449 -0.117188 -2.148493
v 3.186019 -0.117188 -0.633739
v 0.633739 0.117188 -3.186019
v 3.792881 -0.117188 -0.754451
v 0.537109 0.117188 -2.774979
v 0.537109 -0.117188 -2.774979
v 0.537109 0.117188 -4.203921
v 0.537109 -0.117188 -4.203921
v -0.700391 0.117188 -3.489450
v -0.700391 -0.117188 -3.489450
v 3.186019 0.117188 -0.633739
v 3.792881 0.117188 -0.754451
v 0.537109 0.117188 -3.186019
v 0.537109 0.117188 -3.792881
v 0.537109 -0.117188 -3.186019
v 0.537109 -0.117188 -3.792881
v -3.468375 0.117187 -1.710414
v -2.913435 0.117187 -1.436748
v -3.076043 -0.117187 1.044176
v -3.858908 0.117187 -0.252926
v -3.661956 -0.117187 1.243067
v -3.241483 -0.117187 -0.212458
v -3.241483 0.117187 -0.212458
v -3.858908 -0.117187 -0.252926
v -2.913435 -0.117187 -1.436748
v -3.661956 0.117187 1.243067
v -3.468375 -0.117187 -1.710414
v -2.141844 -0.117187 -2.442304
v -3.076043 0.117187 1.044176
v -2.549815 -0.117187 -2.907506
v -2.671757 0.117187 0.922339
v -2.671757 -0.117187 0.922339
v -3.909256 0.117187 1.636811
v -3.909256 -0.117187 1.636811
v -2.671757 0.117187 2.351282
v -2.671757 -0.117187 2.351282
v -2.141844 0.117187 -2.442304
v -2.549815 0.117187 -2.907506
v -3.027728 0.117187 1.127860
v -3.553285 0.117187 1.431291
v -3.027728 -0.117187 1.127860
v -3.553285 -0.117187 1.431291
v 0.252926 0.117187 3.858908
v 0.212458 0.117187 3.241483
v 2.442305 -0.117187 2.141843
v 1.710413 0.117187 3.468376
v 2.907506 -0.117187 2.549813
v 1.436748 -0.117187 2.913435
v 1.436748 0.117187 2.913435
v 1.710413 -0.117187 3.468376
v 0.212458 -0.117187 3.241483
v 2.907506 0.117187 2.549813
v 0.252926 -0.117187 3.858908
v -1.044175 -0.117187 3.076044
v 2.442305 0.117187 2.141843
v -1.243066 -0.117187 3.661957
v 2.134648 0.117187 1.852639
v 2.134648 -0.117187 1.852639
v 3.372148 0.117187 2.567110
v 3.372148 -0.117187 2.567110
v 3.372148 0.117187 1.138168
v 3.372148 -0.117187 1.138168
v -1.044175 0.117187 3.076044
v -1.243066 0.117187 3.661957
v 2.490619 0.117187 2.058160
v 3.016177 0.117187 2.361590
v 2.490619 -0.117187 2.058160
v 3.016177 -0.117187 2.361590
vt 0.262500 0.500000
vt 0.262500 0.262500
vt 0.262500 0.262500
vt 0.262500 0.500000
vt 0.975000 0.796875
vt 0.500000 0.975000
vt 0.025000 0.796875
vt 0.975000 0.796875
vt 0.025000 0.796875
vt 0.262500 0.737500
vt 0.262500 0.737500
vt 0.737500 0.500000
vt 0.737500 0.737500
vt 0.737500 0.737500
vt 0.737500 0.500000
vt 0.500000 0.975000
vt 0.737500 0.262500
vt 0.737500 0.025000
vt 0.262500 0.025000
vt 0.262500 0.025000
vt 0.262500 0.796875
vt 0.262500 0.796875
vt 0.737500 0.025000
vt 0.737500 0.796875
vt 0.737500 0.796875
vt 0.737500 0.262500
vt 0.262500 0.500000
vt 0.262500 0.262500
vt 0.262500 0.262500
vt 0.262500 0.500000
vt 0.975000 0.796875
vt 0.500000 0.975000
vt 0.025000 0.796875
vt 0.975000 0.796875
vt 0.025000 0.796875
vt 0.262500 0.737500
vt 0.262500 0.737500
vt 0.737500 0.500000
vt 0.737500 0.737500
vt 0.737500 0.737500
vt 0.737500 0.500000
vt 0.500000 0.975000
vt 0.737500 0.262500
vt 0.737500 0.025000
vt 0.262500 0.025000
vt 0.262500 0.025000
vt 0.262500 0.796875
vt 0.262500 0.796875
vt 0.737500 0.025000
vt 0.737500 0.796875
vt 0.737500 0.796875
vt 0.737500 0.262500
vt 0.262500 0.500000
vt 0.262500 0.262500
vt 0.262500 0.262500
vt 0.262500 0.500000
vt 0.975000 0.796875
vt 0.500000 0.975000
vt 0.025000 0.796875
vt 0.975000 0.796875
vt 0.025000 0.796875
vt 0.262500 0.737500
vt 0.262500 0.737500
vt 0.737500 0.500000
vt 0.737500 0.737500
vt 0.737500 0.737500
vt 0.737500 0.500000
vt 0.500000 0.975000
vt 0.737500 0.262500
vt 0.737500 0.025000
vt 0.262500 0.025000
vt 0.262500 0.025000
vt 0.262500 0.796875
vt 0.262500 0.796875
vt 0.737500 0.025000
vt 0.737500 0.796875
vt 0.737500 0.796875
vt 0.737500 0.262500
vn -0.7071 0.0000 0.7071
vn 0.0000 1.0000 0.0000
vn 1.0000 0.0000 0.0000
vn -0.3827 0.0000 0.9239
vn 0.3827 0.0000 -0.9239
vn -0.5000 0.0000 -0.8660
vn 0.0000 -1.0000 0.0000
vn -0.9239 0.0000 0.3827
vn 0.0000 0.0000 1.0000
vn 0.1951 0.0000 0.9808
vn 0.0000 0.0000 -1.0000
vn 0.9239 0.0000 -0.3827
vn 0.7071 0.0000 -0.7071
vn -0.5000 0.0000 0.8660
vn -1.0000 0.0000 0.0000
vn 0.9659 0.0000 0.2588
vn 0.9914 0.0000 -0.1305
vn -0.9914 0.0000 0.1305
vn 0.7934 0.0000 0.6088
vn 0.8660 0.0000 -0.5000
vn 0.7518 0.0000 -0.6593
vn -0.8660 0.0000 0.5000
vn -0.7934 0.0000 -0.6088
vn -0.9659 0.0000 -0.2588
vn 0.5000 0.0000 0.8660
vn -0.2588 0.0000 -0.9659
vn -0.6088 0.0000 -0.7934
vn 0.6088 0.0000 0.7934
vn 0.1305 0.0000 -0.9914
vn -0.8660 0.0000 -0.5000
vn -0.9469 0.0000 -0.3214
vn 0.8660 0.0000 0.5000
vn -0.1305 0.0000 0.9914
vn 0.2588 0.0000 0.9659
vn 0.5000 0.0000 -0.8660
usemtl None
s off
f 6/1/1 9/2/1 2/3/1 7/4/1
f 17/5/2 19/6/2 15/7/2
f 18/8/3 17/5/3 15/7/3 16/9/3
f 3/10/4 6/1/4 7/4/4 13/11/4
f 8/12/5 5/13/5 10/14/5 4/15/5
f 20/16/6 19/6/6 17/5/6 18/8/6
f 5/13/7 8/12/7 6/1/7 3/10/7
f 11/17/7 14/18/7 12/19/7 9/2/7
f 9/2/8 12/19/8 21/20/8 2/3/8
f 3/10/9 13/11/9 23/21/9 25/22/9
f 14/18/10 22/23/10 21/20/10 12/19/10
f 26/24/7 5/13/7 3/10/7 25/22/7
f 13/11/2 10/14/2 24/25/2 23/21/2
f 1/26/2 2/3/2 21/20/2 22/23/2
f 4/15/2 7/4/2 2/3/2 1/26/2
f 8/12/7 11/17/7 9/2/7 6/1/7
f 10/14/2 13/11/2 7/4/2 4/15/2
f 20/16/7 18/8/7 16/9/7
f 24/25/11 10/14/11 5/13/11 26/24/11
f 14/18/12 11/17/12 1/26/12 22/23/12
f 11/17/13 8/12/13 4/15/13 1/26/13
f 16/9/14 15/7/14 19/6/14 20/16/14
f 23/21/15 24/25/15 26/24/15 25/22/15
f 32/27/16 35/28/16 28/29/16 33/30/16
f 43/31/2 45/32/2 41/33/2
f 44/34/6 43/31/6 41/33/6 42/35/6
f 29/36/17 32/27/17 33/30/17 39/37/17
f 34/38/18 31/39/18 36/40/18 30/41/18
f 46/42/14 45/32/14 43/31/14 44/34/14
f 31/39/7 34/38/7 32/27/7 29/36/7
f 37/43/7 40/44/7 38/45/7 35/28/7
f 35/28/19 38/45/19 47/46/19 28/29/19
f 29/36/20 39/37/20 49/47/20 51/48/20
f 40/44/21 48/49/21 47/46/21 38/45/21
f 52/50/7 31/39/7 29/36/7 51/48/7
f 39/37/2 36/40/2 50/51/2 49/47/2
f 27/52/2 28/29/2 47/46/2 48/49/2
f 30/41/2 33/30/2 28/29/2 27/52/2
f 34/38/7 37/43/7 35/28/7 32/27/7
f 36/40/2 39/37/2 33/30/2 30/41/2
f 46/42/7 44/34/7 42/35/7
f 50/51/22 36/40/22 31/39/22 52/50/22
f 40/44/23 37/43/23 27/52/23 48/49/23
f 37/43/24 34/38/24 30/41/24 27/52/24
f 42/35/3 41/33/3 45/32/3 46/42/3
f 49/47/25 50/51/25 52/50/25 51/48/25
f 58/53/26 61/54/26 54/55/26 59/56/26
f 69/57/2 71/58/2 67/59/2
f 70/60/14 69/57/14 67/59/14 68/61/14
f 55/62/27 58/53/27 59/56/27 65/63/27
f 60/64/28 57/65/28 62/66/28 56/67/28
f 72/68/3 71/58/3 69/57/3 70/60/3
f 57/65/7 60/64/7 58/53/7 55/62/7
f 63/69/7 66/70/7 64/71/7 61/54/7
f 61/54/29 64/71/29 73/72/29 54/55/29
f 55/62/30 65/63/30 75/73/30 77/74/30
f 66/70/31 74/75/31 73/72/31 64/71/31
f 78/76/7 57/65/7 55/62/7 77/74/7
f 65/63/2 62/66/2 76/77/2 75/73/2
f 53/78/2 54/55/2 73/72/2 74/75/2
f 56/67/2 59/56/2 54/55/2 53/78/2
f 60/64/7 63/69/7 61/54/7 58/53/7
f 62/66/2 65/63/2 59/56/2 56/67/2
f 72/68/7 70/60/7 68/61/7
f 76/77/32 62/66/32 57/65/32 78/76/32
f 66/70/33 63/69/33 53/78/33 74/75/33
f 63/69/34 60/64/34 56/67/34 53/78/34
f 68/61/6 67/59/6 71/58/6 72/68/6
f 75/73/35 76/77/35 78/76/35 77/74/35

@ -0,0 +1,469 @@
# Blender v3.6.4 OBJ File: 'arrows.blend'
# www.blender.org
v -0.892922 -0.000000 -7.088787
v -0.892922 0.000000 -7.390350
v 0.375969 -0.732595 -7.088787
v 0.375969 -0.732595 -7.390350
v 0.375968 0.732594 -7.088787
v 0.375968 0.732594 -7.390350
v 0.375969 0.305188 -7.390352
v 0.727441 0.306664 -7.389660
v 0.381608 -0.305187 -7.390352
v 2.158567 0.306657 -7.104689
v 0.727948 -0.306663 -7.389611
v 3.503991 0.306651 -6.546593
v 2.154425 -0.306657 -7.105976
v 4.714010 0.306651 -5.737064
v 3.499053 -0.306650 -6.549290
v 5.742708 0.306650 -4.707130
v 4.709464 -0.306649 -5.740869
v 6.548603 0.306666 -3.500296
v 5.738947 -0.306648 -4.711803
v 6.548603 -0.306665 -3.500296
v 6.282649 -0.306665 -3.358141
v 6.282649 0.306666 -3.358141
v 5.503976 -0.306648 -4.522783
v 5.507736 0.306650 -4.518110
v 4.515909 -0.306649 -5.509617
v 4.520455 0.306651 -5.505813
v 3.354465 -0.306650 -6.284651
v 3.359402 0.306651 -6.281954
v 2.064848 -0.306657 -6.818027
v 2.068989 0.306657 -6.816738
v 0.698638 -0.306663 -7.089477
v 0.698132 0.306664 -7.089527
v 0.381608 -0.305187 -7.088789
v 0.375969 0.305188 -7.088789
v -0.375968 0.305188 7.088789
v -0.381607 -0.305187 7.088789
v -0.698131 0.306664 7.089527
v -0.698637 -0.306663 7.089477
v -2.068988 0.306657 6.816738
v -2.064846 -0.306657 6.818027
v -3.359401 0.306651 6.281954
v -3.354463 -0.306650 6.284651
v -4.520454 0.306651 5.505813
v -4.515908 -0.306649 5.509618
v -5.507736 0.306650 4.518112
v -5.503976 -0.306648 4.522784
v -6.282649 0.306666 3.358142
v -6.282649 -0.306665 3.358142
v -6.548603 -0.306665 3.500297
v -5.738947 -0.306648 4.711805
v -6.548603 0.306666 3.500297
v -4.709462 -0.306649 5.740869
v -5.742706 0.306650 4.707131
v -3.499053 -0.306650 6.549290
v -4.714009 0.306651 5.737064
v -2.154424 -0.306657 7.105977
v -3.503990 0.306651 6.546593
v -0.727947 -0.306663 7.389611
v -2.158566 0.306657 7.104689
v -0.381607 -0.305187 7.390352
v -0.727440 0.306664 7.389660
v -0.375968 0.305188 7.390352
v -0.375967 0.732594 7.390350
v -0.375967 0.732594 7.088787
v -0.375968 -0.732595 7.390350
v -0.375968 -0.732595 7.088787
v 0.892923 0.000000 7.390350
v 0.892923 -0.000000 7.088787
v -7.088787 -0.000000 0.892924
v -7.390350 0.000000 0.892924
v -7.088787 -0.732595 -0.375967
v -7.390350 -0.732595 -0.375967
v -7.088787 0.732594 -0.375966
v -7.390350 0.732594 -0.375966
v -7.390352 0.305188 -0.375967
v -7.389660 0.306664 -0.727440
v -7.390352 -0.305187 -0.381606
v -7.104689 0.306657 -2.158565
v -7.389611 -0.306663 -0.727946
v -6.546593 0.306651 -3.503989
v -7.105977 -0.306657 -2.154423
v -5.737064 0.306651 -4.714008
v -6.549290 -0.306650 -3.499052
v -4.707132 0.306650 -5.742706
v -5.740869 -0.306649 -4.709462
v -3.500298 0.306666 -6.548603
v -4.711805 -0.306648 -5.738946
v -3.500298 -0.306665 -6.548603
v -3.358143 -0.306665 -6.282649
v -3.358143 0.306666 -6.282649
v -4.522785 -0.306648 -5.503975
v -4.518112 0.306650 -5.507735
v -5.509619 -0.306649 -4.515908
v -5.505813 0.306651 -4.520454
v -6.284651 -0.306650 -3.354463
v -6.281954 0.306651 -3.359401
v -6.818027 -0.306657 -2.064846
v -6.816738 0.306657 -2.068987
v -7.089477 -0.306663 -0.698636
v -7.089527 0.306664 -0.698130
v -7.088789 -0.305187 -0.381606
v -7.088789 0.305188 -0.375967
v 7.088789 0.305188 0.375968
v 7.088789 -0.305187 0.381608
v 7.089527 0.306664 0.698131
v 7.089477 -0.306663 0.698637
v 6.816738 0.306657 2.068989
v 6.818027 -0.306657 2.064847
v 6.281954 0.306651 3.359401
v 6.284651 -0.306650 3.354464
v 5.505812 0.306651 4.520455
v 5.509619 -0.306649 4.515909
v 4.518111 0.306650 5.507735
v 4.522784 -0.306648 5.503977
v 3.358142 0.306666 6.282649
v 3.358142 -0.306665 6.282649
v 3.500297 -0.306665 6.548603
v 4.711803 -0.306648 5.738947
v 3.500297 0.306666 6.548603
v 5.740868 -0.306649 4.709463
v 4.707131 0.306650 5.742706
v 6.549290 -0.306650 3.499053
v 5.737064 0.306651 4.714009
v 7.105976 -0.306657 2.154425
v 6.546593 0.306651 3.503990
v 7.389611 -0.306663 0.727947
v 7.104689 0.306657 2.158566
v 7.390352 -0.305187 0.381608
v 7.389660 0.306664 0.727441
v 7.390352 0.305188 0.375968
v 7.390350 0.732594 0.375968
v 7.088787 0.732594 0.375968
v 7.390350 -0.732595 0.375968
v 7.088787 -0.732595 0.375968
v 7.390350 0.000000 -0.892923
v 7.088787 -0.000000 -0.892923
vt 0.737500 0.488125
vt 0.737500 0.333750
vt 0.262500 0.333750
vt 0.262500 0.488125
vt 0.500000 0.975000
vt 0.500000 0.975000
vt 0.975000 0.856250
vt 0.975000 0.856250
vt 0.737500 0.796875
vt 0.737500 0.642500
vt 0.262500 0.642500
vt 0.262500 0.796875
vt 0.737500 0.642500
vt 0.262500 0.642500
vt 0.262500 0.488125
vt 0.737500 0.488125
vt 0.737500 0.856250
vt 0.737500 0.856250
vt 0.737500 0.796875
vt 0.737500 0.025000
vt 0.737500 0.179375
vt 0.737500 0.179375
vt 0.737500 0.025000
vt 0.262500 0.179375
vt 0.262500 0.179375
vt 0.262500 0.333750
vt 0.737500 0.333750
vt 0.025000 0.856250
vt 0.025000 0.856250
vt 0.262500 0.796875
vt 0.262500 0.856250
vt 0.262500 0.025000
vt 0.262500 0.025000
vt 0.262500 0.856250
vt 0.262500 0.796875
vt 0.262500 0.642500
vt 0.262500 0.642500
vt 0.262500 0.796875
vt 0.737500 0.856250
vt 0.737500 0.796875
vt 0.262500 0.856250
vt 0.262500 0.856250
vt 0.737500 0.333750
vt 0.737500 0.488125
vt 0.737500 0.488125
vt 0.737500 0.333750
vt 0.262500 0.025000
vt 0.262500 0.025000
vt 0.737500 0.025000
vt 0.737500 0.025000
vt 0.737500 0.179375
vt 0.262500 0.179375
vt 0.262500 0.488125
vt 0.262500 0.333750
vt 0.262500 0.333750
vt 0.262500 0.488125
vt 0.737500 0.642500
vt 0.737500 0.642500
vt 0.737500 0.179375
vt 0.262500 0.179375
vt 0.737500 0.796875
vt 0.737500 0.856250
vt 0.500000 0.975000
vt 0.975000 0.856250
vt 0.025000 0.856250
vt 0.025000 0.856250
vt 0.500000 0.975000
vt 0.975000 0.856250
vt 0.500000 0.975000
vt 0.500000 0.975000
vt 0.975000 0.856250
vt 0.975000 0.856250
vt 0.025000 0.856250
vt 0.025000 0.856250
vt 0.262500 0.642500
vt 0.262500 0.488125
vt 0.262500 0.488125
vt 0.262500 0.642500
vt 0.737500 0.179375
vt 0.737500 0.333750
vt 0.737500 0.333750
vt 0.737500 0.179375
vt 0.737500 0.796875
vt 0.737500 0.856250
vt 0.737500 0.856250
vt 0.737500 0.796875
vt 0.262500 0.333750
vt 0.262500 0.333750
vt 0.262500 0.856250
vt 0.262500 0.796875
vt 0.737500 0.642500
vt 0.737500 0.488125
vt 0.737500 0.642500
vt 0.262500 0.179375
vt 0.262500 0.179375
vt 0.737500 0.025000
vt 0.737500 0.025000
vt 0.262500 0.025000
vt 0.262500 0.025000
vt 0.737500 0.488125
vt 0.262500 0.796875
vt 0.262500 0.856250
vt 0.262500 0.796875
vt 0.262500 0.642500
vt 0.262500 0.642500
vt 0.262500 0.796875
vt 0.737500 0.856250
vt 0.737500 0.796875
vt 0.262500 0.856250
vt 0.262500 0.856250
vt 0.737500 0.333750
vt 0.737500 0.488125
vt 0.737500 0.488125
vt 0.737500 0.333750
vt 0.262500 0.025000
vt 0.262500 0.025000
vt 0.737500 0.025000
vt 0.737500 0.025000
vt 0.737500 0.179375
vt 0.262500 0.179375
vt 0.262500 0.488125
vt 0.262500 0.333750
vt 0.262500 0.333750
vt 0.262500 0.488125
vt 0.737500 0.642500
vt 0.737500 0.642500
vt 0.737500 0.179375
vt 0.262500 0.179375
vt 0.737500 0.796875
vt 0.737500 0.856250
vt 0.500000 0.975000
vt 0.975000 0.856250
vt 0.025000 0.856250
vt 0.025000 0.856250
vt 0.500000 0.975000
vt 0.975000 0.856250
vn -0.5554 -0.0001 0.8316
vn -0.5000 -0.8660 0.0000
vn -0.1950 -0.0004 0.9808
vn 0.3828 0.0002 -0.9238
vn -0.0044 -1.0000 -0.0002
vn 0.0000 1.0000 0.0000
vn -0.0000 -1.0000 -0.0000
vn -0.0000 0.0000 -1.0000
vn 0.0000 0.0000 1.0000
vn 0.1952 0.0004 -0.9808
vn 0.0021 -0.0000 -1.0000
vn 0.7072 0.0001 -0.7070
vn 0.8315 -0.0004 -0.5555
vn -0.3825 -0.0002 0.9239
vn -0.7070 -0.0001 0.7073
vn -0.8314 0.0004 0.5557
vn 0.5557 0.0001 -0.8314
vn 0.4714 0.0000 0.8819
vn -0.0044 1.0000 -0.0002
vn 0.0022 0.0001 1.0000
vn 1.0000 0.0000 0.0000
vn -0.5000 0.8660 0.0000
vn -0.0022 0.0001 -1.0000
vn 0.0044 1.0000 0.0002
vn -0.4714 0.0000 -0.8819
vn 0.8314 0.0004 -0.5557
vn 0.3825 -0.0002 -0.9239
vn 0.7070 -0.0001 -0.7073
vn -0.8315 -0.0004 0.5555
vn -0.7072 0.0001 0.7070
vn -0.5557 0.0001 0.8314
vn -0.0021 -0.0000 1.0000
vn -0.1952 0.0004 0.9808
vn 0.5000 0.8660 0.0000
vn -1.0000 0.0000 0.0000
vn 0.5000 -0.8660 0.0000
vn 0.1950 -0.0004 -0.9808
vn -0.3828 0.0002 0.9238
vn 0.5554 -0.0001 -0.8316
vn 0.0044 -1.0000 0.0002
vn -0.0000 -0.8660 0.5000
vn 0.0000 0.8660 0.5000
vn -0.0002 -1.0000 0.0044
vn -1.0000 -0.0000 -0.0021
vn -0.9808 0.0004 -0.1952
vn -0.9238 0.0002 -0.3828
vn -0.8314 0.0001 -0.5557
vn -0.7070 0.0001 -0.7072
vn -0.5555 -0.0004 -0.8315
vn 0.5557 0.0004 0.8314
vn 0.7073 -0.0001 0.7070
vn 0.8316 -0.0001 0.5554
vn 0.9239 -0.0002 0.3825
vn 0.9808 -0.0004 0.1950
vn 1.0000 0.0001 -0.0022
vn -0.0002 1.0000 0.0044
vn 0.8819 0.0000 -0.4714
vn -1.0000 0.0001 0.0022
vn 0.0002 1.0000 -0.0044
vn -0.8819 0.0000 0.4714
vn -0.5557 0.0004 -0.8314
vn -0.9239 -0.0002 -0.3825
vn -0.7073 -0.0001 -0.7070
vn 0.5555 -0.0004 0.8315
vn 0.7070 0.0001 0.7072
vn 0.8314 0.0001 0.5557
vn 1.0000 -0.0000 0.0021
vn 0.9808 0.0004 0.1952
vn -0.0000 0.8660 -0.5000
vn 0.0000 -0.8660 -0.5000
vn -0.9808 -0.0004 -0.1950
vn 0.9238 0.0002 0.3828
vn -0.8316 -0.0001 -0.5554
vn 0.0002 -1.0000 -0.0044
s off
f 27/1/1 25/2/1 26/3/1 28/4/1
f 1/5/2 2/6/2 4/7/2 3/8/2
f 31/9/3 29/10/3 30/11/3 32/12/3
f 13/13/4 10/14/4 12/15/4 15/16/4
f 31/9/5 33/17/5 9/18/5 11/19/5
f 30/11/6 28/4/6 12/15/6 10/14/6
f 21/20/7 23/21/7 19/22/7 20/23/7
f 26/3/6 24/24/6 16/25/6 14/26/6
f 23/21/7 25/2/7 17/27/7 19/22/7
f 4/7/8 2/6/8 6/28/8
f 1/5/9 3/8/9 5/29/9
f 11/19/10 8/30/10 10/14/10 13/13/10
f 9/18/11 7/31/11 8/30/11 11/19/11
f 29/10/7 31/9/7 11/19/7 13/13/7
f 17/27/12 14/26/12 16/25/12 19/22/12
f 19/22/13 16/25/13 18/32/13 20/23/13
f 28/4/6 26/3/6 14/26/6 12/15/6
f 29/10/14 27/1/14 28/4/14 30/11/14
f 25/2/15 23/21/15 24/24/15 26/3/15
f 23/21/16 21/20/16 22/33/16 24/24/16
f 15/16/17 12/15/17 14/26/17 17/27/17
f 18/32/18 22/33/18 21/20/18 20/23/18
f 25/2/7 27/1/7 15/16/7 17/27/7
f 34/34/19 32/12/19 8/30/19 7/31/19
f 33/17/20 31/9/20 32/12/20 34/34/20
f 32/12/6 30/11/6 10/14/6 8/30/6
f 3/8/21 4/7/21 6/28/21 5/29/21
f 24/24/6 22/33/6 18/32/6 16/25/6
f 5/29/22 6/28/22 2/6/22 1/5/22
f 27/1/7 29/10/7 13/13/7 15/16/7
f 37/35/6 39/36/6 59/37/6 61/38/6
f 36/39/23 38/40/23 37/35/23 35/41/23
f 35/41/24 37/35/24 61/38/24 62/42/24
f 44/43/7 42/44/7 54/45/7 52/46/7
f 51/47/25 47/48/25 48/49/25 49/50/25
f 46/51/26 48/49/26 47/48/26 45/52/26
f 41/53/6 43/54/6 55/55/6 57/56/6
f 42/44/7 40/57/7 56/58/7 54/45/7
f 48/49/7 46/51/7 50/59/7 49/50/7
f 40/57/27 42/44/27 41/53/27 39/36/27
f 44/43/28 46/51/28 45/52/28 43/54/28
f 45/52/6 47/48/6 51/47/6 53/60/6
f 50/59/29 53/60/29 51/47/29 49/50/29
f 52/46/30 55/55/30 53/60/30 50/59/30
f 54/45/31 57/56/31 55/55/31 52/46/31
f 40/57/7 38/40/7 58/61/7 56/58/7
f 46/51/7 44/43/7 52/46/7 50/59/7
f 60/62/32 62/42/32 61/38/32 58/61/32
f 58/61/33 61/38/33 59/37/33 56/58/33
f 39/36/6 41/53/6 57/56/6 59/37/6
f 43/54/6 45/52/6 53/60/6 55/55/6
f 68/63/8 66/64/8 64/65/8
f 64/65/34 63/66/34 67/67/34 68/63/34
f 65/68/9 67/67/9 63/66/9
f 66/64/35 65/68/35 63/66/35 64/65/35
f 68/63/36 67/67/36 65/68/36 66/64/36
f 38/40/37 40/57/37 39/36/37 37/35/37
f 56/58/38 59/37/38 57/56/38 54/45/38
f 42/44/39 44/43/39 43/54/39 41/53/39
f 38/40/40 36/39/40 60/62/40 58/61/40
f 69/69/41 70/70/41 72/71/41 71/72/41
f 71/72/8 72/71/8 74/73/8 73/74/8
f 72/71/35 70/70/35 74/73/35
f 73/74/42 74/73/42 70/70/42 69/69/42
f 69/69/21 71/72/21 73/74/21
f 98/75/6 96/76/6 80/77/6 78/78/6
f 91/79/7 93/80/7 85/81/7 87/82/7
f 99/83/43 101/84/43 77/85/43 79/86/43
f 96/76/6 94/87/6 82/88/6 80/77/6
f 77/85/44 75/89/44 76/90/44 79/86/44
f 79/86/45 76/90/45 78/78/45 81/91/45
f 81/91/46 78/78/46 80/77/46 83/92/46
f 97/93/7 99/83/7 79/86/7 81/91/7
f 83/92/47 80/77/47 82/88/47 85/81/47
f 94/87/6 92/94/6 84/95/6 82/88/6
f 85/81/48 82/88/48 84/95/48 87/82/48
f 89/96/7 91/79/7 87/82/7 88/97/7
f 87/82/49 84/95/49 86/98/49 88/97/49
f 92/94/6 90/99/6 86/98/6 84/95/6
f 91/79/50 89/96/50 90/99/50 92/94/50
f 95/100/7 97/93/7 81/91/7 83/92/7
f 93/80/51 91/79/51 92/94/51 94/87/51
f 95/100/52 93/80/52 94/87/52 96/76/52
f 97/93/53 95/100/53 96/76/53 98/75/53
f 99/83/54 97/93/54 98/75/54 100/101/54
f 101/84/55 99/83/55 100/101/55 102/102/55
f 102/102/56 100/101/56 76/90/56 75/89/56
f 93/80/7 95/100/7 83/92/7 85/81/7
f 100/101/6 98/75/6 78/78/6 76/90/6
f 86/98/57 90/99/57 89/96/57 88/97/57
f 105/103/6 107/104/6 127/105/6 129/106/6
f 104/107/58 106/108/58 105/103/58 103/109/58
f 103/109/59 105/103/59 129/106/59 130/110/59
f 112/111/7 110/112/7 122/113/7 120/114/7
f 119/115/60 115/116/60 116/117/60 117/118/60
f 114/119/61 116/117/61 115/116/61 113/120/61
f 109/121/6 111/122/6 123/123/6 125/124/6
f 110/112/7 108/125/7 124/126/7 122/113/7
f 116/117/7 114/119/7 118/127/7 117/118/7
f 108/125/62 110/112/62 109/121/62 107/104/62
f 112/111/63 114/119/63 113/120/63 111/122/63
f 113/120/6 115/116/6 119/115/6 121/128/6
f 118/127/64 121/128/64 119/115/64 117/118/64
f 120/114/65 123/123/65 121/128/65 118/127/65
f 122/113/66 125/124/66 123/123/66 120/114/66
f 108/125/7 106/108/7 126/129/7 124/126/7
f 114/119/7 112/111/7 120/114/7 118/127/7
f 128/130/67 130/110/67 129/106/67 126/129/67
f 126/129/68 129/106/68 127/105/68 124/126/68
f 107/104/6 109/121/6 125/124/6 127/105/6
f 111/122/6 113/120/6 121/128/6 123/123/6
f 136/131/35 134/132/35 132/133/35
f 132/133/69 131/134/69 135/135/69 136/131/69
f 133/136/21 135/135/21 131/134/21
f 134/132/9 133/136/9 131/134/9 132/133/9
f 136/131/70 135/135/70 133/136/70 134/132/70
f 106/108/71 108/125/71 107/104/71 105/103/71
f 124/126/72 127/105/72 125/124/72 122/113/72
f 110/112/73 112/111/73 111/122/73 109/121/73
f 106/108/74 104/107/74 128/130/74 126/129/74

@ -0,0 +1,223 @@
# Blender v3.6.4 OBJ File: 'arrows.blend'
# www.blender.org
mtllib nc_extended_rotating_face.mtl
v 2.455435 -0.117188 1.640667
v 2.923136 -0.117188 1.953175
v 2.923136 0.117188 1.953175
v 2.455435 0.117188 1.640667
v 3.448073 0.117188 0.685864
v 2.896381 0.117188 0.576126
v 2.923136 0.117188 -1.953176
v 2.455434 0.117188 -1.640668
v 0.576126 -0.117188 -2.896381
v 1.953177 0.117188 -2.923135
v 0.685864 -0.117188 -3.448073
v 1.640669 -0.117188 -2.455434
v 1.640669 0.117188 -2.455434
v 1.953177 -0.117188 -2.923135
v 2.455434 -0.117188 -1.640668
v 0.685864 0.117188 -3.448073
v 2.923136 -0.117188 -1.953176
v 2.896381 -0.117188 -0.576126
v 0.576126 0.117188 -2.896381
v 3.448073 -0.117188 -0.685865
v 2.896381 -0.117188 0.576126
v 3.448073 -0.117188 0.685864
v 0.488281 0.117188 -2.522708
v 0.488281 -0.117188 -2.522708
v 0.488281 0.117188 -3.821746
v 0.488281 -0.117188 -3.821746
v -0.636719 0.117188 -3.172227
v -0.636719 -0.117188 -3.172227
v 2.896381 0.117188 -0.576126
v 3.448073 0.117188 -0.685865
v 0.488281 0.117188 -2.896381
v 0.488281 0.117188 -3.448073
v 0.488281 -0.117188 -2.896381
v 0.488281 -0.117188 -3.448073
v -2.455434 -0.117188 -1.640668
v -2.923136 -0.117188 -1.953176
v -2.923136 0.117188 -1.953176
v -2.455434 0.117188 -1.640668
v -3.448073 0.117188 -0.685865
v -2.896381 0.117188 -0.576126
v -2.923136 0.117188 1.953176
v -2.455435 0.117188 1.640667
v -0.576126 -0.117188 2.896381
v -1.953177 0.117188 2.923135
v -0.685865 -0.117188 3.448073
v -1.640669 -0.117188 2.455434
v -1.640669 0.117188 2.455434
v -1.953177 -0.117188 2.923135
v -2.455435 -0.117188 1.640667
v -0.685865 0.117188 3.448073
v -2.923136 -0.117188 1.953176
v -2.896381 -0.117188 0.576126
v -0.576126 0.117188 2.896381
v -3.448073 -0.117188 0.685864
v -2.896381 -0.117188 -0.576126
v -3.448073 -0.117188 -0.685865
v -0.488281 0.117188 2.522708
v -0.488281 -0.117188 2.522708
v -0.488281 0.117188 3.821746
v -0.488281 -0.117188 3.821746
v 0.636719 0.117188 3.172227
v 0.636719 -0.117188 3.172227
v -2.896381 0.117188 0.576126
v -3.448073 0.117188 0.685864
v -0.488281 0.117188 2.896381
v -0.488281 0.117188 3.448073
v -0.488281 -0.117188 2.896381
v -0.488281 -0.117188 3.448073
vt 0.737500 0.025000
vt 0.737500 0.167500
vt 0.737500 0.167500
vt 0.737500 0.025000
vt 0.737500 0.310000
vt 0.262500 0.310000
vt 0.262500 0.167500
vt 0.262500 0.595000
vt 0.262500 0.452500
vt 0.262500 0.452500
vt 0.262500 0.595000
vt 0.975000 0.796875
vt 0.500000 0.975000
vt 0.025000 0.796875
vt 0.975000 0.796875
vt 0.025000 0.796875
vt 0.262500 0.737500
vt 0.262500 0.737500
vt 0.737500 0.595000
vt 0.737500 0.737500
vt 0.737500 0.737500
vt 0.737500 0.595000
vt 0.500000 0.975000
vt 0.737500 0.452500
vt 0.737500 0.310000
vt 0.262500 0.310000
vt 0.262500 0.167500
vt 0.262500 0.025000
vt 0.262500 0.025000
vt 0.262500 0.796875
vt 0.262500 0.796875
vt 0.737500 0.796875
vt 0.737500 0.796875
vt 0.737500 0.452500
vt 0.737500 0.025000
vt 0.737500 0.167500
vt 0.737500 0.167500
vt 0.737500 0.025000
vt 0.737500 0.310000
vt 0.262500 0.310000
vt 0.262500 0.167500
vt 0.262500 0.595000
vt 0.262500 0.452500
vt 0.262500 0.452500
vt 0.262500 0.595000
vt 0.975000 0.796875
vt 0.500000 0.975000
vt 0.025000 0.796875
vt 0.975000 0.796875
vt 0.025000 0.796875
vt 0.262500 0.737500
vt 0.262500 0.737500
vt 0.737500 0.595000
vt 0.737500 0.737500
vt 0.737500 0.737500
vt 0.737500 0.595000
vt 0.500000 0.975000
vt 0.737500 0.452500
vt 0.737500 0.310000
vt 0.262500 0.310000
vt 0.262500 0.167500
vt 0.262500 0.025000
vt 0.262500 0.025000
vt 0.262500 0.796875
vt 0.262500 0.796875
vt 0.737500 0.796875
vt 0.737500 0.796875
vt 0.737500 0.452500
vn 0.9239 0.0000 0.3827
vn 0.0000 1.0000 0.0000
vn -0.7071 0.0000 0.7071
vn 1.0000 0.0000 -0.0000
vn -0.3827 0.0000 0.9239
vn 0.3827 0.0000 -0.9239
vn -0.5000 0.0000 -0.8660
vn 0.0000 -1.0000 0.0000
vn -0.9239 0.0000 0.3827
vn -0.9239 0.0000 -0.3827
vn 0.0000 0.0000 1.0000
vn 0.0000 0.0000 -1.0000
vn 0.9239 0.0000 -0.3827
vn 0.7071 0.0000 -0.7071
vn -0.5000 0.0000 0.8660
vn -0.5556 0.0000 0.8315
vn -1.0000 0.0000 0.0000
vn 0.5000 0.0000 0.8660
vn 0.5000 0.0000 -0.8660
vn 0.5556 0.0000 -0.8315
usemtl None
s off
f 2/1/1 22/2/1 5/3/1 3/4/1
f 30/5/2 29/6/2 6/7/2 5/3/2
f 12/8/3 15/9/3 8/10/3 13/11/3
f 25/12/2 27/13/2 23/14/2
f 26/15/4 25/12/4 23/14/4 24/16/4
f 9/17/5 12/8/5 13/11/5 19/18/5
f 14/19/6 11/20/6 16/21/6 10/22/6
f 28/23/7 27/13/7 25/12/7 26/15/7
f 11/20/8 14/19/8 12/8/8 9/17/8
f 17/24/8 20/25/8 18/26/8 15/9/8
f 15/9/9 18/26/9 29/6/9 8/10/9
f 21/27/10 1/28/10 4/29/10 6/7/10
f 5/3/2 6/7/2 4/29/2 3/4/2
f 9/17/11 19/18/11 31/30/11 33/31/11
f 20/25/8 22/2/8 21/27/8 18/26/8
f 34/32/8 11/20/8 9/17/8 33/31/8
f 19/18/2 16/21/2 32/33/2 31/30/2
f 7/34/2 8/10/2 29/6/2 30/5/2
f 10/22/2 13/11/2 8/10/2 7/34/2
f 14/19/8 17/24/8 15/9/8 12/8/8
f 16/21/2 19/18/2 13/11/2 10/22/2
f 28/23/8 26/15/8 24/16/8
f 22/2/4 20/25/4 30/5/4 5/3/4
f 22/2/8 2/1/8 1/28/8 21/27/8
f 32/33/12 16/21/12 11/20/12 34/32/12
f 20/25/13 17/24/13 7/34/13 30/5/13
f 17/24/14 14/19/14 10/22/14 7/34/14
f 24/16/15 23/14/15 27/13/15 28/23/15
f 2/1/16 3/4/16 4/29/16 1/28/16
f 18/26/17 21/27/17 6/7/17 29/6/17
f 31/30/17 32/33/17 34/32/17 33/31/17
f 36/35/10 56/36/10 39/37/10 37/38/10
f 64/39/2 63/40/2 40/41/2 39/37/2
f 46/42/14 49/43/14 42/44/14 47/45/14
f 59/46/2 61/47/2 57/48/2
f 60/49/17 59/46/17 57/48/17 58/50/17
f 43/51/6 46/42/6 47/45/6 53/52/6
f 48/53/5 45/54/5 50/55/5 44/56/5
f 62/57/18 61/47/18 59/46/18 60/49/18
f 45/54/8 48/53/8 46/42/8 43/51/8
f 51/58/8 54/59/8 52/60/8 49/43/8
f 49/43/13 52/60/13 63/40/13 42/44/13
f 55/61/1 35/62/1 38/63/1 40/41/1
f 39/37/2 40/41/2 38/63/2 37/38/2
f 43/51/12 53/52/12 65/64/12 67/65/12
f 54/59/8 56/36/8 55/61/8 52/60/8
f 68/66/8 45/54/8 43/51/8 67/65/8
f 53/52/2 50/55/2 66/67/2 65/64/2
f 41/68/2 42/44/2 63/40/2 64/39/2
f 44/56/2 47/45/2 42/44/2 41/68/2
f 48/53/8 51/58/8 49/43/8 46/42/8
f 50/55/2 53/52/2 47/45/2 44/56/2
f 62/57/8 60/49/8 58/50/8
f 56/36/17 54/59/17 64/39/17 39/37/17
f 56/36/8 36/35/8 35/62/8 55/61/8
f 66/67/11 50/55/11 45/54/11 68/66/11
f 54/59/9 51/58/9 41/68/9 64/39/9
f 51/58/3 48/53/3 44/56/3 41/68/3
f 58/50/19 57/48/19 61/47/19 62/57/19
f 36/35/20 37/38/20 38/63/20 35/62/20
f 52/60/4 55/61/4 40/41/4 63/40/4
f 65/64/4 66/67/4 68/66/4 67/65/4

@ -52,7 +52,7 @@ local function calculate_rotating_state(player, data)
local num = math_round(r.x * r.x + r.y * r.y + r.z * r.z) -- Squared length.
if num == 1 then state.mode = "face"
elseif num == 2 then state.mode = "edge"; state.axis = state.face:cross(r)
elseif num == 3 then state.mode = "mirror"; degrees = 120
elseif num == 3 then state.mode = "corner"; degrees = 120
end
-- Sneaking causes the direction of the rotation to be inverted.

Binary file not shown.

After

Width:  |  Height:  |  Size: 7.9 KiB

@ -8,9 +8,11 @@ local rotate_box_by_facedir = nc_extended_rotating.rotate.rotate_box_by_facedir
local DEFAULT_SELECTION_BOX = { min = vector.new(-0.5, -0.5, -0.5),
max = vector.new( 0.5, 0.5, 0.5) }
local utility = {}
-- Gets the active `selection_box` for the specified `node` which
-- has a `paramtype2` of `facedir`, based on its `param2` value.
local function get_node_active_selection_box(node)
function utility.get_node_active_selection_box(node)
local def = minetest.registered_nodes[node.name]
local box = def.selection_box and def.selection_box.fixed
-- No need to rotate the default selection box.
@ -25,15 +27,12 @@ local function get_node_active_selection_box(node)
return box
end
local utility = {}
-- Calculates the rotation vector from where a player is looking at on this node.
-- * If looking near an edge, the vector points in the direction of that edge.
-- * If looking near a corner, the vector similarly points in that direction.
-- * Otherwise, vector simply points away from the face.
function utility.rotation_vector_from_lookat(node, pointed_thing, edge_distance)
local box = get_node_active_selection_box(node)
local box = utility.get_node_active_selection_box(node)
local center = (box.min + box.max) / 2
-- Calculate bounds, single vector describing the size of the selection box.

Loading…
Cancel
Save