mdl

package
v0.0.0-...-0713623 Latest Latest
Warning

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

Go to latest
Published: Feb 4, 2023 License: GPL-2.0 Imports: 7 Imported by: 0

Documentation

Overview

Package mdl loads Quake MDL files.

Index

Constants

This section is empty.

Variables

View Source
var (
	QuakePalette = []color.Color{}/* 256 elements not displayed */

)
View Source
var (
	Verbose = false
)

Functions

This section is empty.

Types

type Model

type Model struct {
	Header        RawHeader
	Skins         []image.Image
	Triangles     []Triangle
	TextureCoords []TexCoords
	Frames        []SimpleFrame
}

func Load

func Load(r myReader) (*Model, error)

func (*Model) POVFrameID

func (m *Model) POVFrameID(id int, skin string) string

type ModelVertex

type ModelVertex struct {
	Vertex      Vertex
	NormalIndex int
}

func (*ModelVertex) String

func (v *ModelVertex) String() string

type RawHeader

type RawHeader struct {
	Ident uint32 // magic number: "IDPO"

	Version uint32 /* version: 6 */

	Scale          Vertex /* scale factor */
	Translate      Vertex /* translation vector */
	BoundinGradius float32
	EyePosition    Vertex /* eyes' position */

	NumSkins   uint32 /* number of textures */
	SkinWidth  uint32 /* texture width */
	SkinHeight uint32 /* texture height */

	NumVertices  uint32 /* number of vertices */
	NumTriangles uint32 /* number of triangles */
	NumFrames    uint32 /* number of frames */

	Synctype uint32 /* 0 = synchron, 1 = random */
	Flags    uint32 /* state flag */
	Size     float32
}

type SimpleFrame

type SimpleFrame struct {
	Name     string
	Vertices []ModelVertex
}

type Skin

type Skin struct {
	Group uint32
	Data  []uint8
}

type TexCoords

type TexCoords struct {
	Onseam uint32
	S, T   uint32
}

type Triangle

type Triangle struct {
	FacesFront  uint32
	VertexIndex [3]uint32
}

type Vertex

type Vertex struct {
	X, Y, Z float32
}

func (*Vertex) String

func (v *Vertex) String() string

Jump to

Keyboard shortcuts

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