Esempio n. 1
0
	X, Y, Z                    float32
	TX, TY, TW, TH             uint16
	TOffsetX, TOffsetY, TAtlas int16
	Pad0                       int16
	R, G, B                    byte
	Pad1                       byte
	BlockLight, SkyLight       uint16
	Pad2, Pad3                 uint16
}

type buildPos struct {
	X, Y, Z int
}

var (
	_, chunkVertexType = builder.Struct(chunkVertex{})
	builderPool        = make(chan *builder.Buffer, maxBuilders+5)
)

func getBuilder() *builder.Buffer {
	select {
	case buf := <-builderPool:
		return buf
	default:
		return builder.New(chunkVertexType...)
	}
}

func putBuilder(b *builder.Buffer) {
	select {
	case builderPool <- b:
Esempio n. 2
0
File: model.go Progetto: num5/steven
	Texture            TextureInfo
	TextureX, TextureY float64
	R, G, B, A         byte
	id                 byte
}
type modelVertexInternal struct {
	X, Y, Z                    float32
	TX, TY, TW, TH             uint16
	TOffsetX, TOffsetY, TAtlas int16
	Pad0                       int16
	R, G, B, A                 byte
	ID                         byte
	Pad1, Pad2, Pad3           byte
}

var modelfunc, modelTypes = builder.Struct(&modelVertexInternal{})

type Model struct {
	// For culling only
	X, Y, Z float32
	Radius  float32
	// Per a part matrix
	Matrix               []mgl32.Mat4
	Colors               [][4]float32
	BlockLight, SkyLight float32
	array                gl.VertexArray
	buffer               gl.Buffer
	bufferSize           int
	count                int

	counts  []int32