Add animation functions, issue #156

This commit is contained in:
Milan Nikolic 2022-01-16 11:13:25 +01:00
parent 91296a7d50
commit f98e6e2e57
No known key found for this signature in database
GPG key ID: 9229D0EAA3AA4E75
2 changed files with 61 additions and 4 deletions

View file

@ -842,6 +842,7 @@ type MaterialMap struct {
Value float32
}
// Model, meshes, materials and animation data
type Model struct {
// Local transform matrix
Transform Matrix
@ -860,13 +861,13 @@ func newModelFromPointer(ptr unsafe.Pointer) Model {
return *(*Model)(ptr)
}
// BoneInfo type.
// BoneInfo type
type BoneInfo struct {
Name [32]int8
Parent int32
}
// Transform type.
// Transform type
type Transform struct {
Translation Vector3
Rotation Vector4
@ -891,6 +892,19 @@ func newRayFromPointer(ptr unsafe.Pointer) Ray {
return *(*Ray)(ptr)
}
// ModelAnimation type
type ModelAnimation struct {
BoneCount int32
FrameCount int32
Bones *BoneInfo
FramePoses **Transform
}
// newModelAnimationFromPointer - Returns new ModelAnimation from pointer
func newModelAnimationFromPointer(ptr unsafe.Pointer) ModelAnimation {
return *(*ModelAnimation)(ptr)
}
// RayCollision type - ray hit information
type RayCollision struct {
Hit bool