itype

package
v0.0.0-...-e8e0880 Latest Latest
Warning

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

Go to latest
Published: Jul 20, 2022 License: MIT Imports: 2 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var DirectionVecd = [6]Vec3d{
	XPlus:  {1, 0, 0},
	XMinus: {-1, 0, 0},
	YPlus:  {0, 1, 0},
	YMinus: {0, -1, 0},
	ZPlus:  {0, 0, 1},
	ZMinus: {0, 0, -1},
}
View Source
var DirectionVecf = [6]Vec3f{
	XPlus:  {1, 0, 0},
	XMinus: {-1, 0, 0},
	YPlus:  {0, 1, 0},
	YMinus: {0, -1, 0},
	ZPlus:  {0, 0, 1},
	ZMinus: {0, 0, -1},
}
View Source
var DirectionVeci = [6]Vec3i{
	XPlus:  {1, 0, 0},
	XMinus: {-1, 0, 0},
	YPlus:  {0, 1, 0},
	YMinus: {0, -1, 0},
	ZPlus:  {0, 0, 1},
	ZMinus: {0, 0, -1},
}

Functions

This section is empty.

Types

type Angle

type Angle float32

Angle wraps a angle in the form of radian float32.

Its value lies strictly in [0, 2Pi).

func Degrees

func Degrees(deg float32) Angle

Degrees construct an Angle from a degree value.

func Radians

func Radians(rad float32) Angle

Radians construct an Angle from a radian value.

func (Angle) Degrees

func (a Angle) Degrees() float32

Degrees return the value of the Angle in degrees.

func (Angle) Radians

func (a Angle) Radians() float32

Radians return the value of the Angle in radians.

type Boxd

type Boxd struct {
	OffX, OffY, OffZ    float64
	SizeX, SizeY, SizeZ float64
}

Boxd is a 3D box with float64 coordinates.

func (Boxd) Contains

func (b Boxd) Contains(point Vec3d) bool

func (Boxd) Intersect

func (box1 Boxd) Intersect(box2 Boxd) (ok bool, intersect Boxd)

func (Boxd) MaxPoint

func (b Boxd) MaxPoint() Vec3d

func (Boxd) MinPoint

func (b Boxd) MinPoint() Vec3d

func (Boxd) Offset

func (b Boxd) Offset(offset Vec3d) Boxd

func (Boxd) Offsetv

func (b Boxd) Offsetv(x, y, z float64) Boxd

func (Boxd) ToFloat32

func (b Boxd) ToFloat32() Boxf

type Boxf

type Boxf struct {
	OffX, OffY, OffZ    float32
	SizeX, SizeY, SizeZ float32
}

Boxf is a 3D box with float32 coordinates.

func (Boxf) MaxPoint

func (b Boxf) MaxPoint() Vec3f

func (Boxf) MinPoint

func (b Boxf) MinPoint() Vec3f

func (Boxf) Offset

func (b Boxf) Offset(offset Vec3f) Boxf

type Boxi

type Boxi struct {
	OffX, OffY, OffZ    int
	SizeX, SizeY, SizeZ int
}

Boxi is a 3D box with int coordinates.

type Dataset

type Dataset map[string]interface{}

Dataset describes arbitrary data stored in String-Interface{} pairs. This is the major way how complicated data is stored in blocks and entities.

The empty interface should only hold these 4 types:

  • int
  • float64
  • bool
  • string

type Direction

type Direction int
const (
	XPlus  Direction = iota // X+
	XMinus                  // X-
	YPlus                   // Y+
	YMinus                  // Y-
	ZPlus                   // Z+
	ZMinus                  // Z-
)

type Rectd

type Rectd struct {
	Left, Top     float64
	Width, Height float64
}

Rectd is a 2D rectangle with float64 coordinates.

func (Rectd) MaxPoint

func (r Rectd) MaxPoint() Vec2d

func (Rectd) MinPoint

func (r Rectd) MinPoint() Vec2d

func (Rectd) Size

func (r Rectd) Size() Vec2d

type Rectf

type Rectf struct {
	Left, Top     float32
	Width, Height float32
}

Rectf is a 2D rectangle with float32 coordinates.

func (Rectf) MaxPoint

func (r Rectf) MaxPoint() Vec2f

func (Rectf) MinPoint

func (r Rectf) MinPoint() Vec2f

func (Rectf) Size

func (r Rectf) Size() Vec2f

type Recti

type Recti struct {
	Left, Top     int
	Width, Height int
}

Recti is a 2D rectangle with int coordinates.

type Vec2d

type Vec2d [2]float64

Vec2d is a two-element float64 vector

func (Vec2d) Add

func (v Vec2d) Add(add Vec2d) Vec2d

func (Vec2d) Addv

func (v Vec2d) Addv(x, y float64) Vec2d

