From 533c35110b498d7fa10dd256ae3687a172450dd3 Mon Sep 17 00:00:00 2001 From: JupiterRider <60042618+JupiterRider@users.noreply.github.com> Date: Sat, 14 Dec 2024 21:26:58 +0100 Subject: [PATCH] ModelAnimation.GetName() added --- raylib/raylib.go | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/raylib/raylib.go b/raylib/raylib.go index 935709a..0cd3126 100644 --- a/raylib/raylib.go +++ b/raylib/raylib.go @@ -929,7 +929,7 @@ type ModelAnimation struct { FrameCount int32 Bones *BoneInfo FramePoses **Transform - Name [32]int8 + Name [32]uint8 } // GetBones returns the bones information (skeleton) of a ModelAnimation as go slice @@ -943,6 +943,17 @@ func (m ModelAnimation) GetFramePose(frame, bone int) Transform { return unsafe.Slice(framePoses[frame], m.BoneCount)[bone] } +// GetName returns the ModelAnimation's name as go string +func (m ModelAnimation) GetName() string { + var end int + for end = range m.Name { + if m.Name[end] == 0 { + break + } + } + return string(m.Name[:end]) +} + // RayCollision type - ray hit information type RayCollision struct { Hit bool