Documentation ¶
Index ¶
- type GameItem
- type Material
- func (mtl *Material) IsTextured() bool
- func (mtl *Material) SetAmbientColor(ambientColor mgl64.Vec4)
- func (mtl *Material) SetDiffuseColor(diffuseColor mgl64.Vec4)
- func (mtl *Material) SetReflectance(reflectance float64)
- func (mtl *Material) SetSpecularColor(specularColor mgl64.Vec4)
- func (mtl *Material) SetTexture(texture *Texture)
- type Mesh
- type Texture
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type GameItem ¶
type GameItem struct {
// contains filtered or unexported fields
}
func (*GameItem) Destroy ¶
func (gi *GameItem) Destroy()
Destroy Frees the memory used by this game item
func (*GameItem) Render ¶
func (gi *GameItem) Render(shaderProgram *shading.ShaderProgram)
Render Draws the game item to the display
func (*GameItem) SetPosition ¶
SetPosition Sets the position of the game item
func (*GameItem) SetRotation ¶
SetRotation Sets the rotation of this game item
type Material ¶
type Material struct {
// contains filtered or unexported fields
}
func NewMaterial ¶
func NewMaterial() *Material
NewMaterial Creates a new material with just a white color
func (*Material) IsTextured ¶
IsTextured Returns weather the material has a texture or uses colors
func (*Material) SetAmbientColor ¶
SetAmbientColor Sets the materials ambient color
func (*Material) SetDiffuseColor ¶
SetDiffuseColor Sets the materials diffuse texture
func (*Material) SetReflectance ¶
SetReflectance Sets the reflectance of the material
func (*Material) SetSpecularColor ¶
SetSpecularColor Sets the color of specular highlights with this material
func (*Material) SetTexture ¶
SetTexture Sets the materials texture
type Mesh ¶
type Mesh struct {
// contains filtered or unexported fields
}
func NewMesh ¶
func NewMesh(vertices []float32, textCoords []float32, normals []float32, indices []int32, name string) *Mesh
NewMesh Creates a new items with the given vertices, texture coordinates, normals, and indices
func (*Mesh) Destroy ¶
func (msh *Mesh) Destroy()
Destroy Deletes all the connected vertex buffers, and the vertex array.
func (*Mesh) SetMaterial ¶
SetMaterial Set a custom material for this items