std

package
v0.0.0-...-0cd4edb Latest Latest
Warning

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

Go to latest
Published: Sep 10, 2018 License: GPL-3.0 Imports: 1 Imported by: 0

Documentation

Overview

Package std add circle, rect, mesh, transform, vector, and color components

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Animatable

type Animatable interface {
	Add(Animatable)
	Sub(Animatable)
	Div(float32)
	Set(float32)
	Mul(Animatable)
	Copy() Animatable
	Zero()
	One()
}

Animatable interface allows math to be applied to variables for animation

TODO(F): Rename this to something more generic because it could be applied to something other than animation TODO(F): Split other structs inside vector.go file to their respective files

type Circle

type Circle struct {
	R float32
}

Circle defines a circle radius

type Color

type Color struct {
	R float32
	G float32
	B float32
	A float32
}

Color defines the RGBA values

func (*Color) Add

func (c *Color) Add(a Animatable)

Add adds two color values

func (*Color) Copy

func (c *Color) Copy() Animatable

Copy clones a color

func (*Color) Div

func (c *Color) Div(d float32)

Div divides a color's values

func (*Color) Mul

func (c *Color) Mul(d Animatable)

Mul multiplies two color values

func (*Color) One

func (c *Color) One()

One sets all color values to zero

func (*Color) Set

func (c *Color) Set(n float32)

Set used to define all the require properties of a Clip

func (*Color) Sub

func (c *Color) Sub(s Animatable)

Sub subtracts two color values

func (*Color) Zero

func (c *Color) Zero()

Zero sets all color values to zero

type Integer

type Integer struct {
	V int
}

Integer defines an integer

func (*Integer) Add

func (v *Integer) Add(a Animatable)

Add adds two integer values

func (*Integer) Copy

func (v *Integer) Copy() Animatable

Copy clones an integer

func (*Integer) Div

func (v *Integer) Div(d float32)

Div divides a integer's value

func (*Integer) Mul

func (v *Integer) Mul(d Animatable)

Mul multiplies two integer values

func (*Integer) One

func (v *Integer) One()

One sets integer value to zero

func (*Integer) Set

func (v *Integer) Set(n float32)

Set used to define all the require properties of a Integer

func (*Integer) Sub

func (v *Integer) Sub(s Animatable)

Sub subtracts two integer values

func (*Integer) Zero

func (v *Integer) Zero()

Zero sets integer value to zero

type Rect

type Rect struct {
	*Vector2
	W float32
	H float32
}

Rect defines a rectangle with a vector2 position and dimensions

type Transform

type Transform struct {
	engine.Component
	// contains filtered or unexported fields
}

Transform defines the position, orientiation, and scale

func GetTransform

func GetTransform(e *engine.Entity) *Transform

GetTransform searching and returns an entity's Transform component

func NewTransform

func NewTransform() *Transform

NewTransform creates and sets a new orphan transform

func (*Transform) Position

func (t *Transform) Position() *Vector3

Position returns position vector

func (*Transform) Position2D

func (t *Transform) Position2D() *Vector2

Position2D returns two-dimensional position vector

func (*Transform) Rotation

func (t *Transform) Rotation() *Vector3

Rotation return rotation/orientation vector

func (*Transform) Scale

func (t *Transform) Scale() *Vector3

Scale returns scale vector

func (*Transform) Set

func (t *Transform) Set(pos *Vector3, rot *Vector3, scl *Vector3)

Set used to define all the require properties of a Clip

func (*Transform) SetPosition

func (t *Transform) SetPosition(x float32, y float32, z float32)

SetPosition sets/changes position

func (*Transform) SetRotation

func (t *Transform) SetRotation(x float32, y float32, z float32)

SetRotation sets/changes rotation/orientation

func (*Transform) SetScale

func (t *Transform) SetScale(scale *Vector3)

SetScale sets/changes scale

type VEB

type VEB struct {
	VB []float32
	EB []uint8
}

VEB combines vertex and element array buffers

var CircleMesh *VEB

CircleMesh simple predefined circle mesh

TODO(F): Implement a circle mesh

var QuadMesh *VEB

QuadMesh simple predefined quad mesh

type Vector2

type Vector2 struct {
	X float32
	Y float32
}

Vector2 defines two vector values (x, y)

func (*Vector2) Add

func (v *Vector2) Add(a Animatable)

Add adds two vector2 values

func (*Vector2) Copy

func (v *Vector2) Copy() Animatable

Copy clones a vector2

func (*Vector2) Div

func (v *Vector2) Div(d float32)

Div divides a vector2's values

func (*Vector2) Mul

func (v *Vector2) Mul(d Animatable)

Mul multiplies two vector2 values

func (*Vector2) One

func (v *Vector2) One()

One sets vector2 values to zero

func (*Vector2) Set

func (v *Vector2) Set(n float32)

Set used to define all the require properties of a Vector2

func (*Vector2) Sub

func (v *Vector2) Sub(s Animatable)

Sub subtracts two vector2 values

func (*Vector2) Zero

func (v *Vector2) Zero()

Zero sets vector2 values to zero

type Vector3

type Vector3 struct {
	X float32
	Y float32
	Z float32
}

Vector3 defines three vector values (x, y, z)

func (*Vector3) Add

func (v *Vector3) Add(a Animatable)

Add adds two vector3 values

func (*Vector3) Copy

func (v *Vector3) Copy() Animatable

Copy clones a vector3

func (*Vector3) Div

func (v *Vector3) Div(d float32)

Div divides a vector3's values

func (*Vector3) Mul

func (v *Vector3) Mul(d Animatable)

Mul multiplies two vector3 values

func (*Vector3) One

func (v *Vector3) One()

One sets vector3 values to zero

func (*Vector3) Set

func (v *Vector3) Set(n float32)

Set used to define all the require properties of a Vector3

func (*Vector3) Sub

func (v *Vector3) Sub(s Animatable)

Sub subtracts two vector3 values

func (*Vector3) Zero

func (v *Vector3) Zero()

Zero sets vector3 values to zero

Jump to

Keyboard shortcuts

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