ModelAnimation.GetName() added
This commit is contained in:
parent
dce94f509d
commit
533c35110b
1 changed files with 12 additions and 1 deletions
|
@ -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
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue