direction

package
v0.0.0-...-03afc55 Latest Latest
Warning

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

Go to latest
Published: Nov 11, 2015 License: Apache-2.0 Imports: 2 Imported by: 8

Documentation

Index

Constants

This section is empty.

Variables

View Source
var Values = []Type{
	Up,
	Down,
	North,
	South,
	West,
	East,
}

Values is all valid directions.

Functions

This section is empty.

Types

type Type

type Type uint

Type is a direction in the minecraft world.

const (
	Up Type = iota
	Down
	North
	South
	West
	East
	Invalid
)

Possible direction values.

func FromString

func FromString(str string) Type

FromString returns the direction that matches the passed string if possible otherwise it will return Invalid.

func (Type) AsVec

func (d Type) AsVec() mgl32.Vec3

AsVec returns a vector of the direction's offset.

func (Type) Clockwise

func (d Type) Clockwise() Type

Clockwise returns the direction directly in a clockwise rotation to this direction.

func (Type) CounterClockwise

func (d Type) CounterClockwise() Type

CounterClockwise returns the direction directly in a counter clockwise rotation to this direction.

func (Type) Offset

func (d Type) Offset() (x, y, z int)

Offset returns the x, y and z offset this direction points in.

func (Type) Opposite

func (d Type) Opposite() Type

Opposite returns the direction directly opposite to this direction.

func (Type) String

func (d Type) String() string

String returns a string representation of the direction.

Jump to

Keyboard shortcuts

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