Use actual mesh and skin for player hand.

This commit is contained in:
Aaron Suen 2020-02-24 06:22:09 -05:00
parent f541cf9062
commit 5a5c546596
5 changed files with 63 additions and 3 deletions

View File

@ -5,6 +5,8 @@ local math_pow
= math.pow
-- LUALOCALS > ---------------------------------------------------------
local modname = minetest.get_current_modname()
local toolcaps = nodecore.toolcaps({
uses = 0,
crumbly = 1,
@ -21,7 +23,20 @@ end
minetest.register_item(":", {
["type"] = "none",
wield_image = "nc_player_hand.png",
wield_scale = {x = 4, y = 8, z = 3},
tool_capabilities = toolcaps
})
local scale = 2
minetest.register_node(modname .. ":hand", {
drawtype = "mesh",
mesh = modname .. ".obj",
tiles = {"nc_player_model_base.png"},
wield_scale = {x = scale, y = scale, z = scale},
virtual_item = true
})
minetest.register_on_joinplayer(function(player)
local inv = player:get_inventory()
inv:set_size("hand", 1)
inv:set_stack("hand", 1, modname .. ":hand")
end)

View File

@ -1 +1 @@
depends = nc_api_all
depends = nc_api_all, nc_player_model

View File

@ -0,0 +1,45 @@
# Blender v2.79 (sub 0) OBJ File: 'nc_player_hand.blend'
# www.blender.org
mtllib nc_player_hand.mtl
o Cube
v -0.125000 -1.000000 -0.125000
v 0.125000 -1.000000 -0.125000
v 0.125000 -1.000000 0.125000
v -0.125000 -1.000000 0.125000
v -0.125000 -0.250000 -0.125000
v 0.125000 -0.250000 -0.125000
v 0.125000 -0.250000 0.125000
v -0.125000 -0.250000 0.125000
vt 0.750051 0.374966
vt 0.750068 0.499966
vt 0.687568 0.500000
vt 0.687551 0.375000
vt 0.750000 0.375000
vt 0.812500 0.375000
vt 0.812500 0.500000
vt 0.750000 0.500000
vt 0.750000 0.375000
vt 0.750000 0.000000
vt 0.812500 0.000000
vt 0.812500 0.375000
vt 0.812551 0.375068
vt 0.812534 0.000068
vt 0.875034 0.000034
vt 0.875051 0.375034
vt 0.625051 0.375034
vt 0.625034 0.000034
vt 0.687534 -0.000000
vn 0.0000 -1.0000 -0.0000
vn 0.0000 1.0000 0.0000
vn 0.0000 0.0000 -1.0000
vn 1.0000 -0.0000 0.0000
vn -0.0000 -0.0000 1.0000
vn -1.0000 0.0000 -0.0000
usemtl Material
s off
f 1/1/1 2/2/1 3/3/1 4/4/1
f 5/5/2 8/6/2 7/7/2 6/8/2
f 1/9/3 5/10/3 6/11/3 2/12/3
f 2/13/4 6/14/4 7/15/4 3/16/4
f 3/17/5 7/18/5 8/19/5 4/4/5
f 5/10/6 1/1/6 4/4/6 8/19/6

Binary file not shown.

Binary file not shown.

Before

Width:  |  Height:  |  Size: 193 B