entity

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Feb 12, 2019 License: Unlicense Imports: 8 Imported by: 11

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type EPair

type EPair struct {
	Next  *EPair
	Key   string
	Value string
}

EPair Linked List of entity key-value pairs

type Entity

type Entity struct {
	Origin     mgl32.Vec3
	FirstBrush int
	NumBrushes int
	EPairs     *EPair
}

"Abstract" Engine entity.

func FromVmfNode

func FromVmfNode(entityNode *vmf.Node) Entity

FromVmfNode parses a single Vmf node that represents an entity

func (*Entity) FloatForKey

func (ent *Entity) FloatForKey(key string) float32

FloatForKey returns float value for key. 0 returned if key not found

func (*Entity) FloatForKeyWithDefault

func (ent *Entity) FloatForKeyWithDefault(key string, defaultValue float32) float32

FloatForKeyWithDefault returns float value for key. Specified default value returned if key not found

func (*Entity) IntForKey

func (ent *Entity) IntForKey(key string) int

IntForKey returns int value for key. 0 returned if key not found

func (*Entity) LightForKey

func (ent *Entity) LightForKey(key string, useHDR bool, lightScale float32) (mgl32.Vec3, error)

LightForKey returns a Light-specific Vec3 for a key

func (*Entity) LightForString

func (ent *Entity) LightForString(light string, useHDR bool, lightScale float32) (mgl32.Vec3, error)

LightForString returns a light-specific Vec3 for a string representation of a light This takes into account configuration of parameters: HDR, lightScale

func (*Entity) ValueForKey

func (ent *Entity) ValueForKey(key string) string

ValueForKey gets string value for a key Returns empty string "" if not found

func (*Entity) ValueForKeyWithDefault

func (ent *Entity) ValueForKeyWithDefault(key string, defaultValue string) string

ValueForKeyWithDefault gets string value for key Returns a specified default if not found

func (*Entity) VectorForKey

func (ent *Entity) VectorForKey(key string) mgl32.Vec3

VectorForKey returns a vector for a specified key's value Default (0,0,0) returned

type List

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

List is an entity list

func FromVmfNodeTree

func FromVmfNodeTree(entityNodes vmf.Node) List

FromVmfNodeTree Build an entity list Constructs from the root node of Vmf entity data

func NewEntityList

func NewEntityList(entities []Entity) List

NewEntityList Create a new entity list from an existing slice of entities

func (*List) Add

func (list *List) Add(entity *Entity) int

Add adds a new entity to the list Returns the index of the newly added entity

func (*List) FindByKeyValue

func (list *List) FindByKeyValue(key string, value string) *Entity

FindByKeyValue finds an entity by a key/value pair Note: Returns the first found entity, so non-unique pairing may be problematic

func (*List) FindForModel

func (list *List) FindForModel(modelNumber int) *Entity

FindForModel finds an entity from a model id

func (*List) Get

func (list *List) Get(index int) *Entity

Get gets a stored entity Returns nil if not found

func (List) Length

func (list List) Length() int

Length gets number of entities

Jump to

Keyboard shortcuts

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