Documentation ¶
Overview ¶
Package collada
Index ¶
- func DumpColorOrTexture(name string, v interface{}, out io.Writer, indent int)
- func DumpFloatOrParam(name string, v interface{}, out io.Writer, indent int)
- type Accessor
- type ActionFunc
- type Ambient
- type Animation
- type AnimationTarget
- type Asset
- type Bind
- type BindMaterial
- type BindVertexInput
- type Blinn
- type Channel
- type ChannelInstance
- type Collada
- type Color
- type Constant
- type Contributor
- type Decoder
- func (d *Decoder) Dump(out io.Writer, indent int)
- func (d *Decoder) GetGeometry(id string) (geometry.GeometryI, uint32, error)
- func (d *Decoder) GetMaterial(id string) (material.MaterialI, error)
- func (d *Decoder) GetTexture2D(id string) (*texture.Texture2D, error)
- func (d *Decoder) NewAnimationTargets(scene node.NodeI) (map[string]*AnimationTarget, error)
- func (d *Decoder) NewGeometry(id string) (geometry.GeometryI, uint32, error)
- func (d *Decoder) NewMaterial(id string) (material.MaterialI, error)
- func (d *Decoder) NewScene() (node.NodeI, error)
- func (d *Decoder) NewTexture2D(id string) (*texture.Texture2D, error)
- func (d *Decoder) SetDirImages(path string)
- type Directional
- type Effect
- type Float
- type FloatArray
- type FloatValue
- type Geometry
- type Image
- type InitFrom
- type Input
- type InputShared
- type InstanceEffect
- type InstanceGeometry
- type InstanceMaterial
- type InstanceVisualScene
- type Lambert
- type LibraryAnimations
- type LibraryEffects
- type LibraryGeometries
- type LibraryImages
- type LibraryLights
- type LibraryMaterials
- type LibraryVisualScenes
- type Light
- type LightColor
- type LineStrips
- type Lines
- type Material
- type Matrix
- type Mesh
- type NameArray
- type Newparam
- type Node
- type Param
- type Phong
- type Point
- type Polylist
- type ProfileCOMMON
- type Rotate
- type Sampler
- type Sampler2D
- type SamplerInstance
- type Scale
- type Scene
- type Source
- type Spot
- type Surface
- type Texture
- type Translate
- type Triangles
- type Trifans
- type Tristrips
- type Vertices
- type VisualScene
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func DumpColorOrTexture ¶
DumpColorOrTexture prints out information about the Color or Texture
Types ¶
type ActionFunc ¶
type ActionFunc func(at *AnimationTarget, v float32)
ActionFunc is the type for all functions that execute an specific parameter animation
type Animation ¶
type Animation struct { Id string Name string Animation []*Animation Source []*Source Sampler []*Sampler Channel []*Channel }
Animation
type AnimationTarget ¶
type AnimationTarget struct {
// contains filtered or unexported fields
}
AnimationTarget contains all animation channels for an specific target node
func (*AnimationTarget) Reset ¶
func (at *AnimationTarget) Reset()
Reset resets the animation from the beginning
func (*AnimationTarget) SetLoop ¶
func (at *AnimationTarget) SetLoop(loop bool)
SetLoop sets the state of the animation loop flag
func (*AnimationTarget) SetStart ¶
func (at *AnimationTarget) SetStart(v float32)
SetStart sets the initial offset value
func (*AnimationTarget) Update ¶
func (at *AnimationTarget) Update(delta float32) bool
Update interpolates the specified input value for each animation target channel and executes its corresponding action function. Returns true if the input value is inside the key frames ranges or false otherwise.
type Asset ¶
type Asset struct { Contributor Contributor Created string Modified string UpAxis string }
Asset
type BindMaterial ¶
type BindMaterial struct { Params []Param TechniqueCommon struct { InstanceMaterial []*InstanceMaterial } }
BindMaterial
type BindVertexInput ¶
BindVertexInput
type Blinn ¶
type Blinn struct { Emission interface{} Ambient interface{} Diffuse interface{} Specular interface{} Shininess interface{} Reflective interface{} Reflectivity interface{} Transparent interface{} Transparency interface{} IndexOfRefraction interface{} }
Blinn
type ChannelInstance ¶
type ChannelInstance struct {
// contains filtered or unexported fields
}
A ChannelInstance associates an animation parameter channel to an interpolation sampler
type Collada ¶
type Collada struct { Version string Asset Asset LibraryAnimations *LibraryAnimations LibraryImages *LibraryImages LibraryLights *LibraryLights LibraryEffects *LibraryEffects LibraryMaterials *LibraryMaterials LibraryGeometries *LibraryGeometries LibraryVisualScenes *LibraryVisualScenes Scene *Scene }
Collada DOM root
type Constant ¶
type Constant struct { Emission interface{} Reflective interface{} Reflectivity interface{} Transparent interface{} Transparency interface{} IndexOfRefraction interface{} }
Constant
type Contributor ¶
type Contributor struct { Author string AuthorEmail string AuthorWebsite string AuthoringTool string Comments string Copyright string SourceData string }
Contributor
type Decoder ¶
type Decoder struct {
// contains filtered or unexported fields
}
Decoder contains all decoded data from collada file
func DecodeReader ¶
DecodeReader decodes the specified collada reader returning a decoder object and an error.
func (*Decoder) Dump ¶
Dump writes to the specified writer a text dump of the decoded Collada DOM to aid debugging.
func (*Decoder) GetGeometry ¶
GetGeometry returns a pointer to an instance of the geometry with the specified id in the Collada document, its primitive type and an error. If no previous instance of the geometry was found the geometry is created
func (*Decoder) GetMaterial ¶
GetMaterial returns a pointer to an instance of the material with the specified id in the Collada document and an error. If no previous instance of the material was found it is created.
func (*Decoder) GetTexture2D ¶
GetTexture2D returns a pointer to an instance of the Texture2D with the specified id in the Collada document and an error. If no previous instance of the texture was found it is created.
func (*Decoder) NewAnimationTargets ¶
NewAnimationTargets creates and returns a map of all animation targets contained in the decoded Collada document and for the previously decoded scene. The map is indexed by the node loaderID.
func (*Decoder) NewGeometry ¶
NewGeometry creates and returns a pointer to a new instance of the geometry with the specified id in the Collada document, its primitive type and and error.
func (*Decoder) NewMaterial ¶
NewMaterial creates and returns a pointer to a new material from the specified material id/url in the dom
func (*Decoder) NewTexture2D ¶
NewTexture2D creates and returns a pointer to a new Texture2D from the specified sampler2D id/url in the dom
func (*Decoder) SetDirImages ¶
type FloatArray ¶
FloatArray
type FloatValue ¶
FloatValue
type Geometry ¶
type Geometry struct { Id string // Geometry id (optional) Name string // Geometry name (optional) GeometricElement interface{} // Geometry type object (Mesh|others) }
Geometry
type Image ¶
type Image struct { Id string Name string Format string Height uint Width uint Depth uint ImageSource interface{} }
Image
type InstanceEffect ¶
InstanceEffect
type InstanceGeometry ¶
type InstanceGeometry struct { Url string // Geometry URL (required) references the ID of a Geometry Name string // name of this element (optional) BindMaterial *BindMaterial }
InstanceGeometry
type InstanceMaterial ¶
type InstanceMaterial struct { Sid string Name string Target string Symbol string Bind []Bind BindVertexInput []BindVertexInput }
InstanceMaterial
type InstanceVisualScene ¶
InstanceVisualScene
type Lambert ¶
type Lambert struct { Emission interface{} Ambient interface{} Diffuse interface{} Reflective interface{} Reflectivity interface{} Transparent interface{} Transparency interface{} IndexOfRefraction interface{} }
Lambert
type LibraryAnimations ¶
Library Animations
type LibraryEffects ¶
LibraryEffects
type LibraryGeometries ¶
LibraryGeometries
type LibraryImages ¶
LibraryImages
type LibraryLights ¶
LibraryLights
type LibraryMaterials ¶
LibraryMaterials
type LibraryVisualScenes ¶
type LibraryVisualScenes struct { Asset *Asset VisualScene []*VisualScene }
LibraryVisualScenes
type LightColor ¶
LightColor
type LineStrips ¶
type LineStrips struct { Name string Count int Material string Input []InputShared P []int }
LineStrips
type Lines ¶
type Lines struct { Name string Count int Material string Input []InputShared P []int }
Lines
type Material ¶
type Material struct { Id string Name string Asset *Asset InstanceEffect InstanceEffect }
Material
type Mesh ¶
type Mesh struct { Source []*Source // One or more sources Sources Vertices Vertices // Vertices positions PrimitiveElements []interface{} // Geometry primitives (polylist|others) }
Mesh
type Node ¶
type Node struct { Id string Name string Sid string Type string Layer []string TransformationElements []interface{} // Node instance type (may be nil) Instance interface{} Node []*Node // Array of children nodes }
Node is embedded in each node instance
type Phong ¶
type Phong struct { Emission interface{} Ambient interface{} Diffuse interface{} Specular interface{} Shininess interface{} Reflective interface{} Reflectivity interface{} Transparent interface{} Transparency interface{} IndexOfRefraction interface{} }
Phong
type Point ¶
type Point struct { Color LightColor ConstantAttenuation *FloatValue LinearAttenuation *FloatValue QuadraticAttenuation *FloatValue }
Point
type Polylist ¶
type Polylist struct { Name string Count int Material string Input []InputShared Vcount []int P []int }
Polylist
type ProfileCOMMON ¶
type ProfileCOMMON struct { Id string Asset *Asset Newparam []*Newparam Technique struct { Id string Sid string Asset *Asset ShaderElement interface{} // Blinn|Constant|Lambert|Phong } }
ProfileCOMMON
type SamplerInstance ¶
type SamplerInstance struct { Input []float32 // Input keys (usually time) Output []float32 // Outputs values for the keys Interp []string // Names of interpolation functions for each key frame InTangent []float32 // Origin tangents for Bezier interpolation OutTangent []float32 // End tangents for Bezier interpolation }
SamplerInstance specifies the input key frames, output values for these key frames and interpolation information. It can be shared by more than one animation
func NewSamplerInstance ¶
func NewSamplerInstance(ca *Animation, uri string) (*SamplerInstance, error)
NewSamplerInstance creates and returns a pointer to a new SamplerInstance built with data from the specified Collada animation and URI
func (*SamplerInstance) Interpolate ¶
func (si *SamplerInstance) Interpolate(inp float32) (float32, bool)
Interpolate returns the interpolated output and its validity for this sampler for the specified input.
type Source ¶
type Source struct { Id string // Source id Name string // Source name ArrayElement interface{} // Array element (FloatArray|others) TechniqueCommon struct { Accessor Accessor } }
Source
type Spot ¶
type Spot struct { Color LightColor ConstantAttenuation *FloatValue LinearAttenuation *FloatValue QuadraticAttenuation *FloatValue FalloffAngle *FloatValue FalloffExponent *FloatValue }
Spot
type Triangles ¶
type Triangles struct { Name string Count int Material string Input []InputShared P []int }
Triangles
type Trifans ¶
type Trifans struct { Name string Count int Material string Input []InputShared P []int }
Trifans
type Tristrips ¶
type Tristrips struct { Name string Count int Material string Input []InputShared P []int }
Tristrips