animation

package
v0.7.21 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Mar 29, 2026 License: BSD-3-Clause Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Animation

type Animation struct {
	Header  AnimationHeader `json:"header"`
	Entries []Entry         `json:"entries"`
	Size    uint32          `json:"-"`
}

func LoadAnimation

func LoadAnimation(r io.ReadSeeker) (*Animation, error)

type AnimationHeader

type AnimationHeader struct {
	Unk00                 uint32               `json:"-"`
	BoneCount             uint32               `json:"boneCount"`
	AnimationLength       float32              `json:"length"`
	Size                  uint32               `json:"-"`
	HashesCount           uint32               `json:"-"` // These may or may not be hashes
	BeatCount             uint32               `json:"-"` // but they're definitely 8 bytes
	Hashes                []stingray.Hash      `json:"-"` // wide as far as I've seen
	ResolvedHashes        []string             `json:"hashes"`
	Beats                 []rawBeat            `json:"-"`
	ResolvedBeats         []Beat               `json:"beats"`
	Unk02                 uint16               `json:"unk02"`
	TransformCompressions []InitialCompression `json:"transformCompressions"`
	InitialTransforms     []BoneInitialState   `json:"initialTransforms"`
	HashFloats            []float32            `json:"hashFloats"`
}

type Beat added in v0.7.13

type Beat struct {
	TimeStamp float32           `json:"timestamp"` // Timestamp of beat in seconds
	NameHash  stingray.ThinHash `json:"-"`
	Name      string            `json:"name"`
}

type BoneInitialState

type BoneInitialState struct {
	InitialCompression
	// contains filtered or unexported fields
}

func (*BoneInitialState) IsAdditive

func (b *BoneInitialState) IsAdditive() bool

func (BoneInitialState) MarshalJSON

func (b BoneInitialState) MarshalJSON() ([]byte, error)

func (*BoneInitialState) Position

func (b *BoneInitialState) Position() mgl32.Vec3

func (*BoneInitialState) Rotation

func (b *BoneInitialState) Rotation() mgl32.Quat

func (*BoneInitialState) Scale

func (b *BoneInitialState) Scale() mgl32.Vec3

type Entry

type Entry struct {
	Header *EntryHeader
	Data   interface{}
}

func (*Entry) MarshalJSON

func (e *Entry) MarshalJSON() ([]byte, error)

func (*Entry) Position

func (e *Entry) Position() (mgl32.Vec3, error)

func (*Entry) Rotation

func (e *Entry) Rotation() (mgl32.Quat, error)

func (*Entry) Scale

func (e *Entry) Scale() (mgl32.Vec3, error)

type EntryHeader

type EntryHeader struct {
	Kind                  EntryHeaderType
	CompressedTimestamp   uint16
	UncompressedBone      uint32
	UncompressedTimestamp float32
}

func ReadEntryHeader

func ReadEntryHeader(r io.Reader) (*EntryHeader, error)

func (*EntryHeader) Bone

func (e *EntryHeader) Bone() uint16

func (EntryHeader) MarshalJSON

func (e EntryHeader) MarshalJSON() ([]byte, error)

func (*EntryHeader) Subtype

func (e *EntryHeader) Subtype() EntrySubtype

func (*EntryHeader) TimeMS

func (e *EntryHeader) TimeMS() uint32

func (*EntryHeader) Type

func (e *EntryHeader) Type() EntryType

type EntryHeaderType

type EntryHeaderType uint16

func (*EntryHeaderType) Bone

func (e *EntryHeaderType) Bone() uint16

func (*EntryHeaderType) TimeMS

func (e *EntryHeaderType) TimeMS(bottom16 uint16) uint32

func (*EntryHeaderType) Type

func (e *EntryHeaderType) Type() EntryType

type EntrySubtype

type EntrySubtype uint16
const (
	EntrySubtypeTimestamp  EntrySubtype = 0x0002
	EntrySubtypeTerminator EntrySubtype = 0x0003
	EntrySubtypePosition   EntrySubtype = 0x0004
	EntrySubtypeRotation   EntrySubtype = 0x0005
	EntrySubtypeScale      EntrySubtype = 0x0006
)

type EntryType

type EntryType uint8
const (
	EntryTypeExtended EntryType = 0
	EntryTypeScale    EntryType = 1
	EntryTypePosition EntryType = 2
	EntryTypeRotation EntryType = 3
)

func (EntryType) MarshalText

func (t EntryType) MarshalText() ([]byte, error)

func (EntryType) String

func (t EntryType) String() string

type InitialCompression

type InitialCompression struct {
	Position bool `json:"position"`
	Rotation bool `json:"rotation"`
	Scale    bool `json:"scale"`
}

type PackedQuaternion

type PackedQuaternion uint32

func (*PackedQuaternion) First

func (p *PackedQuaternion) First() float32

func (*PackedQuaternion) Largest

func (p *PackedQuaternion) Largest() uint32

func (PackedQuaternion) MarshalJSON

func (p PackedQuaternion) MarshalJSON() ([]byte, error)

func (*PackedQuaternion) Quaternion

func (p *PackedQuaternion) Quaternion() mgl32.Quat

func (*PackedQuaternion) Second

func (p *PackedQuaternion) Second() float32

func (*PackedQuaternion) Third

func (p *PackedQuaternion) Third() float32

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL