json

package
v0.12.0 Latest Latest
Warning

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

Go to latest
Published: Sep 10, 2023 License: MIT Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type CollisionMesh

type CollisionMesh struct {
	Triangles []Triangle `json:"triangles"`
}

type Entity

type Entity struct {
	Name   string      `json:"name"`
	Model  string      `json:"model"`
	Matrix [16]float32 `json:"matrix"`
}

type Level

type Level struct {
	SkyboxTexture            string          `json:"skybox_texture"`
	AmbientReflectionTexture string          `json:"ambient_reflection_texture"`
	AmbientRefractionTexture string          `json:"ambient_refraction_texture"`
	IrradianceTexture        string          `json:"irradiance_texture"`
	StartCollisionMesh       CollisionMesh   `json:"start_collision_mesh"`
	Waypoints                []Position      `json:"waypoints"`
	StaticMeshes             []Mesh          `json:"static_meshes"`
	CollisionMeshes          []CollisionMesh `json:"collision_meshes"`
	StaticEntities           []Entity        `json:"static_entities"`
}

type LevelDecoder

type LevelDecoder struct{}

func NewLevelDecoder

func NewLevelDecoder() *LevelDecoder

func (*LevelDecoder) Decode

func (d *LevelDecoder) Decode(in io.Reader) (*Level, error)

type LevelEncoder

type LevelEncoder struct{}

func NewLevelEncoder

func NewLevelEncoder() *LevelEncoder

func (*LevelEncoder) Encode

func (e *LevelEncoder) Encode(out io.Writer, level *Level) error

type Mesh

type Mesh struct {
	Coords    []float32 `json:"coords"`
	Normals   []float32 `json:"normals"`
	TexCoords []float32 `json:"tex_coords"`
	Indices   []int     `json:"indices"`
	SubMeshes []SubMesh `json:"sub_meshes"`
}

type Position

type Position [3]float32

type SubMesh

type SubMesh struct {
	Name           string `json:"name"`
	IndexOffset    int    `json:"index_offset"`
	IndexCount     int    `json:"index_count"`
	DiffuseTexture string `json:"diffuse_texture"`
}

type Triangle

type Triangle [3]Position

Jump to

Keyboard shortcuts

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