1
0
mirror of https://github.com/luanti-org/luanti.git synced 2025-10-23 04:45:24 +02:00

Add glTF animation support

This commit is contained in:
Lars Mueller
2024-01-06 20:21:04 +01:00
committed by Lars Müller
parent d8274af670
commit 323fc0a798
9 changed files with 421 additions and 79 deletions

View File

@@ -27,8 +27,34 @@ do
},
})
end
register_entity("snow_man", {"gltf_snow_man.png"})
register_entity("spider", {"gltf_spider.png"})
minetest.register_entity("gltf:spider_animated", {
initial_properties = {
visual = "mesh",
mesh = "gltf_spider_animated.gltf",
textures = {"gltf_spider.png"},
},
on_activate = function(self)
self.object:set_animation({x = 0, y = 140}, 1)
end
})
minetest.register_entity("gltf:simple_skin", {
initial_properties = {
visual = "mesh",
visual_size = vector.new(5, 5, 5),
mesh = "gltf_simple_skin.gltf",
textures = {},
backface_culling = false
},
on_activate = function(self)
self.object:set_animation({x = 0, y = 5.5}, 1)
end
})
-- Note: Model has an animation, but we can use it as a static test nevertheless
-- The claws rendering incorrectly from one side is expected behavior:
-- They use an unsupported double-sided material.