metadata

package
v2.4.0 Latest Latest
Warning

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

Go to latest
Published: Oct 14, 2020 License: MIT Imports: 1 Imported by: 0

Documentation

Overview

Package metadata provides metadata and utility functions, like translations from ingame coordinates to radar image pixels (see also /assets/maps directory).

Index

Constants

This section is empty.

Variables

View Source
var (
	MapDeCache    = makeMap("de_cache", -2000, 3250, 5.5)
	MapDeCanals   = makeMap("de_canals", -2496, 1792, 4)
	MapDeCbble    = makeMap("de_cbble", -3840, 3072, 6)
	MapDeDust2    = makeMap("de_dust2", -2476, 3239, 4.4)
	MapDeInferno  = makeMap("de_inferno", -2087, 3870, 4.9)
	MapDeMirage   = makeMap("de_mirage", -3230, 1713, 5)
	MapDeNuke     = makeMap("de_nuke", -3453, 2887, 7)
	MapDeOverpass = makeMap("de_overpass", -4831, 1781, 5.2)
	MapDeTrain    = makeMap("de_train", -2477, 2392, 4.7)
	MapDeVertigo  = makeMap("de_vertigo", -3168, 1762, 4)
)

Pre-defined map translations.

View Source
var MapNameToMap = map[string]Map{
	"de_cache":    MapDeCache,
	"de_canals":   MapDeCanals,
	"de_cbble":    MapDeCbble,
	"de_dust2":    MapDeDust2,
	"de_inferno":  MapDeInferno,
	"de_mirage":   MapDeMirage,
	"de_nuke":     MapDeNuke,
	"de_overpass": MapDeOverpass,
	"de_train":    MapDeTrain,
	"de_vertigo":  MapDeVertigo,
}

MapNameToMap translates a map name to a Map.

Functions

This section is empty.

Types

type Map

type Map struct {
	Name  string
	PZero r2.Point
	Scale float64
}

Map represents a CS:GO map. It contains information required to translate in-game world coordinates to coordinates relative to (0, 0) on the provided map-overviews (radar images).

func (Map) Translate

func (m Map) Translate(x, y float64) (float64, float64)

Translate translates in-game world-relative coordinates to (0, 0) relative coordinates.

func (Map) TranslateScale

func (m Map) TranslateScale(x, y float64) (float64, float64)

TranslateScale translates and scales in-game world-relative coordinates to (0, 0) relative coordinates. The outputs are pixel coordinates for the radar images found in the maps folder.

Jump to

Keyboard shortcuts

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