items

package
v0.0.0-...-e182f7f Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Sep 14, 2022 License: GPL-3.0 Imports: 8 Imported by: 0

Documentation

Index

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 NewGameItem

func NewGameItem(mesh *Mesh) *GameItem

NewGameItem Creates a new game item

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

func (gi *GameItem) SetPosition(x, y, z float32)

SetPosition Sets the position of the game item

func (*GameItem) SetRotation

func (gi *GameItem) SetRotation(x, y, z float32)

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

func (mtl *Material) IsTextured() bool

IsTextured Returns weather the material has a texture or uses colors

func (*Material) SetAmbientColor

func (mtl *Material) SetAmbientColor(ambientColor mgl64.Vec4)

SetAmbientColor Sets the materials ambient color

func (*Material) SetDiffuseColor

func (mtl *Material) SetDiffuseColor(diffuseColor mgl64.Vec4)

SetDiffuseColor Sets the materials diffuse texture

func (*Material) SetReflectance

func (mtl *Material) SetReflectance(reflectance float64)

SetReflectance Sets the reflectance of the material

func (*Material) SetSpecularColor

func (mtl *Material) SetSpecularColor(specularColor mgl64.Vec4)

SetSpecularColor Sets the color of specular highlights with this material

func (*Material) SetTexture

func (mtl *Material) SetTexture(texture *Texture)

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) GetName

func (msh *Mesh) GetName() string

GetName Returns the name of the items

func (*Mesh) Render

func (msh *Mesh) Render()

Render Draws the items to the screen

func (*Mesh) SetMaterial

func (msh *Mesh) SetMaterial(mat *Material)

SetMaterial Set a custom material for this items

type Texture

type Texture struct {
	// contains filtered or unexported fields
}

func NewTexture

func NewTexture(imagePath string) (*Texture, error)

NewTexture Creates a new texture from an image

func (*Texture) Bind

func (tx *Texture) Bind()

Bind Tells opengl to use this texture as the TEXTURE_2D

func (*Texture) Destroy

func (tx *Texture) Destroy()

Destroy Deletes the texture

func (*Texture) Unbind

func (tx *Texture) Unbind()

Unbind Tells opengl to stop using this texture as the TEXTURE_2D

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL