Better textures for turtle, and fix rotation

This commit is contained in:
Novatux 2015-02-18 20:30:23 +01:00
parent 7aef9df55d
commit d1d8f50375
4 changed files with 43 additions and 4 deletions

View File

@ -1,5 +1,6 @@
License of textures and models
Textures and nodebox of screen are by kaeza, modified by Nore, under the WTFPL license
Texture and model of turtle by kilbith, modified by Nore, under the CC0 license
All other textures are by kaeza, licensed under the CC-BY-SA license
------------------------------

34
models/turtle.obj Normal file
View File

@ -0,0 +1,34 @@
# Blender v2.69 (sub 0) OBJ File: ''
# www.blender.org
mtllib turtle.mtl
o Cube
v 0.400000 -0.400000 -0.400000
v 0.400000 -0.400000 0.400000
v -0.400000 -0.400000 0.400000
v -0.400000 -0.400000 -0.400000
v 0.400000 0.400000 -0.400000
v 0.400000 0.400000 0.400000
v -0.400000 0.400000 0.400000
v -0.400000 0.400000 -0.400000
vt 0.499999 0.500000
vt 0.499999 0.749956
vt 0.250043 0.749957
vt 0.250042 0.500001
vt 0.499998 0.250043
vt 0.250041 0.250044
vt 0.250040 0.000088
vt 0.499996 0.000087
vt 0.749956 0.749956
vt 0.749956 0.999913
vt 0.500000 0.999913
vt 0.250043 0.999913
vt 0.000087 0.999913
vt 0.000087 0.749957
usemtl Material
s off
f 1/1 2/2 3/3 4/4
f 5/5 8/6 7/7 6/8
f 1/9 5/10 6/11 2/2
f 2/2 6/11 7/12 3/3
f 3/3 7/12 8/13 4/14
f 5/5 1/1 4/4 8/6

12
t2.lua
View File

@ -188,16 +188,20 @@ local function done_move(pos, spos, npos)
end
local function done_rotation(yaw, nyaw, rotate_speed)
return (nyaw - yaw + rotate_speed - math.pi / 2) % (2 * math.pi) < math.pi
return (((nyaw - yaw + rotate_speed) % (2 * math.pi)) - math.pi) * (((nyaw - yaw) % (2 * math.pi) - math.pi)) <= 0
end
minetest.register_entity("turtle:turtle", {
physical = true,
collisionbox = {-0.4999, -0.4999, -0.4999, 0.4999, 0.4999, 0.4999}, -- Not 0.5 to avoid the turtle being stuck due to rounding errors
collides_with_objects = false,
visual = "wielditem", -- TODO: change that to a mesh, and add animations
visual_size = {x = 2/3, y = 2/3},
textures = {"default:wood"},
--visual = "wielditem", -- TODO: change that to a mesh, and add animations
--visual_size = {x = 2/3, y = 2/3},
--textures = {"default:wood"},
visual = "mesh",
mesh = "turtle.obj",
textures = {"turtle.png"},
visual_size = {x = 10, y = 10},
on_activate = function(self, staticdata)
local id = tonumber(staticdata)
if id ~= nil then

BIN
textures/turtle.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 33 KiB