glm

package
v0.0.0-...-9f892bc Latest Latest
Warning

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

Go to latest
Published: Mar 16, 2014 License: GPL-3.0 Imports: 3 Imported by: 0

Documentation

Overview

glm document

glm project glm.go

Index

Constants

View Source
const DEG_TO_RAD = float64(math.Pi) / 180

Variables

View Source
var IDENTITY4 = Matrix4{
	1, 0, 0, 0,
	0, 1, 0, 0,
	0, 0, 1, 0,
	0, 0, 0, 1,
}
View Source
var ZUP = Matrix4{
	1, 0, 0, 0,
	0, 0, -1, 0,
	0, 1, 0, 0,
	0, 0, 0, 1}

Functions

func AngleU2

func AngleU2(d0, d1 Vector3) float64

func AngleU3

func AngleU3(v0, v1, v2 Vector3) float64

func CheckInterpolatorDomain

func CheckInterpolatorDomain(t float64)

func InterpSmooth

func InterpSmooth(t float64) float64

Function with first and second derivatives =0 at its extremities.

Types

type Attitude

type Attitude struct {
	Angles Vector3
	// contains filtered or unexported fields
}

func (Attitude) GetTb

func (self Attitude) GetTb() TaitBryan

func (Attitude) H

func (self Attitude) H() float64

func (Attitude) Hpr

func (self Attitude) Hpr() (float64, float64, float64)

func (Attitude) Hprv

func (self Attitude) Hprv() Vector3

func (Attitude) P

func (self Attitude) P() float64

func (Attitude) R

func (self Attitude) R() float64

func (Attitude) Rotation

func (self Attitude) Rotation() Matrix4

func (Attitude) RotationInv

func (self Attitude) RotationInv() Matrix4

func (Attitude) SetH

func (self Attitude) SetH(h float64) Attitude

func (Attitude) SetHpr

func (self Attitude) SetHpr(h, p, r float64) Attitude

func (Attitude) SetHprv

func (self Attitude) SetHprv(hpr Vector3) Attitude

func (Attitude) SetP

func (self Attitude) SetP(p float64) Attitude

func (Attitude) SetR

func (self Attitude) SetR(r float64) Attitude

func (Attitude) SetX

func (self Attitude) SetX(x float64) Attitude

func (Attitude) SetXyz

func (self Attitude) SetXyz(x, y, z float64) Attitude

func (Attitude) SetXyzv

func (self Attitude) SetXyzv(xyz Vector3) Attitude

func (Attitude) SetY

func (self Attitude) SetY(y float64) Attitude

func (Attitude) SetZ

func (self Attitude) SetZ(z float64) Attitude

func (Attitude) X

func (self Attitude) X() float64

func (Attitude) Xyz

func (self Attitude) Xyz() (float64, float64, float64)

func (Attitude) Xyzv

func (self Attitude) Xyzv() Vector3

func (Attitude) Y

func (self Attitude) Y() float64

func (Attitude) Z

func (self Attitude) Z() float64

type Matrix4

type Matrix4 [16]float64

func OrthographicProj

func OrthographicProj(fov_h, aspect, z_near, z_far float64) Matrix4

Orthographic projection.

func PerspectiveProj

func PerspectiveProj(fov_h, aspect, z_near, z_far float64) Matrix4

Perspective projection.

func RotX

func RotX(angle float64) Matrix4

func RotY

func RotY(angle float64) Matrix4

func RotZ

func RotZ(angle float64) Matrix4

func (Matrix4) Gl

func (a Matrix4) Gl() [16]float32

func (Matrix4) GlFloats

func (a Matrix4) GlFloats() [16]gl.GLfloat

func (Matrix4) Mult

func (a Matrix4) Mult(b Matrix4) Matrix4

func (Matrix4) MultV

func (a Matrix4) MultV(b Vector4) Vector4

type Quat

type Quat [4]float64

func InterpolateRotation

func InterpolateRotation(q0, q1 Quat, t float64) Quat

func Slerp

func Slerp(q0, q1 Quat, t float64) Quat

func (Quat) Add

func (q0 Quat) Add(q1 Quat) Quat

func (Quat) Conj

func (q Quat) Conj() Quat

func (Quat) Dot

func (q0 Quat) Dot(q1 Quat) float64

func (Quat) Hamilton

func (q Quat) Hamilton(p Quat) Quat

func (Quat) Matrix

func (q Quat) Matrix() Matrix4

func (Quat) Mult

func (q0 Quat) Mult(q1 Quat) Quat

func (Quat) Neg

func (q Quat) Neg() Quat

