Add animation functions, issue #156
This commit is contained in:
parent
91296a7d50
commit
f98e6e2e57
2 changed files with 61 additions and 4 deletions
|
@ -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
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue