obj7

package
v0.0.0-...-9c16395 Latest Latest
Warning

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

Go to latest
Published: Sep 28, 2015 License: MIT Imports: 13 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	NavLightRedColor   = [4]float32{1.0, 0.0, 0.2, 0.5}
	NavLightGreenColor = [4]float32{0.0, 1.0, 0.3, 0.5}
	LandingLightColor  = [4]float32{1.0, 1.0, 0.7, 0.6}
	StrobeLightColor   = [4]float32{1.0, 1.0, 1.0, 0.7}
)
View Source
var ObjectManagerInstance = &ObjectManager{make(map[string]*ObjectInfo), sync.RWMutex{}}

Functions

This section is empty.

Types

type CommandId

type CommandId int
const (
	CommandId_ObjEnd CommandId = iota
	CommandId_ObjLight
	CommandId_ObjLine
	CommandId_ObjTri
	CommandId_ObjQuad
	CommandId_ObjQuadHard
	CommandId_ObjQuadCockpit
	CommandId_ObjSmokeBlack
	CommandId_ObjSmokeWhite
	CommandId_ObjMovie
	CommandId_ObjPolygon
	CommandId_ObjQuadStrip
	CommandId_ObjTriStrip
	CommandId_ObjTriFan
	CommandId_AttrShadeFlat
	CommandId_AttrShadeSmooth
	CommandId_AttrAmbientRGB
	CommandId_AttrDiffuseRGB
	CommandId_AttrEmissionRGB
	CommandId_AttrSpecularRGB
	CommandId_AttrShinyRat
	CommandId_AttrNoDepth
	CommandId_AttrDepth
	CommandId_AttrLOD
	CommandId_AttrReset
	CommandId_AttrCull
	CommandId_AttrNoCull
	CommandId_AttrOffset
	CommandId_AttrMax
)

type CommandType

type CommandType int
const (
	CommandType_None CommandType = iota
	CommandType_PtLine
	CommandType_Poly
	CommandType_Attr
)

type LightInfo

type LightInfo struct {
	XYZ       [3]float32
	RGB       [3]int
	LightType LightType
	RGB_Float [4]float32
}

func NewLightInfo

func NewLightInfo(vrgb VecRGB) *LightInfo

type LightType

type LightType int
const (
	LightType_Other           LightType = 0
	LightType_RedNavigation   LightType = 1
	LightType_GreenNavigation LightType = 2
	LightType_Beacon          LightType = 3
	LightType_Strobe          LightType = 4
	LightType_Landing         LightType = 5
	LightType_Taxi            LightType = 6
)

type LodObjectInfo

type LodObjectInfo struct {
	NearDist     float32 // The visible range
	FarDist      float32 // of this LOD
	TriangleList []int32
	Lights       []*LightInfo
	PointPool    *ObjectPointPool
	Dl           uint32
}

func NewLodObjectInfo

func NewLodObjectInfo(nearDist, farDist float32) *LodObjectInfo

type ObjectCommand

type ObjectCommand struct {
	CmdId      CommandId
	CmdType    CommandType
	Attributes []float32
	St         []VecTex
	RGB        []VecRGB
}

func FindObjectCommand

func FindObjectCommand(token string) (*ObjectCommand, int)

func NewObjectCommand

func NewObjectCommand(cmdId CommandId, cmdType CommandType) *ObjectCommand

type ObjectInfo

type ObjectInfo struct {
	Path           string
	DefaultTexture string
	Lods           []*LodObjectInfo
}

func NewObjectInfo

func NewObjectInfo(objFile string) (*ObjectInfo, error)

type ObjectManager

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

func (*ObjectManager) GetObject

func (self *ObjectManager) GetObject(path string) (objInfo *ObjectInfo, err error)

type ObjectParser

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

func NewObjectParser

func NewObjectParser(objFilePath string) (*ObjectParser, error)

func (*ObjectParser) CurrentLine

func (self *ObjectParser) CurrentLine() int

func (*ObjectParser) Err

func (self *ObjectParser) Err() error

func (*ObjectParser) GetCommands

func (self *ObjectParser) GetCommands() []*ObjectCommand

func (*ObjectParser) GetTexture

func (self *ObjectParser) GetTexture() string

func (*ObjectParser) Parse

func (self *ObjectParser) Parse()

type ObjectPointPool

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

func NewObjectPointPool

func NewObjectPointPool() *ObjectPointPool

func (*ObjectPointPool) AddPoint

func (self *ObjectPointPool) AddPoint(xyz [3]float32, st [2]float32) int32

func (*ObjectPointPool) CalcTriNormal

func (self *ObjectPointPool) CalcTriNormal(idx1, idx2, idx3 int32)

func (*ObjectPointPool) NormalizeNormals

func (self *ObjectPointPool) NormalizeNormals()

func (*ObjectPointPool) PreparePoolToDraw

func (self *ObjectPointPool) PreparePoolToDraw()

func (*ObjectPointPool) Purge

func (self *ObjectPointPool) Purge()

func (*ObjectPointPool) Size

func (self *ObjectPointPool) Size() int

type VecRGB

type VecRGB struct {
	V   [3]float32
	RGB [3]float32
}

type VecTex

type VecTex struct {
	V  [3]float32
	St [2]float32
}

Jump to

Keyboard shortcuts

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