func (Quat) Rotate3

func (q Quat) Rotate3(v Vector3) Vector3

func (Quat) Rotate4

func (q Quat) Rotate4(v Vector4) Vector4

func (Quat) Smult

func (q Quat) Smult(s float64) Quat

type TaitBryan

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

func MakeTaitBryan

func MakeTaitBryan(h, p, r int) TaitBryan

func (TaitBryan) MakeAttitude

func (self TaitBryan) MakeAttitude() Attitude

type Vector2

type Vector2 [2]float64

type Vector3

type Vector3 [3]float64

func FaceNormal2

func FaceNormal2(d10, d20 Vector3) Vector3

Compute the normal to a triangle from two of its sides.

func FaceNormal3

func FaceNormal3(v0, v1, v2 Vector3) Vector3

Compute the normal to a triangle from its three vertices.

func InterpolateTranslation

func InterpolateTranslation(v0, v1 Vector3, t float64) Vector3

func (Vector3) Add

func (self Vector3) Add(other Vector3) Vector3

func (Vector3) Cross

func (self Vector3) Cross(other Vector3) Vector3

func (Vector3) Dot

func (self Vector3) Dot(other Vector3) float64

func (Vector3) Gl

func (self Vector3) Gl() [3]float32

func (Vector3) GlFloats

func (self Vector3) GlFloats() [3]gl.GLfloat

func (Vector3) Norm

func (self Vector3) Norm() float64

func (Vector3) Norm2

func (self Vector3) Norm2() float64

func (Vector3) Normed

func (self Vector3) Normed() Vector3

func (Vector3) Quat

func (v Vector3) Quat(angle float64) Quat

func (Vector3) SetX

func (self Vector3) SetX(x float64) Vector3

func (Vector3) SetXyz

func (self Vector3) SetXyz(x, y, z float64) Vector3

func (Vector3) SetY

func (self Vector3) SetY(y float64) Vector3

func (Vector3) SetZ

func (self Vector3) SetZ(z float64) Vector3

func (Vector3) Smult

func (self Vector3) Smult(scalar float64) Vector3

func (Vector3) Sub

func (self Vector3) Sub(other Vector3) Vector3

func (Vector3) To4

func (self Vector3) To4(w float64) Vector4

func (Vector3) Translation

func (self Vector3) Translation() Matrix4

func (Vector3) TranslationInv

func (self Vector3) TranslationInv() Matrix4

func (Vector3) X

func (self Vector3) X() float64

func (Vector3) Xyz

func (self Vector3) Xyz() (float64, float64, float64)

func (Vector3) Y

func (self Vector3) Y() float64

func (Vector3) Z

func (self Vector3) Z() float64

type Vector4

type Vector4 [4]float64

func (Vector4) Add

func (self Vector4) Add(other Vector4) Vector4

func (Vector4) Gl

func (self Vector4) Gl() [4]float32

func (Vector4) GlFloats

func (self Vector4) GlFloats() [4]gl.GLfloat

func (Vector4) Norm

func (self Vector4) Norm() float64

func (Vector4) Norm2

func (self Vector4) Norm2() float64

func (Vector4) Quat

func (v Vector4) Quat(angle float64) Quat

func (Vector4) SetW

func (self Vector4) SetW(w float64) Vector4

func (Vector4) SetX

func (self Vector4) SetX(x float64) Vector4

func (Vector4) SetXyz

func (self Vector4) SetXyz(x, y, z float64) Vector4

func (Vector4) SetXyzw

func (self Vector4) SetXyzw(x, y, z, w float64) Vector4

func (Vector4) SetY

func (self Vector4) SetY(y float64) Vector4

func (Vector4) SetZ

func (self Vector4) SetZ(z float64) Vector4

func (Vector4) Smult

func (self Vector4) Smult(scalar float64) Vector4

func (Vector4) Sub

func (self Vector4) Sub(other Vector4) Vector4

func (Vector4) To3

func (self Vector4) To3() Vector3

func (Vector4) Translation

func (self Vector4) Translation() Matrix4

func (Vector4) TranslationInv

func (self Vector4) TranslationInv() Matrix4

func (Vector4) W

func (self Vector4) W() float64

func (Vector4) X

func (self Vector4) X() float64

func (Vector4) Xyz

func (self Vector4) Xyz() (float64, float64, float64)

func (Vector4) Xyzw

func (self Vector4) Xyzw() (float64, float64, float64, float64)

func (Vector4) Y

func (self Vector4) Y() float64

func (Vector4) Z

func (self Vector4) Z() float64

Jump to

Keyboard shortcuts

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