glm

package module
v0.0.0-...-689f391 Latest Latest
Warning

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

Go to latest
Published: Jan 10, 2014 License: MIT Imports: 3 Imported by: 0

README

glm-go

Simple linear algebra library similar in spirit to GLM.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Dot

func Dot(v1, v2 Vector3) float32

vector dot product

func Dot4

func Dot4(v1, v2 Vector4) float32

func Mix

func Mix(x, y, a float32) float32

linear interpolation

Types

type Matrix4

type Matrix4 [16]float32

func Matrix4Identity

func Matrix4Identity() Matrix4

Construct the identity 4x4 matrix

func MatrixMultiply

func MatrixMultiply(m1, m2 Matrix4) Matrix4

func MatrixPerspective

func MatrixPerspective(fov, aspect, near, far float32) Matrix4

Construct a perspective matrix

func MatrixScale

func MatrixScale(x, y, z float32) Matrix4

Construct a scaling matrix

func MatrixTranslate

func MatrixTranslate(x, y, z float32) Matrix4

Construct a translation matrix

func (Matrix4) Column

func (m Matrix4) Column(n int) Vector4

func (Matrix4) Determinant

func (m Matrix4) Determinant() float32

calculate the determinant

func (Matrix4) Row

func (m Matrix4) Row(n int) Vector4

func (Matrix4) String

func (m Matrix4) String() string

type MatrixStack

type MatrixStack struct {
	// contains filtered or unexported fields
}

func NewMatrixStack

func NewMatrixStack() *MatrixStack

func (*MatrixStack) Perspective

func (s *MatrixStack) Perspective(fov, aspect, near, far float32)

func (*MatrixStack) Pop

func (s *MatrixStack) Pop()

func (*MatrixStack) Push

func (s *MatrixStack) Push()

func (*MatrixStack) Scale

func (s *MatrixStack) Scale(x, y, z float32)

func (*MatrixStack) Top

func (s *MatrixStack) Top() Matrix4

func (*MatrixStack) Translate

func (s *MatrixStack) Translate(x, y, z float32)

type Vector3

type Vector3 [3]float32

func Cross

func Cross(v1, v2 Vector3) Vector3

vector cross product

func Normalize

func Normalize(v Vector3) Vector3

normalize vector

func ScalarProduct

func ScalarProduct(v Vector3, s float32) Vector3

vector scalar product

type Vector4

type Vector4 [4]float32

Jump to

Keyboard shortcuts

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