mirror of
https://github.com/MihailRis/voxelcore.git
synced 2026-10-10 21:41:50 +00:00
add named skeletons support
This commit is contained in:
parent
5632c9ccfe
commit
567eec88c8
1 changed files with 10 additions and 0 deletions
|
|
@ -1,6 +1,13 @@
|
||||||
#include "objects/rigging.hpp"
|
#include "objects/rigging.hpp"
|
||||||
#include "libentity.hpp"
|
#include "libentity.hpp"
|
||||||
|
|
||||||
|
#include "graphics/render/WorldRenderer.hpp"
|
||||||
|
#include "graphics/render/NamedSkeletons.hpp"
|
||||||
|
|
||||||
|
namespace scripting {
|
||||||
|
extern WorldRenderer* renderer;
|
||||||
|
}
|
||||||
|
|
||||||
static int index_range_check(
|
static int index_range_check(
|
||||||
const rigging::Skeleton& skeleton, lua::Integer index
|
const rigging::Skeleton& skeleton, lua::Integer index
|
||||||
) {
|
) {
|
||||||
|
|
@ -14,6 +21,9 @@ static int index_range_check(
|
||||||
}
|
}
|
||||||
|
|
||||||
static rigging::Skeleton* get_skeleton(lua::State* L) {
|
static rigging::Skeleton* get_skeleton(lua::State* L) {
|
||||||
|
if (lua::isstring(L, 1)) {
|
||||||
|
return scripting::renderer->skeletons->getSkeleton(lua::tostring(L, 1));
|
||||||
|
}
|
||||||
if (auto entity = get_entity(L, 1)) {
|
if (auto entity = get_entity(L, 1)) {
|
||||||
return &entity->getSkeleton();
|
return &entity->getSkeleton();
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue