Documentation
¶
Index ¶
- func VertexAttributeDescriptions() []vk.VertexInputAttributeDescription
- func VertexBindingDescriptions() []vk.VertexInputBindingDescription
- type Collada
- type ColladaObject
- type Effect
- type EffectURL
- type Floats
- type Geometry
- type Input
- type Material
- type Mesh
- type Object
- type Source
- type Texture
- type Triangles
- type Uniform
- type Vertex
- type Vertices
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func VertexAttributeDescriptions ¶
func VertexAttributeDescriptions() []vk.VertexInputAttributeDescription
VertexAttributeDescriptions return Vulkan attribute descriptors
func VertexBindingDescriptions ¶
func VertexBindingDescriptions() []vk.VertexInputBindingDescription
VertexBindingDescriptions return Vulkan Vertex descriptors
Types ¶
type Collada ¶
type Collada struct { Geometries []Geometry `xml:"library_geometries>geometry"` Materials []Material `xml:"library_materials>material"` Effects []Effect `xml:"library_effects>effect"` }
Collada is the top-level Collada object
type ColladaObject ¶
type ColladaObject struct { Object // contains filtered or unexported fields }
ColladaObject is imported from a collada (.dae) file. Loaded and held in memory
func (*ColladaObject) Position ¶
func (co *ColladaObject) Position() glm.Mat4
Position implements interface
func (*ColladaObject) Rotation ¶
func (co *ColladaObject) Rotation() glm.Mat4
Rotation implements interface
func (*ColladaObject) SetPosition ¶
func (co *ColladaObject) SetPosition(pos glm.Mat4)
SetPosition implements interface
func (*ColladaObject) SetRotation ¶
func (co *ColladaObject) SetRotation(rot glm.Mat4)
SetRotation implements interface
func (*ColladaObject) Texture ¶
func (co *ColladaObject) Texture() image.Image
Texture implements interface
func (*ColladaObject) Vertices ¶
func (co *ColladaObject) Vertices() []Vertex
Vertices implements interface
type Effect ¶
type Effect struct { ID string `xml:"id,attr"` Emission [4]float32 // The following need custom Unmarshaller Diffuse [4]float32 Specular float32 }
Effect is Collada's effect, located in library_effects
type EffectURL ¶
type EffectURL struct {
URL string `xml:"url,attr"`
}
EffectURL contains the location url to the effect
type Floats ¶
Floats is the array of floats
func (*Floats) UnmarshalXML ¶
UnmarshalXML unmarshals the array of floats
type Geometry ¶
type Geometry struct { Mesh Mesh `xml:"mesh"` ID string `xml:"id,attr"` Name string `xml:"name,attr"` }
Geometry represents Collada's geometry
type Input ¶
type Input struct { Semantic string `xml:"semantic,attr"` Source string `xml:"source,attr"` Offset uint `xml:"offset,attr"` Set uint `xml:"set,attr"` }
Input is Collada'a input type
type Material ¶
type Material struct { ID string `xml:"id,attr"` Name string `xml:"name,attr"` Effects []EffectURL `xml:"instance_effect"` }
Material is Collada's material located in library_materials
type Mesh ¶
type Mesh struct { Source []Source `xml:"source"` Vertices Vertices `xml:"vertices"` Triangles Triangles `xml:"triangles"` }
Mesh contains all the primitive data
type Object ¶
type Object interface { // SetPosition sets the object's current position in space. // Has to be thread-safe SetPosition(glm.Mat4) // Position gets the object's current position in space. // Has to be thread-safe Position() glm.Mat4 // SetRotation sets the object's rotation matrix. // Has to be thread-safe SetRotation(glm.Mat4) // Rotation gets the object's rotation matrix. // Has to be thread-safe Rotation() glm.Mat4 // Vertices returns the vertices for Renderer use, // so it has to match the descriptors exactly Vertices() []Vertex // Texture returns the raw data of a color texture image // for use in the Renderer Texture() image.Image }
Object represents the engine supported model
type Source ¶
Source links to other sources where data is present
type Texture ¶
Texture is a container component for textures. Because textures can either be in an image form or raw form, this struct accomodates both
type Triangles ¶
type Triangles struct { Count int `xml:"count,attr"` Material string `xml:"material,attr"` Inputs []Input `xml:"input"` Index []int }
Triangles contain the list of triangles
func (*Triangles) UnmarshalXML ¶
UnmarshalXML parses the index list