gacc

package module
v0.0.0-...-5852c71 Latest Latest
Warning

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

Go to latest
Published: Apr 8, 2016 License: MIT Imports: 13 Imported by: 0

README

Asset Compiler Collection

A tool collection for processing game assets.
It is written in Go as an exercise.

Documentation

Index

Constants

View Source
const (
	MaxFloat32 = float64(^uint32(0))
	MaxInt32   = float64(^uint32(0)>>1 - 1)
	MaxInt16   = float64(^uint16(0)>>1 - 1)
	MaxUint16  = float64(^uint16(0) - 1)
	MaxInt8    = float64(^uint8(0)>>1 - 1)
	MaxUint8   = float64(^uint8(0) - 1)
)

used for attribute normalization

Variables

This section is empty.

Functions

func AxisAlignedBoudingBox

func AxisAlignedBoudingBox(vertices []vertex) (center, extent vector.Vector3)

func CStruct

func CStruct() string

func MeshToTriangleMesh

func MeshToTriangleMesh(m *Mesh) *triangleMesh

TODO: return surfaces?

func ReadBinaryMeshHeader

func ReadBinaryMeshHeader(filename string) (BinaryMeshHeader, []BinaryVertexAttrib)

func VectorToBytes

func VectorToBytes(v vector.Vector3, format VertexAttribDesc) []byte

func VectorToInt16

func VectorToInt16(v vector.Vector3, normalized bool) [3]int16

Types

type BinaryMeshHeader

type BinaryMeshHeader struct {
	Name                                    [16]byte
	VertAttribCount, VertAttribOffset       uint32
	SurfDescCount, SurfDescOffset           uint32
	VertCount, VertDataOffset, VertDataSize uint32
	IndCount, IndDataOffset, IndDataSize    uint32
	AabbCenter, AabbExtent                  [3]float32
}

type BinarySurfaceDesc

type BinarySurfaceDesc struct {
	StartIndex, Count uint32
}

type BinaryVertexAttrib

type BinaryVertexAttrib struct {
	Index, Count, Type, Normalized uint32
	Stride, Offset                 uint32
}

struct describing what composes a vertex

type FaceVert

type FaceVert struct {
	PositionIndex, TexcoIndex, NormalIndex int
}

type Mesh

type Mesh struct {
	Name                       string
	SurfaceCount               uint
	Positions, Texcos, Normals []vector.Vector3
	Polygons                   []Polygon
}

A generic mesh structure

func ParseObj

func ParseObj(filename string) Mesh

func (*Mesh) Encode

func (m *Mesh) Encode(filename string)

TODO: rename to Encode() []byte ?

type Polygon

type Polygon struct {
	FaceVerts []FaceVert
	Material  uint
}

type Scene

type Scene struct {
	Name string
}

func ParseJafScene

func ParseJafScene(filename string) Scene

type VertexAttribDesc

type VertexAttribDesc struct {
	Name       VertexAttribName
	Count      uint
	Type       VertexAttribType
	Normalized bool
}

type VertexAttribName

type VertexAttribName uint32
const (
	Position VertexAttribName = iota
	Normal
	Color
	Texco0
	Texco1
	TangentDet
)

type VertexAttribType

type VertexAttribType uint32
const (
	Float32 VertexAttribType = iota
	Int32
	Int16
	Uint16
	Int8
	Uint8
)

func (VertexAttribType) ByteSize

func (t VertexAttribType) ByteSize() (size uint)

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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