mot

package
v0.0.0-...-69aa1dc Latest Latest
Warning

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

Go to latest
Published: Nov 25, 2024 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

View Source
const (
	Signature uint32 = 0x3362746D
)

Variables

This section is empty.

Functions

func FromPath

func FromPath(mot *Mot, filePath string) error

func FromPathWithOffsetSize

func FromPathWithOffsetSize(mot *Mot, filePath string, offset uint32, size uint32) error

Types

type Curve

type Curve struct {
	FrameDelta      uint8 `json:"frame_delta"`
	ControlPoint    uint8 `json:"control_point"`
	ControlTangent0 uint8 `json:"control_tangent_0"`
	ControlTangent1 uint8 `json:"control_tangent_1"`
}

func NewCurve

func NewCurve() *Curve

type Mot

type Mot struct {
	Offset              uint32    `json:"offset"`
	Size                uint32    `json:"size"`
	FrameTotal          uint16    `json:"frame_total"`
	RecordTotal         uint8     `json:"record_total"`
	UseInverseKinematic uint8     `json:"use_inverse_kinematic"`
	Records             []*Record `json:"record"`
}

func New

func New() *Mot

type Record

type Record struct {
	IsNull             bool   `json:"is_null"`
	Target             uint8  `json:"target"`
	Channel            uint8  `json:"channel"`
	CurveTotal         uint16 `json:"curve_total"`
	UseGlobalTransform uint32 `json:"use_global_transform"`

	Position      uint16   `json:"position"`
	PositionDelta uint16   `json:"position_delta"`
	Tangent0      uint16   `json:"tangent_0"`
	TangentDelta0 uint16   `json:"tangent_delta_0"`
	Tangent1      uint16   `json:"tangent_1"`
	TangentDelta1 uint16   `json:"tangent_delta_1"`
	Curves        []*Curve `json:"curves"`
}

func NewRecord

func NewRecord() *Record

func (*Record) CurveToBezier

func (self *Record) CurveToBezier(
	index int,
	p0 *[2]float32,
	p1 *[2]float32,
	p2 *[2]float32,
	p3 *[2]float32,
	tangentScale float32,
) error

func (*Record) CurveToHermite

func (self *Record) CurveToHermite(
	index int,
	p0 *[2]float32,
	m0 *float32,
	p1 *[2]float32,
	m1 *float32,
) error

func (*Record) CurveToLinear

func (self *Record) CurveToLinear(
	index int,
	p0 *[2]float32,
	p1 *[2]float32,
) error

func (*Record) QuantizeHermite

func (self *Record) QuantizeHermite(frameTotal uint16) []float32

func (*Record) QuantizeLinear

func (self *Record) QuantizeLinear(frameTotal uint16) []float32

Jump to

Keyboard shortcuts

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