util

package
v0.0.0-...-86c6665 Latest Latest
Warning

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

Go to latest
Published: Oct 18, 2024 License: AGPL-3.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetBool

func GetBool(r io.Reader) bool

GetBool returns the next boolean value in the data buffer.

func GetByte

func GetByte(r io.Reader) byte

GetByte is a convenience function that returns the next byte in the buffer.

func GetBytes

func GetBytes(r io.Reader) []byte

GetBytes returns the next byte slice in the data buffer.

func GetFloat

func GetFloat(r io.Reader) float64

GetFloat returns the next 64-bit floating-point value.

func GetString

func GetString(r io.Reader) string

GetString returns the next null-terminated string in the data buffer.

func GetTime

func GetTime(r io.Reader) time.Time

GetTime returns the next time.Time value in the data buffer.

func GetUint16

func GetUint16(r io.Reader) uint16

GetUint16 returns the next unsigned 16-bit integer in the data buffer.

func GetUint32

func GetUint32(r io.Reader) uint32

GetUint32 returns the next unsigned 32-bit integer in the data buffer.

func GetUint64

func GetUint64(r io.Reader) uint64

GetUint64 returns the next unsigned 64-bit integer in the data buffer.

func Pad

func Pad(w io.Writer, l int)

Pad writes zero-padding

func PutBool

func PutBool(w io.Writer, v bool)

PutBool writes a boolean value

func PutByte

func PutByte(w io.Writer, v byte)

PutByte writes a single byte

func PutBytes

func PutBytes(w io.Writer, d []byte)

PutBytes puts a slice of bytes to the writer.

func PutFloat

func PutFloat(w io.Writer, v float64)

PutFloat writes a 64-bit floating-point value.

func PutString

func PutString(w io.Writer, s string)

PutString writes a null-terminated string

func PutTime

func PutTime(w io.Writer, t time.Time)

PutTime writes a time.Time value to the writer.

func PutUint16

func PutUint16(w io.Writer, v uint16)

PutUint16 writes a 16-bit numeric value

func PutUint32

func PutUint32(w io.Writer, v uint32)

PutUint32 writes a 32-bit numeric value

func PutUint64

func PutUint64(w io.Writer, v uint64)

PutUint64 writes a 64-bit numeric value

Types

type Vox

type Vox struct {
	Width, Height, Depth int
	Voxels               [][4]uint8
}

Vox represents the contents of a .vox file in a generic format. The internal voxels are laid out with Z being the up axis and with the Y axis facing forward.

func NewVoxFromReader

func NewVoxFromReader(r io.Reader) (*Vox, error)

NewVoxFromReader returns a new Vox structure with the contents loaded from a MagicaVoxel .vox file.

func (*Vox) Dimensions

func (v *Vox) Dimensions() (w, h, d int)

Dimensions implements the c3d.VoxelSource interface.

func (*Vox) Get

func (v *Vox) Get(x, y, z int) [4]uint8

Get implements the c3d.VoxelSource interface.

func (*Vox) IsEmpty

func (v *Vox) IsEmpty(c [4]uint8) bool

IsEmpty implements the c3d.VoxelSource interface.

Jump to

Keyboard shortcuts

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