From 041142d30c9b87693b4cc01f81e145b0ab1aec89 Mon Sep 17 00:00:00 2001 From: JupiterRider <60042618+JupiterRider@users.noreply.github.com> Date: Sat, 14 Dec 2024 21:57:46 +0100 Subject: [PATCH] update another ModelAnimation example --- examples/models/animation/main.go | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/examples/models/animation/main.go b/examples/models/animation/main.go index 851d38f..b8d3c40 100644 --- a/examples/models/animation/main.go +++ b/examples/models/animation/main.go @@ -21,8 +21,6 @@ package main import ( - "unsafe" - rl "github.com/gen2brain/raylib-go/raylib" ) @@ -76,9 +74,8 @@ func main() { rl.DrawModelEx(model, position, rl.NewVector3(1, 0, 0), -90, rl.NewVector3(1, 1, 1), rl.White) // Draw translation cubes for i := int32(0); i < model.BoneCount; i++ { - framePose := unsafe.Slice(anims[0].FramePoses, anims[0].FrameCount) - trans := unsafe.Slice(framePose[animFrameCount], model.BoneCount) - rl.DrawCube(trans[i].Translation, 0.2, 0.2, 0.2, rl.Red) + pose := anims[0].GetFramePose(animFrameCount, int(i)) + rl.DrawCube(pose.Translation, 0.2, 0.2, 0.2, rl.Red) } rl.DrawGrid(10, 1)