track

package
v0.0.0-...-e36b79b Latest Latest
Warning

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

Go to latest
Published: Jan 14, 2024 License: MIT Imports: 5 Imported by: 0

Documentation

Overview

Package track defines Hover track data structure and provides loading functionality.

Index

Constants

View Source
const (
	// TerrHeightScale is the scale factor for terrain height.
	TerrHeightScale = 1.0 / 32
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Header struct {
	SunlightDirection, SunlightPitch float32
	RacerStartPositions              [8][3]float32
	NumTerrTypes                     uint16
	NumTerrTypeNodes                 uint16
	NumNavCoords                     uint16
	NumNavCoordLookupNodes           uint16
	Width, Depth                     uint16
}

Header of a track file.

type NavCoord struct {
	X, Z             uint16
	DistToStartCoord uint16 // Decider at forks, and determines racers' rank/place.
	Next             uint16
	Alt              uint16
}

NavCoord is a navigation coordinate.

type NavCoordLookupNode struct {
	NavCoord   uint16
	NextStartX uint16
	Next       uint16
}

NavCoordLookupNode is a navigation coordinate lookup node.

type TerrCoord

type TerrCoord struct {
	Height         uint16
	LightIntensity uint8
}

TerrCoord is a terrain coordinate.

type TerrTypeNode

type TerrTypeNode struct {
	Type uint8

	NextStartX uint16
	Next       uint16
	// contains filtered or unexported fields
}

TerrTypeNode is a terrain type node.

type Track

type Track struct {
	Header

	NumTerrCoords  uint32
	TriGroupsWidth uint32
	TriGroupsDepth uint32
	NumTriGroups   uint32

	TerrTypeTextureFilenames []string

	TerrTypeRuns  []TerrTypeNode
	TerrTypeNodes []TerrTypeNode

	NavCoords           []NavCoord
	NavCoordLookupRuns  []NavCoordLookupNode
	NavCoordLookupNodes []NavCoordLookupNode

	TerrCoords []TerrCoord
	TriGroups  []TriGroup
}

Track is a Hover track.

func Load

func Load(r io.Reader) (Track, error)

Load loads track from r.

type TriGroup

type TriGroup struct {
	Data [triGroupNumDwords]uint32
}

TriGroup is a triangle group.

Jump to

Keyboard shortcuts

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