vanimation

package
v0.20.1 Latest Latest
Warning

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

Go to latest
Published: Sep 12, 2021 License: MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func DefaultMapJointfunc

func DefaultMapJointfunc(sk *vmodel.Skin, name string) (jIndex int)

Types

type BVHAnimation

type BVHAnimation struct {
	Root   *BvhJoint
	Joints []*BvhJoint

	Values map[string]float32
	// contains filtered or unexported fields
}

func LoadBVH

func LoadBVH(l vasset.Loader, filename string) (*BVHAnimation, error)

func (*BVHAnimation) BuildAnimation

func (bvh *BVHAnimation) BuildAnimation(sk *vmodel.Skin, mj MapJoint) vmodel.Animation

BuildAnimation tries to match skin bones orientation with BVH model orientation in world space for each recorded frame. BuildAnimation will create appropriate rotations to match target BVH bone direction. Therefore BVH will work even if original pose of BVH model and current model are different.

However, currently this will only works if original skin don't have any rotation applied in bone direction and root bone (typically Hips) should have no rotation in pose position. If this not true you will see odd twists at some bones in animated model!

type BvhJoint

type BvhJoint struct {
	Offset   mgl32.Vec3
	Name     string
	Children []*BvhJoint
	Len      mgl32.Vec3
	// contains filtered or unexported fields
}

func (*BvhJoint) GetPoseRotation

func (j *BvhJoint) GetPoseRotation() mgl32.Mat4

func (*BvhJoint) GetRotation

func (j *BvhJoint) GetRotation(frame int) mgl32.Mat4

func (*BvhJoint) GetTranslation

func (j *BvhJoint) GetTranslation(frame int) mgl32.Mat4

type MapJoint

type MapJoint func(sk *vmodel.Skin, name string) (jIndex int)

Jump to

Keyboard shortcuts

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