model

package
v0.5.0 Latest Latest
Warning

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

Go to latest
Published: Apr 3, 2019 License: Unlicense Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Bsp

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

Bsp is a specialised model that represents an entire bsp map It is represented by a single mesh and a series of visiblity structures that dictate what can and can't be seen from a given point

func NewBsp

func NewBsp(refMesh *mesh.Mesh) *Bsp

NewBsp returns a new bsp

func (*Bsp) ClusterLeafs

func (bsp *Bsp) ClusterLeafs() []ClusterLeaf

ClusterLeafs returns all ClusterLeafs

func (*Bsp) DefaultCluster

func (bsp *Bsp) DefaultCluster() *ClusterLeaf

DefaultCluster

func (*Bsp) Mesh

func (bsp *Bsp) Mesh() mesh.IMesh

Mesh returns Bsp Mesh

func (*Bsp) SetClusterLeafs

func (bsp *Bsp) SetClusterLeafs(clusterLeafs []ClusterLeaf)

SetClusterLeafs set the computed cluster leafs for a Bsp

func (*Bsp) SetDefaultCluster

func (bsp *Bsp) SetDefaultCluster(dispFaces ClusterLeaf)

SetDefaultCluster

func (*Bsp) SetVisibleClusters

func (bsp *Bsp) SetVisibleClusters(clusterLeafs []*ClusterLeaf)

SetVisibleClusters update the visible ClusterLeafs

func (*Bsp) VisibleClusterLeafs

func (bsp *Bsp) VisibleClusterLeafs() []*ClusterLeaf

VisibleClusterLeafs returns clusterleafs that are known to be visible. This is not calculated here, only stored for faster reference

type ClusterLeaf

type ClusterLeaf struct {
	Id          int16
	Faces       []mesh.Face
	StaticProps []*StaticProp
	DispFaces   []int
	Mins, Maxs  mgl32.Vec3
	Origin      mgl32.Vec3
}

ClusterLeaf represents a single cluster that contains the contents of all the leafs that are contained within it

type IModel

type IModel interface {
	// FilePath
	FilePath() string
}

IModel

type Model

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

Model A collection of renderable primitives/submeshes

func NewModel

func NewModel(filename string, meshes ...mesh.IMesh) *Model

NewModel returns a new Model

func (*Model) AddMesh

func (model *Model) AddMesh(meshes ...mesh.IMesh)

AddMesh Add a new primitive

func (*Model) FilePath added in v0.5.0

func (model *Model) FilePath() string

FilePath returns where is model was found on disk

func (*Model) Meshes added in v0.5.0

func (model *Model) Meshes() []mesh.IMesh

Meshes Get all primitives/submeshes

func (*Model) Reset

func (model *Model) Reset()

Reset removes all meshes from this model

type StaticProp

type StaticProp struct {
	entity.Base
	// contains filtered or unexported fields
}

StaticProp is a somewhat specialised model that implements a few core entity features (largely because it is basically a renderable entity that cannot do anything or be reference)

func NewStaticProp

func NewStaticProp(lumpProp game.IStaticPropDataLump, propLeafs *game.StaticPropLeafLump, renderable *Model) *StaticProp

NewStaticProp returns new StaticProp

func (*StaticProp) FadeMaxDistance added in v0.5.0

func (prop *StaticProp) FadeMaxDistance() float32

func (*StaticProp) FadeMinDistance added in v0.5.0

func (prop *StaticProp) FadeMinDistance() float32

func (*StaticProp) LeafList

func (prop *StaticProp) LeafList() []uint16

LeafList returrns all leafs that this props is in

func (*StaticProp) Model added in v0.5.0

func (prop *StaticProp) Model() *Model

Model returns props model

Jump to

Keyboard shortcuts

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