mirror of
https://github.com/MihailRis/voxelcore.git
synced 2026-10-09 13:01:49 +00:00
Some checks are pending
x86-64 AppImage / build-appimage (ubuntu-22.04) (push) Waiting to run
Build / Build (push) Waiting to run
Macos Build / build-dmg (push) Waiting to run
Windows Build (CLang) / build-windows (clang, windows-latest) (push) Waiting to run
MSVC Build / build-windows (windows-2022) (push) Waiting to run
1.7 KiB
1.7 KiB
gfx.skeletons library
A library for working with named skeletons, such as 'hand', used to control the hand and the carried item displayed in first-person view. The set of functions is similar to the skeleton component of entities.
The first argument to the function is the name of the skeleton.
-- Returns an object wrapper over the skeleton
local skeleton = gfx.skeletons.get(name: str)
-- Returns the index of the bone by name or nil
skeleton:index(name: str) -> int
-- Returns the name of the model assigned to the bone with the specified index
skeleton:get_model(index: int) -> str
-- Reassigns the model of the bone with the specified index
-- Resets to the original if you do not specify a name
skeleton:set_model(index: int, name: str)
-- Returns the transformation matrix of the bone with the specified index
skeleton:get_matrix(index: int) -> mat4
-- Sets the transformation matrix of the bone with the specified index
skeleton:set_matrix(index: int, matrix: mat4)
-- Returns the texture by key (dynamically assigned textures - '$name')
skeleton:get_texture(key: str) -> str
-- Assigns a texture by key
skeleton:set_texture(key: str, value: str)
-- Checks the visibility status of a bone by index
-- or the entire skeleton if index is not specified
skeleton:is_visible([optional] index: int) -> bool
-- Sets the visibility status of a bone by index
-- or the entire skeleton if index is not specified
skeleton:set_visible([optional] index: int, status: bool)
-- Returns the color of the entity
skeleton:get_color() -> vec4
-- Returns the color of the bone
skeleton:get_color(index: int) -> vec4
-- Sets the color of the entity
skeleton:set_color(color: vec4)
-- Sets the color of the bone
skeleton:set_color(color: vec4, bone: int)