func (Vec2d) Floor

func (v Vec2d) Floor() Vec2i

func (Vec2d) Length

func (v Vec2d) Length() float64

func (Vec2d) Multiply

func (v Vec2d) Multiply(x float64) Vec2d

func (Vec2d) Normalize

func (v Vec2d) Normalize() Vec2d

func (Vec2d) ToFloat32

func (v Vec2d) ToFloat32() Vec2f

type Vec2f

type Vec2f [2]float32

Vec2f is a two-element float vector

func (Vec2f) Add

func (v Vec2f) Add(add Vec2f) Vec2f

func (Vec2f) Addv

func (v Vec2f) Addv(x, y float32) Vec2f

func (Vec2f) Floor

func (v Vec2f) Floor() Vec2i

func (Vec2f) Length

func (v Vec2f) Length() float32

func (Vec2f) Multiply

func (v Vec2f) Multiply(x float32) Vec2f

func (Vec2f) Normalize

func (v Vec2f) Normalize() Vec2f

func (Vec2f) ToFloat64

func (v Vec2f) ToFloat64() Vec2d

type Vec2i

type Vec2i [2]int

Vec2i is a two-element int vector

func (Vec2i) Add

func (v Vec2i) Add(add Vec2i) Vec2i

func (Vec2i) MultiplyInt

func (v Vec2i) MultiplyInt(mult int) Vec2i

func (Vec2i) ToFloat32

func (v Vec2i) ToFloat32() Vec2f

type Vec3d

type Vec3d [3]float64

Vec3d is a three-element float64 vector

func (Vec3d) Add

func (v Vec3d) Add(add Vec3d) Vec3d

func (Vec3d) Addf

func (v Vec3d) Addf(add Vec3f) Vec3d

func (Vec3d) Addv

func (v Vec3d) Addv(x, y, z float64) Vec3d

func (Vec3d) Ceiling

func (v Vec3d) Ceiling() Vec3i

func (Vec3d) Cross

func (v1 Vec3d) Cross(v2 Vec3d) Vec3d

func (Vec3d) Dot

func (v1 Vec3d) Dot(v2 Vec3d) float64

func (Vec3d) Floor

func (v Vec3d) Floor() Vec3i

func (Vec3d) Length

func (v Vec3d) Length() float64

func (Vec3d) Multiply

func (v Vec3d) Multiply(mult float64) Vec3d

func (Vec3d) Negative

func (v Vec3d) Negative() Vec3d

func (Vec3d) Normalize

func (v Vec3d) Normalize() Vec3d

func (Vec3d) ToFloat32

func (v Vec3d) ToFloat32() Vec3f

type Vec3f

type Vec3f [3]float32

Vec3f is a three-element float vector

func (Vec3f) Add

func (v Vec3f) Add(add Vec3f) Vec3f

func (Vec3f) Addv

func (v Vec3f) Addv(x, y, z float32) Vec3f

func (Vec3f) Floor

func (v Vec3f) Floor() Vec3i

func (Vec3f) Length

func (v Vec3f) Length() float32

func (Vec3f) Multiply

func (v Vec3f) Multiply(mult float32) Vec3f

func (Vec3f) Negative

func (v Vec3f) Negative() Vec3f

func (Vec3f) Normalize

func (v Vec3f) Normalize() Vec3f

func (Vec3f) ToFloat64

func (v Vec3f) ToFloat64() Vec3d

type Vec3i

type Vec3i [3]int

Vec3i is a three-element int vector

func (Vec3i) Add

func (v Vec3i) Add(add Vec3i) Vec3i

func (Vec3i) Addv

func (v Vec3i) Addv(x, y, z int) Vec3i

func (Vec3i) Multiply

func (v Vec3i) Multiply(mult Vec3i) Vec3i

func (Vec3i) MultiplyInt

func (v Vec3i) MultiplyInt(mult int) Vec3i

func (Vec3i) Multiplyv

func (v Vec3i) Multiplyv(x, y, z int) Vec3i

func (Vec3i) ToFloat32

func (v Vec3i) ToFloat32() Vec3f

func (Vec3i) ToFloat64

func (v Vec3i) ToFloat64() Vec3d

type Vec4d

type Vec4d [4]float64

Vec4d is a four-element float64 vector

type Vec4f

type Vec4f [4]float32

Vec4f is a four-element float vector

func Vec4iToFloat32

func Vec4iToFloat32(v Vec4i) Vec4f

type Vec4i

type Vec4i [4]int

Vec4i is a four-element int vector

func (Vec4i) Add

func (v Vec4i) Add(add Vec4i) Vec4i

func (Vec4i) MultiplyInt

func (v Vec4i) MultiplyInt(mult int) Vec4i

Jump to

Keyboard shortcuts

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