Documentation ¶
Index ¶
- Constants
- func Save(doc *Document, path string) error
- func Write(w io.Writer, doc *Document) error
- type Attribute
- func (p Attribute) Len() uint
- func (p *Attribute) String() string
- func (p *Attribute) ToFloat32(defvalue float32) float32
- func (p *Attribute) ToFloat32Array() []float32
- func (p *Attribute) ToFloat64(defvalue float64) float64
- func (p *Attribute) ToInt(defvalue int) int
- func (p *Attribute) ToInt32Array() []int32
- func (p *Attribute) ToInt64(defvalue int64) int64
- func (p *Attribute) ToString() string
- type AttributeList
- type Deformer
- type Document
- type Geometry
- func (g *Geometry) GetDeformers() []*Deformer
- func (g *Geometry) GetLayerElement(name string, arrayName string, indexName string) *LayerElement
- func (g *Geometry) GetLayerElementBinormal() *LayerElement
- func (g *Geometry) GetLayerElementMaterial() *LayerElement
- func (g *Geometry) GetLayerElementNormal() *LayerElement
- func (g *Geometry) GetLayerElementSmoothing() *LayerElement
- func (g *Geometry) GetLayerElementTangent() *LayerElement
- func (g *Geometry) GetLayerElementUV() *LayerElement
- func (g *Geometry) GetShapes() []*GeometryShape
- func (g *Geometry) GetVertices() []*geom.Vector3
- func (g *Geometry) Init()
- func (g *Geometry) SetLayerElementMaterialIndex(mat []int32, mappingType MappingType)
- func (g *Geometry) SetLayerElementNormal(normals []*geom.Vector3, mappingType MappingType)
- func (g *Geometry) SetLayerElementUVIndexed(uv []*geom.Vector2, indices []int32, mappingType MappingType)
- type GeometryShape
- type LayerElement
- type MappingType
- type Material
- type Model
- func (m *Model) GetChildModels() []*Model
- func (m *Model) GetGeometry() *Geometry
- func (m *Model) GetMatrix() *geom.Matrix4
- func (m *Model) GetRotation() *geom.Vector3
- func (m *Model) GetScaling() *geom.Vector3
- func (m *Model) GetTranslation() *geom.Vector3
- func (m *Model) GetWorldMatrix() *geom.Matrix4
- func (m *Model) SetRotation(v *geom.Vector3)
- func (m *Model) SetScaling(v *geom.Vector3)
- func (m *Model) SetTranslation(v *geom.Vector3)
- func (m *Model) UpdateMatrix()
- type Node
- func (n *Node) AddChild(node *Node)
- func (n *Node) Attr(i int) *Attribute
- func (n *Node) Dump(w io.Writer, d int, full bool)
- func (n *Node) FindChild(name string) *Node
- func (n *Node) GetChildren() []*Node
- func (n *Node) GetFloat32(defvalue float32) float32
- func (n *Node) GetFloat32Array() []float32
- func (n *Node) GetInt(defvalue int) int
- func (n *Node) GetInt32Array() []int32
- func (n *Node) GetInt64(defvalue int64) int64
- func (n *Node) GetString() string
- func (n *Node) GetVec2Array() []*geom.Vector2
- func (n *Node) GetVec3Array() []*geom.Vector3
- func (n *Node) RemoveChild(node *Node) bool
- type Obj
- func (o *Obj) AddOrReplaceChild(node *Node) bool
- func (o *Obj) AddRef(ref Object)
- func (o *Obj) FindRefs(typ string) []Object
- func (o *Obj) GetNode() *Node
- func (o *Obj) GetProperty(name string) *Property
- func (o *Obj) ID() int64
- func (o *Obj) Kind() string
- func (o *Obj) Name() string
- func (o *Obj) NodeName() string
- func (o *Obj) SetColorProperty(name string, r, g, b float32) *Property
- func (o *Obj) SetFloatProperty(name string, v float64) *Property
- func (o *Obj) SetIntProperty(name string, v int) *Property
- func (o *Obj) SetProperty(name string, prop *Property) *Property
- func (o *Obj) SetStringProperty(name string, v string) *Property
- type Object
- type Property
Constants ¶
View Source
const ( Ident tokenType = iota Number String BlockStart BlockEnd Comma Colon Asterisk EOL )
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Attribute ¶
type Attribute struct {
Value interface{}
}
func (*Attribute) ToFloat32Array ¶
func (*Attribute) ToInt32Array ¶
type AttributeList ¶
type AttributeList []*Attribute
func (AttributeList) Get ¶
func (p AttributeList) Get(i int) *Attribute
func (AttributeList) ToFloat32 ¶
func (p AttributeList) ToFloat32(defvalue float32) float32
func (AttributeList) ToInt ¶
func (p AttributeList) ToInt(defvalue int) int
func (AttributeList) ToString ¶
func (p AttributeList) ToString() string
type Deformer ¶
type Deformer struct {
Obj
}
TODO: rename to SubDeformer
func (*Deformer) GetIndexes ¶
func (*Deformer) GetShapes ¶ added in v0.3.2
func (d *Deformer) GetShapes() []*GeometryShape
func (*Deformer) GetTransform ¶ added in v0.3.2
func (*Deformer) GetTransformLink ¶ added in v0.3.2
func (*Deformer) GetWeights ¶
type Document ¶
type Document struct { FileId []byte Creator string CreationTime string GlobalSettings Object Scene *Model Materials []*Material ObjectByID map[int64]Object RawNode *Node NextObjectID int64 }
func BuildDocument ¶
func NewDocument ¶ added in v0.3.4
func NewDocument() *Document
func (*Document) AddConnection ¶ added in v0.3.4
func (*Document) AddPropConnection ¶ added in v0.3.4
type Geometry ¶
func NewGeometry ¶ added in v0.3.4
func (*Geometry) GetDeformers ¶
func (*Geometry) GetLayerElement ¶ added in v0.3.2
func (g *Geometry) GetLayerElement(name string, arrayName string, indexName string) *LayerElement
func (*Geometry) GetLayerElementBinormal ¶ added in v0.3.2
func (g *Geometry) GetLayerElementBinormal() *LayerElement
func (*Geometry) GetLayerElementMaterial ¶ added in v0.3.2
func (g *Geometry) GetLayerElementMaterial() *LayerElement
func (*Geometry) GetLayerElementNormal ¶ added in v0.3.2
func (g *Geometry) GetLayerElementNormal() *LayerElement
func (*Geometry) GetLayerElementSmoothing ¶ added in v0.3.2
func (g *Geometry) GetLayerElementSmoothing() *LayerElement
func (*Geometry) GetLayerElementTangent ¶ added in v0.3.2
func (g *Geometry) GetLayerElementTangent() *LayerElement
func (*Geometry) GetLayerElementUV ¶ added in v0.3.2
func (g *Geometry) GetLayerElementUV() *LayerElement
func (*Geometry) GetShapes ¶
func (g *Geometry) GetShapes() []*GeometryShape
func (*Geometry) GetVertices ¶
func (*Geometry) SetLayerElementMaterialIndex ¶ added in v0.3.4
func (g *Geometry) SetLayerElementMaterialIndex(mat []int32, mappingType MappingType)
func (*Geometry) SetLayerElementNormal ¶ added in v0.3.4
func (g *Geometry) SetLayerElementNormal(normals []*geom.Vector3, mappingType MappingType)
func (*Geometry) SetLayerElementUVIndexed ¶ added in v0.3.4
func (g *Geometry) SetLayerElementUVIndexed(uv []*geom.Vector2, indices []int32, mappingType MappingType)
type GeometryShape ¶
type GeometryShape struct {
*Node
}
func (*GeometryShape) GetIndexes ¶
func (s *GeometryShape) GetIndexes() []int32
func (*GeometryShape) GetNormals ¶
func (s *GeometryShape) GetNormals() []*geom.Vector3
func (*GeometryShape) GetVertices ¶
func (s *GeometryShape) GetVertices() []*geom.Vector3
func (*GeometryShape) Name ¶
func (s *GeometryShape) Name() string
type LayerElement ¶ added in v0.3.2
func (*LayerElement) GetIndexes ¶ added in v0.3.2
func (e *LayerElement) GetIndexes() []int32
func (*LayerElement) GetMappingInformationType ¶ added in v0.3.2
func (e *LayerElement) GetMappingInformationType() MappingType
func (*LayerElement) GetReferenceInformationType ¶ added in v0.3.2
func (e *LayerElement) GetReferenceInformationType() string
type MappingType ¶ added in v0.3.4
type MappingType string
const ( AllSame MappingType = "AllSame" ByPolygon MappingType = "ByPolygon" ByVertice MappingType = "ByVertice" ByPolygonVertex MappingType = "ByPolygonVertex" ByControlPoint MappingType = "ByControlPoint" )
type Material ¶
type Material struct {
Obj
}
func NewMaterial ¶ added in v0.3.4
func (*Material) GetTexture ¶
type Model ¶
func (*Model) GetChildModels ¶
func (*Model) GetGeometry ¶
func (*Model) GetRotation ¶ added in v0.3.4
func (*Model) GetScaling ¶ added in v0.3.4
func (*Model) GetTranslation ¶
func (*Model) GetWorldMatrix ¶
func (*Model) SetRotation ¶ added in v0.3.4
func (*Model) SetScaling ¶ added in v0.3.4
func (*Model) SetTranslation ¶ added in v0.3.4
func (*Model) UpdateMatrix ¶
func (m *Model) UpdateMatrix()
type Node ¶
type Node struct { Name string Attributes AttributeList Children []*Node }
func (*Node) GetChildren ¶
func (*Node) GetFloat32 ¶
func (*Node) GetFloat32Array ¶
func (*Node) GetInt32Array ¶
func (*Node) GetVec2Array ¶
func (*Node) GetVec3Array ¶
func (*Node) RemoveChild ¶
type Obj ¶
func (*Obj) AddOrReplaceChild ¶ added in v0.3.4
func (*Obj) GetProperty ¶ added in v0.3.4
func (*Obj) SetColorProperty ¶ added in v0.3.4
func (*Obj) SetFloatProperty ¶ added in v0.3.4
func (*Obj) SetIntProperty ¶ added in v0.3.4
func (*Obj) SetProperty ¶ added in v0.3.4
Click to show internal directories.
Click to hide internal directories.