Documentation
¶
Index ¶
- func UpdateBoneRef(bones []*BoneOld)
- func WriteMQO(mqo *Document, ww io.Writer, path string) error
- func WriteMQX(mqo *Document, w io.Writer, mqoName string) error
- type Bone
- type BoneIK
- type BoneObj
- type BoneOld
- type BonePlugin
- type BonePose
- type BoneRef
- type BoneSet
- type BoneSet2
- type BoneWeight
- type BoneWeight2
- type Document
- func (doc *Document) BoneAdjustX(baseBone *Bone)
- func (doc *Document) BoneTransform(baseBone *Bone, transform func(v *Vector3))
- func (doc *Document) FixObjectID()
- func (doc *Document) GetObjectByID(id int) *Object
- func (doc *Document) GetPlugins() []Plugin
- func (doc *Document) Transform(transform func(v *Vector3))
- type Face
- type MQXDoc
- type Material
- type MaterialEx2
- type MorphPlugin
- type MorphSet
- type MorphTarget
- type MorphTargetList
- type Object
- type Parser
- type Plugin
- type PoseSet
- type Scene
- type Vector2
- type Vector3
- func (v *Vector3) Add(v2 *Vector3) *Vector3
- func (v *Vector3) Len() float32
- func (v *Vector3) MarshalXMLAttr(name xml.Name) (xml.Attr, error)
- func (v *Vector3) Normalize()
- func (v *Vector3) Sub(v2 *Vector3) *Vector3
- func (v *Vector3) ToArray(array []float32)
- func (v *Vector3) UnmarshalXMLAttr(attr xml.Attr) error
- type Vector4
- type VertexWeight
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func UpdateBoneRef ¶
func UpdateBoneRef(bones []*BoneOld)
Types ¶
type Bone ¶
type Bone struct { ID int `xml:"id,attr"` Name string `xml:"name,attr"` Group int `xml:"group,attr,omitempty"` Parent int `xml:"parent,attr,omitempty"` Pos Vector3 `xml:"pos,attr,omitempty"` Movable int `xml:"movable,attr,omitempty"` Hide int `xml:"hide,attr,omitempty"` Dummy int `xml:"dummy,attr,omitempty"` Color string `xml:"color,attr,omitempty"` UpVector *Vector3 `xml:"upVector,attr,omitempty"` Rotate *Vector3 `xml:"rotate,attr,omitempty"` IK *BoneIK `xml:"IK,omitempty"` Weights []*BoneWeight2 `xml:"W"` // contains filtered or unexported fields }
func (*Bone) SetVertexWeight ¶
func (b *Bone) SetVertexWeight(objectID, vertID int, weight float32) *VertexWeight
type BoneOld ¶
type BoneOld struct { ID int `xml:"id,attr"` Name string `xml:"name,attr"` Group int `xml:"group,attr"` IsDummy int `xml:"isDummy,attr"` RtX float32 `xml:"rtX,attr"` RtY float32 `xml:"rtY,attr"` RtZ float32 `xml:"rtZ,attr"` TpX float32 `xml:"tpX,attr"` TpY float32 `xml:"tpY,attr"` TpZ float32 `xml:"tpZ,attr"` MvX float32 `xml:"mvX,attr"` MvY float32 `xml:"mvY,attr"` MvZ float32 `xml:"mvZ,attr"` RotB float32 `xml:"rotB,attr"` RotH float32 `xml:"rotH,attr"` RotP float32 `xml:"rotP,attr"` Sc float32 `xml:"sc,attr"` MaxAngB float32 `xml:"maxAngB,attr"` MaxAngH float32 `xml:"maxAngH,attr"` MaxAngP float32 `xml:"maxAngP,attr"` MinAngB float32 `xml:"minAngB,attr"` MinAngH float32 `xml:"minAngH,attr"` MinAngP float32 `xml:"minAngP,attr"` Parent BoneRef `xml:"P"` Children []*BoneRef `xml:"C"` Weights []*BoneWeight `xml:"W"` }
type BonePlugin ¶
type BonePlugin struct { XMLName xml.Name `xml:"Plugin.56A31D20.71F282AB"` Name string `xml:"name,attr"` BoneSet BoneSet BoneSet2 BoneSet2 PoseSet PoseSet `xml:"Poses"` Obj []BoneObj }
func GetBonePlugin ¶
func GetBonePlugin(mqo *Document) *BonePlugin
func (*BonePlugin) AddBone ¶
func (p *BonePlugin) AddBone(b *Bone)
func (*BonePlugin) Bones ¶
func (p *BonePlugin) Bones() []*Bone
func (*BonePlugin) PostDeserialize ¶
func (p *BonePlugin) PostDeserialize(mqo *Document)
func (*BonePlugin) PreSerialize ¶
func (p *BonePlugin) PreSerialize(mqo *Document)
func (*BonePlugin) SetBones ¶
func (p *BonePlugin) SetBones(bones []*Bone)
func (*BonePlugin) Transform ¶
func (p *BonePlugin) Transform(transform func(v *Vector3))
type BonePose ¶
type BonePose struct { // oneof ID int `xml:"id,attr"` Name string `xml:"name,attr"` // Translation MvX float32 `xml:"mvX,attr"` MvY float32 `xml:"mvY,attr"` MvZ float32 `xml:"mvZ,attr"` // Rotation RotB float32 `xml:"rotB,attr"` RotH float32 `xml:"rotH,attr"` RotP float32 `xml:"rotP,attr"` // Scale ScB float32 `xml:"scB,attr"` ScH float32 `xml:"scH,attr"` ScP float32 `xml:"scP,attr"` }
type BoneWeight ¶
type BoneWeight2 ¶
type BoneWeight2 struct { ObjectID int `xml:"obj,attr"` Vertexes []*VertexWeight `xml:"V"` }
type Document ¶ added in v0.2.1
func NewDocument ¶
func NewDocument() *Document
func (*Document) BoneAdjustX ¶ added in v0.2.2
for T-Pose adjustment TODO: more generic function.
func (*Document) BoneTransform ¶ added in v0.2.3
func (*Document) FixObjectID ¶ added in v0.2.1
func (doc *Document) FixObjectID()
func (*Document) GetObjectByID ¶ added in v0.2.2
func (*Document) GetPlugins ¶ added in v0.2.1
type MQXDoc ¶
type MaterialEx2 ¶
func (*MaterialEx2) FloatParam ¶ added in v0.2.1
func (m *MaterialEx2) FloatParam(name string) float64
func (*MaterialEx2) IntParam ¶ added in v0.2.1
func (m *MaterialEx2) IntParam(name string) int
func (*MaterialEx2) StringParam ¶ added in v0.2.1
func (m *MaterialEx2) StringParam(name string) string
type MorphPlugin ¶
type MorphPlugin struct { XMLName xml.Name `xml:"Plugin.56A31D20.C452C6DB"` Name string `xml:"name,attr"` MorphSet MorphSet }
func GetMorphPlugin ¶
func GetMorphPlugin(mqo *Document) *MorphPlugin
func (*MorphPlugin) Morphs ¶ added in v0.2.0
func (p *MorphPlugin) Morphs() []*MorphTargetList
func (*MorphPlugin) PostDeserialize ¶
func (p *MorphPlugin) PostDeserialize(mqo *Document)
func (*MorphPlugin) PreSerialize ¶
func (p *MorphPlugin) PreSerialize(mqo *Document)
type MorphSet ¶
type MorphSet struct {
Targets []*MorphTargetList `xml:"TargetList"`
}
type MorphTarget ¶
type MorphTargetList ¶
type MorphTargetList struct { Base string `xml:"base,attr"` Target []*MorphTarget }
type Object ¶
type Object struct { UID int Name string Vertexes []*Vector3 Faces []*Face Visible bool Locked bool Depth int Shading int Facet float32 Patch int Segment int Mirror int MirrorDis float32 VertexByUID map[int]int }
func (*Object) GetSmoothNormals ¶ added in v0.2.3
func (*Object) GetVertexIndexByID ¶ added in v0.2.1
type VertexWeight ¶
Click to show internal directories.
Click to hide internal directories.