vmd

package module
v0.0.1 Latest Latest
Warning

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

Go to latest
Published: Jun 22, 2021 License: Unlicense Imports: 8 Imported by: 0

Documentation

Overview

Package vmd 解码vmd格式的动作文件

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type BoneFrame

type BoneFrame struct {
	Bone       string     // 骨骼名字
	Time       uint32     // 帧序号
	Translate  [3]float32 // 移动
	RotateQuat [4]float32 // 旋转 四元数
	XCurve     [16]byte   // X 曲线
	YCurve     [16]byte   // Y 曲线
	ZCurve     [16]byte   // Z 曲线
	RCurve     [16]byte   // 旋转曲线
}

type CameraFrame

type CameraFrame struct {
	Time      uint32     // 帧序号
	Distance  float32    // 距离
	Translate [3]float32 // 移动
	RotateXyz [3]float32 // 旋转xyz
	Curve     [24]byte
	ViewAngle float32
	Ortho     byte
}
type Header struct {
	Version int    // 1 or 2
	Model   string // 模型里应该是Shift_JIS编码, 我们转为utf-8
}

type LightFrame

type LightFrame struct {
	Time      uint32 // 帧序号
	Color     [3]float32
	Direction [3]float32
}

type MorphFrame

type MorphFrame struct {
	Morph  string  // morph动画名字
	Time   uint32  // 帧序号
	Weight float32 // 权重

}

type VMD

type VMD struct {
	Header

	BoneFrames   []BoneFrame
	MorphFrames  []MorphFrame
	CameraFrames []CameraFrame
	LightFrames  []LightFrame
}

func Decode

func Decode(r io.Reader) (vm *VMD, err error)

Jump to

Keyboard shortcuts

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