animation

package
v0.6.13 Latest Latest
Warning

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

Go to latest
Published: Aug 10, 2025 License: BSD-3-Clause Imports: 15 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AddAnimation

func AddAnimation(ctx extractor.Context, doc *gltf.Document, boneInfo *bones.Info, anim state_machine.Animation) error

func ExtractAnimationJson

func ExtractAnimationJson(ctx extractor.Context) error

Types

type QuaternionCurve

type QuaternionCurve struct {
	Keyframes     []QuaternionKeyframe
	Duration      float32
	HermiteFrames [4]QuaternionKeyframe
	CurrentIndex  int
}

func (*QuaternionCurve) Sample

func (c *QuaternionCurve) Sample(framerate int) []QuaternionKeyframe

Samples the curve into duration * framerate keyframes, spaced evenly along the curve ref: https://www.cubic.org/docs/hermite.htm

func (*QuaternionCurve) ShiftFrame

func (c *QuaternionCurve) ShiftFrame()

type QuaternionKeyframe

type QuaternionKeyframe struct {
	Time       float32
	Quaternion mgl32.Quat
}

type VectorCurve

type VectorCurve struct {
	Keyframes     []VectorKeyframe
	Duration      float32
	HermiteFrames [4]VectorKeyframe
	CurrentIndex  int
}

func (*VectorCurve) Sample

func (c *VectorCurve) Sample(framerate int) []VectorKeyframe

Samples the curve into duration * framerate keyframes, spaced evenly along the curve ref: https://www.cubic.org/docs/hermite.htm

func (*VectorCurve) ShiftFrame

func (c *VectorCurve) ShiftFrame()

type VectorKeyframe

type VectorKeyframe struct {
	Time   float32
	Vector mgl32.Vec3
}

Jump to

Keyboard shortcuts

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