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:
committed by
Lars Müller
parent
d8274af670
commit
323fc0a798
@@ -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.
|
||||
|
Reference in New Issue
Block a user