assets

package
v0.0.0-...-e229e0e Latest Latest
Warning

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

Go to latest
Published: Jan 17, 2022 License: GPL-2.0 Imports: 18 Imported by: 6

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func DecodeImage

func DecodeImage(data io.Reader) (image.Image, error)

func FindNodeByClass

func FindNodeByClass(class string, model *editorModels.NodeModel) []*editorModels.NodeModel

func FindNodeById

func FindNodeById(nodeId string, model *editorModels.NodeModel) *editorModels.NodeModel

func ImportImage

func ImportImage(file string) (image.Image, error)

func ImportImageCached

func ImportImageCached(path string) (image.Image, error)

func ImportObj

func ImportObj(filePath string) (geometry *renderer.Geometry, material *renderer.Material, err error)

imports an obj from a filePath and return a Geometry

func ImportObjCached

func ImportObjCached(path string) (geometry *renderer.Geometry, material *renderer.Material, err error)

func ImportShader

func ImportShader(vertexFile, fragmentFile string) (*renderer.Shader, error)

func IntersectGeometry

func IntersectGeometry(geometry *renderer.Geometry) [][2]mgl32.Vec2

IntersectGeometry - returns a list of line segments resulting from the xz plane intersection of the geometry

func LoadMap

func LoadMap(path string) *editorModels.MapModel

func LoadMapToNode

func LoadMapToNode(srcModel *editorModels.NodeModel, destNode *renderer.Node) *editorModels.NodeModel

func PointsFromGeometry

func PointsFromGeometry(geometry *renderer.Geometry, cullThreshold float32) *[]mgl32.Vec3

Converts a geometry directly into points (does threshold culling optimisation)

Types

type AssetCache

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

func NewAssetCache

func NewAssetCache() *AssetCache

func (*AssetCache) ImportImage

func (ac *AssetCache) ImportImage(path string) (img image.Image, err error)

func (*AssetCache) ImportObj

func (ac *AssetCache) ImportObj(path string) (geometry *renderer.Geometry, material *renderer.Material, err error)

type Loader

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

The loader allows asyncronous loading of obj and map files

func NewLoader

func NewLoader() *Loader

func (*Loader) LoadMap

func (loader *Loader) LoadMap(path string, callback func(node *renderer.Node, model *editorModels.NodeModel))

func (*Loader) LoadObj

func (loader *Loader) LoadObj(path string, callback func(geometry *renderer.Geometry, material *renderer.Material))

func (*Loader) Update

func (loader *Loader) Update(dt float64)

Jump to

Keyboard shortcuts

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