mm

package module
v0.0.0-...-9eb7295 Latest Latest
Warning

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

Go to latest
Published: Sep 20, 2016 License: MIT Imports: 9 Imported by: 0

README

Marshmallow

Marshmallow is a simple graphics library for go. It borrows shamlessly from three.js in much of it's layout but differs (as it must) in it's use of go interfaces and typed variables.

This project started as a port of three.js to go, and much of the current implementation remains true to that.

Documentation

Overview

Package mm is the main package for the Marshmallow graphics library for golang. It borrows shamlessly from three.js in it's layout and overall simlicity goals.

Index

Constants

View Source
const (
	XYZ          EulerOrder = "XYZ"
	YZX                     = "YZX"
	ZXY                     = "ZXY"
	XZY                     = "XZY"
	YXZ                     = "YXZ"
	ZYX                     = "ZYX"
	CurrentOrder            = "current"
)
View Source
const (
	Deg2Rad = math.Pi / 180.0
	Rad2Deg = 180.0 / math.Pi
)
View Source
const EulerDefaultOrder = XYZ

Variables

View Source
var ColorKeywords = map[string]int{}/* 147 elements not displayed */
View Source
var (
	Epsilon = math.Pow(2, -52)
)
View Source
var EulerRotationOrders = []EulerOrder{XYZ, YZX, ZXY, XZY, YXZ, ZYX}

Functions

func CharAt

func CharAt(s string, i int) string

func Clamp

func Clamp(value, min, max float64) float64

func EuclideanModulo

func EuclideanModulo(n, m float64) float64

func EulerEmptyCallback

func EulerEmptyCallback()

func GenerateUUID

func GenerateUUID() string

func Max

func Max(a, b float64, vals ...float64) float64

func QuaternionSlerpFlat

func QuaternionSlerpFlat(
	dst []float64, dstOffset int, src0 []float64, srcOffset0 int, src1 []float64, srcOffset1 int, t float64)

func Round

func Round(v float64) float64

Types

type Box3

type Box3 struct {
	Min *Vector3
	Max *Vector3
}

func NewBox3

func NewBox3() *Box3

func (*Box3) ApplyMatrix4

func (b *Box3) ApplyMatrix4(matrix *Matrix4) *Box3

func (*Box3) Center

func (b *Box3) Center(target *Vector3) *Vector3

func (*Box3) ClampPoint

func (b *Box3) ClampPoint(point, target *Vector3) *Vector3

func (*Box3) Clone

func (b *Box3) Clone() *Box3

func (*Box3) ContainsBox

func (b *Box3) ContainsBox(box *Box3) bool

func (*Box3) ContainsPoint

func (b *Box3) ContainsPoint(point *Vector3) bool

func (*Box3) Copy

func (b *Box3) Copy(src *Box3) *Box3

func (*Box3) DistanceToPoint

func (b *Box3) DistanceToPoint(point *Vector3) float64

func (*Box3) Equals

func (b *Box3) Equals(box *Box3) bool

func (*Box3) ExpandByPoint

func (b *Box3) ExpandByPoint(point *Vector3) *Box3

func (*Box3) ExpandByScalar

func (b *Box3) ExpandByScalar(scalar float64) *Box3

func (*Box3) ExpandByVector

func (b *Box3) ExpandByVector(vector *Vector3) *Box3

func (*Box3) GetParameter

func (b *Box3) GetParameter(point, target *Vector3) *Vector3

func (*Box3) Intersect

func (b *Box3) Intersect(other *Box3) *Box3

func (*Box3) IntersectsBox

func (b *Box3) IntersectsBox(other *Box3) bool

func (*Box3) IsEmpty

func (b *Box3) IsEmpty() bool

func (*Box3) MakeEmpty

func (b *Box3) MakeEmpty() *Box3

func (*Box3) Set

func (b *Box3) Set(min, max *Vector3) *Box3

func (*Box3) SetFromArray

func (b *Box3) SetFromArray(array []float64) *Box3

func (*Box3) SetFromCenterAndSize

func (b *Box3) SetFromCenterAndSize(center, size *Vector3) *Box3

func (*Box3) SetFromPoints

func (b *Box3) SetFromPoints(points []*Vector3) *Box3

func (*Box3) Size

func (b *Box3) Size(target *Vector3) *Vector3

func (*Box3) String

func (b *Box3) String() string

func (*Box3) Translate

func (b *Box3) Translate(offset *Vector3) *Box3

func (*Box3) Union

func (b *Box3) Union(other *Box3) *Box3

type Color

type Color struct {
	R float64
	G float64
	B float64
}

func Colors

func Colors(name string) *Color

func NewColor

func NewColor() *Color

func (*Color) Add

func (color *Color) Add(c *Color) *Color

func (*Color) AddColors

func (color *Color) AddColors(color1, color2 *Color) *Color

func (*Color) AddScalar

func (color *Color) AddScalar(s float64) *Color

func (*Color) B32

func (color *Color) B32() float32

func (*Color) Clone

func (color *Color) Clone() *Color

func (*Color) ConvertGammaToLinear

func (color *Color) ConvertGammaToLinear() *Color

func (*Color) ConvertLinearToGamma

func (color *Color) ConvertLinearToGamma() *Color

func (*Color) Copy

func (color *Color) Copy(src *Color) *Color

func (*Color) CopyGammaToLinear

func (color *Color) CopyGammaToLinear(gammaColor *Color) *Color

func (*Color) CopyLinearToGamma

func (color *Color) CopyLinearToGamma(gammaColor *Color) *Color

func (*Color) Equals

func (color *Color) Equals(c *Color) bool

func (*Color) FromArray

func (color *Color) FromArray(array []float64, offset int) *Color

func (*Color) G32

func (color *Color) G32() float32

func (*Color) GetHSL

func (color *Color) GetHSL() (hue, saturation, lightness float64)

func (*Color) GetHex

func (color *Color) GetHex() int

func (*Color) GetHexString

func (color *Color) GetHexString() string

func (*Color) GetStyle

func (color *Color) GetStyle() string

func (*Color) Lerp

func (color *Color) Lerp(c *Color, alpha float64) *Color

func (*Color) Multiply

func (color *Color) Multiply(c *Color) *Color

func (*Color) MultiplyScalar

func (color *Color) MultiplyScalar(s float64) *Color

func (*Color) OffsetHSL

func (color *Color) OffsetHSL(h, s, l float64) *Color

func (*Color) R32

func (color *Color) R32() float32

func (*Color) Set

func (color *Color) Set(r, g, b float64) *Color

func (*Color) SetHSL

func (color *Color) SetHSL(h, s, l float64) *Color

func (*Color) SetHex

func (color *Color) SetHex(hex int) *Color

func (*Color) SetRGB

func (color *Color) SetRGB(r, g, b float64) *Color

func (*Color) SetScalar

func (color *Color) SetScalar(scalar float64) *Color

func (*Color) SetStyle

func (color *Color) SetStyle(style string) *Color

func (*Color) Sub

func (color *Color) Sub(c *Color) *Color

func (*Color) ToArray

func (color *Color) ToArray(array []float64, offset int) []float64

type Euler

type Euler struct {
	Order            EulerOrder
	OnChangeCallback EulerChangeCallback
	// contains filtered or unexported fields
}

func NewEuler

func NewEuler() *Euler

func (*Euler) Clone

func (e *Euler) Clone() *Euler

func (*Euler) Copy

func (e *Euler) Copy(src *Euler) *Euler

func (*Euler) Equals

func (e *Euler) Equals(other *Euler) bool

func (*Euler) FromArray

func (e *Euler) FromArray(array []float64, order EulerOrder) *Euler

func (*Euler) GetOder

func (e *Euler) GetOder() EulerOrder

func (*Euler) GetX

func (e *Euler) GetX() float64

func (*Euler) GetY

func (e *Euler) GetY() float64

func (*Euler) GetZ

func (e *Euler) GetZ() float64

func (*Euler) OnChange

func (e *Euler) OnChange(callback EulerChangeCallback) *Euler

func (*Euler) Reorder

func (e *Euler) Reorder(newOrder EulerOrder) *Euler

func (*Euler) Set

func (e *Euler) Set(x, y, z float64, order EulerOrder) *Euler

func (*Euler) SetFromQuaternion

func (e *Euler) SetFromQuaternion(
	q *Quaternion, order EulerOrder, update bool) *Euler

func (*Euler) SetFromRotationMatrix

func (e *Euler) SetFromRotationMatrix(
	m *Matrix4, order EulerOrder, update bool) *Euler

func (*Euler) SetFromVector3

func (e *Euler) SetFromVector3(v *Vector3, order EulerOrder) *Euler

func (*Euler) SetOrder

func (e *Euler) SetOrder(value EulerOrder)

func (*Euler) SetX

func (e *Euler) SetX(value float64)

func (*Euler) SetY

func (e *Euler) SetY(value float64)

func (*Euler) SetZ

func (e *Euler) SetZ(value float64)

func (*Euler) ToArray

func (e *Euler) ToArray(array []float64, offset int) ([]float64, EulerOrder)

func (*Euler) ToVector3

func (e *Euler) ToVector3(target *Vector3) *Vector3

type EulerChangeCallback

type EulerChangeCallback func()

type EulerOrder

type EulerOrder string

type Matrix3

type Matrix3 struct {
	Elements []float64
}

func NewMatrix3

func NewMatrix3() *Matrix3

func (*Matrix3) ApplyToVector3Array

func (m *Matrix3) ApplyToVector3Array(array []float64, offset int, length int) []float64

func (*Matrix3) Clone

func (m *Matrix3) Clone() *Matrix3

func (*Matrix3) Copy

func (m *Matrix3) Copy(src *Matrix3) *Matrix3

func (*Matrix3) Determinant

func (m *Matrix3) Determinant() float64

func (*Matrix3) FromArray

func (m *Matrix3) FromArray(array []float64) *Matrix3

func (*Matrix3) GetInverse

func (m *Matrix3) GetInverse(matrix *Matrix3) *Matrix3

func (*Matrix3) GetNormalMatrix

func (m *Matrix3) GetNormalMatrix(matrix4 *Matrix4) *Matrix3

func (*Matrix3) Identity

func (m *Matrix3) Identity() *Matrix3

func (*Matrix3) MultiplyScalar

func (m *Matrix3) MultiplyScalar(s float64) *Matrix3

func (*Matrix3) MustGetInverse

func (m *Matrix3) MustGetInverse(matrix *Matrix3) *Matrix3

func (*Matrix3) Set

func (m *Matrix3) Set(n11, n12, n13, n21, n22, n23, n31, n32, n33 float64) *Matrix3

func (*Matrix3) SetFromMatrix4

func (m *Matrix3) SetFromMatrix4(other *Matrix4) *Matrix3

func (*Matrix3) ToArray

func (m *Matrix3) ToArray(array []float64, offset int) []float64

func (*Matrix3) Transpose

func (m *Matrix3) Transpose() *Matrix3

func (*Matrix3) TransposeIntoArray

func (m *Matrix3) TransposeIntoArray(r []float64) *Matrix3

type Matrix4

type Matrix4 struct {
	Elements []float64
}

func NewMatrix4

func NewMatrix4() *Matrix4

func (*Matrix4) Clone

func (m *Matrix4) Clone() *Matrix4

func (*Matrix4) Copy

func (m *Matrix4) Copy(other *Matrix4) *Matrix4

func (*Matrix4) CopyPosition

func (m *Matrix4) CopyPosition(other *Matrix4) *Matrix4

func (*Matrix4) Determinant

func (m *Matrix4) Determinant() float64

func (*Matrix4) Equals

func (m *Matrix4) Equals(matrix *Matrix4) bool

func (*Matrix4) ExtractBasis

func (m *Matrix4) ExtractBasis(xAxis, yAxis, zAxis *Vector3) *Matrix4

func (*Matrix4) ExtractRotation

func (m *Matrix4) ExtractRotation(target *Matrix4) *Matrix4

func (*Matrix4) FromArray

func (m *Matrix4) FromArray(array []float64) *Matrix4

func (*Matrix4) GetInverse

func (m *Matrix4) GetInverse(src *Matrix4) *Matrix4

func (*Matrix4) GetMaxScaleOnAxis

func (m *Matrix4) GetMaxScaleOnAxis() float64

func (*Matrix4) Identity

func (m *Matrix4) Identity() *Matrix4

func (*Matrix4) LookAt

func (m *Matrix4) LookAt(eye, target, up *Vector3) *Matrix4

func (*Matrix4) MakeBasis

func (m *Matrix4) MakeBasis(xAxis, yAxis, zAxis *Vector3) *Matrix4

func (*Matrix4) MakeFrustum

func (m *Matrix4) MakeFrustum(left, right, bottom, top, near, far float64) *Matrix4

func (*Matrix4) MakeOrthographic

func (m *Matrix4) MakeOrthographic(left, right, top, bottom, near, far float64) *Matrix4

func (*Matrix4) MakePerspective

func (m *Matrix4) MakePerspective(fov, aspect, near, far float64) *Matrix4

func (*Matrix4) MakeRotationAxis

func (m *Matrix4) MakeRotationAxis(axis *Vector3, angle float64) *Matrix4

func (*Matrix4) MakeRotationFromEuler

func (m *Matrix4) MakeRotationFromEuler(euler *Euler) *Matrix4

func (*Matrix4) MakeRotationFromQuaternion

func (m *Matrix4) MakeRotationFromQuaternion(q *Quaternion) *Matrix4

func (*Matrix4) MakeRotationX

func (m *Matrix4) MakeRotationX(theta float64) *Matrix4

func (*Matrix4) MakeRotationY

func (m *Matrix4) MakeRotationY(theta float64) *Matrix4

func (*Matrix4) MakeRotationZ

func (m *Matrix4) MakeRotationZ(theta float64) *Matrix4

func (*Matrix4) MakeScale

func (m *Matrix4) MakeScale(x, y, z float64) *Matrix4

func (*Matrix4) MakeTranslation

func (m *Matrix4) MakeTranslation(x, y, z float64) *Matrix4

func (*Matrix4) Multiply

func (m *Matrix4) Multiply(other *Matrix4) *Matrix4

func (*Matrix4) MultiplyMatrices

func (m *Matrix4) MultiplyMatrices(a, b *Matrix4) *Matrix4

func (*Matrix4) MultiplyScalar

func (m *Matrix4) MultiplyScalar(s float64) *Matrix4

func (*Matrix4) MultiplyToArray

func (m *Matrix4) MultiplyToArray(a, b *Matrix4, target []float64) []float64

func (Matrix4) MustGetInverse

func (m Matrix4) MustGetInverse(src *Matrix4) *Matrix4

func (*Matrix4) Premultiply

func (m *Matrix4) Premultiply(other *Matrix4) *Matrix4

func (*Matrix4) Scale

func (m *Matrix4) Scale(v *Vector3) *Matrix4

func (*Matrix4) Set

func (m *Matrix4) Set(n11, n12, n13, n14, n21, n22, n23, n24, n31, n32, n33, n34, n41, n42, n43, n44 float64) *Matrix4

func (*Matrix4) SetPosition

func (m *Matrix4) SetPosition(v *Vector3) *Matrix4

func (Matrix4) ToArray

func (m Matrix4) ToArray(array []float64, offset int) []float64

func (Matrix4) ToArray32

func (m Matrix4) ToArray32(array []float32, offset int) []float32

func (*Matrix4) Transpose

func (m *Matrix4) Transpose() *Matrix4

type Node

type Node interface {
	Add(Node)
	Remove(Node) bool

	GetParent() Node
	GetChildren() []Node
	// contains filtered or unexported methods
}

Node represents an item that can exist in an object hierearchy. A node is the most basic of objects in the marshmallow library

type Object

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

Object acts as a common base to many more specific types in the marshmallow library

func NewObject

func NewObject() *Object

NewObject creates a new Object instace with default values

func (*Object) Add

func (o *Object) Add(n Node)

Add adds the given node as a child of this object

func (*Object) GetChildren

func (o *Object) GetChildren() []Node

GetChildren returns the current slice of child nodes for this object

func (*Object) GetParent

func (o *Object) GetParent() Node

GetParent returns the current parent of this object

func (*Object) Remove

func (o *Object) Remove(n Node) bool

Remove remvoves the given node from this nodes children, returns true if the node was found and removed successfully

type Positioner

type Positioner interface {
	GetMatrixWorld() *Matrix4
}

type Projector

type Projector interface {
	Positioner
	GetProjectionMatrix() *Matrix4
}

type Quaternion

type Quaternion struct {
	OnChangeCallback func()
	// contains filtered or unexported fields
}

func NewQuaternion

func NewQuaternion() *Quaternion

func QuaternionSlerp

func QuaternionSlerp(qa, qb, qm *Quaternion, t float64) *Quaternion

func (*Quaternion) Clone

func (q *Quaternion) Clone() *Quaternion

func (*Quaternion) Conjugate

func (q *Quaternion) Conjugate() *Quaternion

func (*Quaternion) Copy

func (q *Quaternion) Copy(quaternion *Quaternion) *Quaternion

func (*Quaternion) Dot

func (q *Quaternion) Dot(v *Quaternion) float64

func (*Quaternion) Equals

func (q *Quaternion) Equals(quaternion *Quaternion) bool

func (*Quaternion) FromArray

func (q *Quaternion) FromArray(array []float64, offset int) *Quaternion

func (*Quaternion) GetW

func (q *Quaternion) GetW() float64

func (*Quaternion) GetX

func (q *Quaternion) GetX() float64

func (*Quaternion) GetY

func (q *Quaternion) GetY() float64

func (*Quaternion) GetZ

func (q *Quaternion) GetZ() float64

func (*Quaternion) Inverse

func (q *Quaternion) Inverse() *Quaternion

func (*Quaternion) Length

func (q *Quaternion) Length() float64

func (*Quaternion) LengthSq

func (q *Quaternion) LengthSq() float64

func (*Quaternion) Multiply

func (q *Quaternion) Multiply(other *Quaternion) *Quaternion

func (*Quaternion) MultiplyQuaternions

func (q *Quaternion) MultiplyQuaternions(a, b *Quaternion) *Quaternion

func (*Quaternion) Normalize

func (q *Quaternion) Normalize() *Quaternion

func (*Quaternion) OnChange

func (q *Quaternion) OnChange(callback func()) *Quaternion

func (*Quaternion) Premultiply

func (q *Quaternion) Premultiply(other *Quaternion) *Quaternion

func (*Quaternion) Set

func (q *Quaternion) Set(x, y, z, w float64) *Quaternion

func (*Quaternion) SetFromAxisAngle

func (q *Quaternion) SetFromAxisAngle(axis *Vector3, angle float64) *Quaternion

func (*Quaternion) SetFromEuler

func (q *Quaternion) SetFromEuler(euler *Euler, update bool) *Quaternion

func (*Quaternion) SetFromRotationMatrix

func (q *Quaternion) SetFromRotationMatrix(m *Matrix4) *Quaternion

func (*Quaternion) SetFromUnitVectors

func (q *Quaternion) SetFromUnitVectors(vFrom, vTo *Vector3) *Quaternion

func (*Quaternion) SetW

func (q *Quaternion) SetW(value float64)

func (*Quaternion) SetX

func (q *Quaternion) SetX(value float64)

func (*Quaternion) SetY

func (q *Quaternion) SetY(value float64)

func (*Quaternion) SetZ

func (q *Quaternion) SetZ(value float64)

func (*Quaternion) Slerp

func (q *Quaternion) Slerp(qb *Quaternion, t float64) *Quaternion

func (*Quaternion) String

func (q *Quaternion) String() string

func (*Quaternion) ToArray

func (q *Quaternion) ToArray(array []float64, offset int) []float64

type Renderer

type Renderer interface {
	Render(*Scene, Projector)
}

type Scene

type Scene struct {
	*Object

	BackgroundColor *Color

	AutoUpdate bool
}

func NewScene

func NewScene() *Scene

type Vector3

type Vector3 struct {
	X float64
	Y float64
	Z float64
}

func NewVector3

func NewVector3() *Vector3

func Vector3_Max

func Vector3_Max() *Vector3

func Vector3_Min

func Vector3_Min() *Vector3

func (*Vector3) Add

func (v *Vector3) Add(other *Vector3) *Vector3

func (*Vector3) AddScalar

func (v *Vector3) AddScalar(s float64) *Vector3

func (*Vector3) AddScaledVector

func (v *Vector3) AddScaledVector(other *Vector3, s float64) *Vector3

func (*Vector3) AddVectors

func (v *Vector3) AddVectors(a, b *Vector3) *Vector3

func (*Vector3) AngleTo

func (v *Vector3) AngleTo(other *Vector3) float64

func (*Vector3) ApplyEuler

func (v *Vector3) ApplyEuler(euler *Euler) *Vector3

func (*Vector3) ApplyMatrix3

func (v *Vector3) ApplyMatrix3(m *Matrix3) *Vector3

func (*Vector3) ApplyMatrix4

func (v *Vector3) ApplyMatrix4(m *Matrix4) *Vector3

func (*Vector3) ApplyProjection

func (v *Vector3) ApplyProjection(m *Matrix4) *Vector3

func (*Vector3) ApplyQuaternion

func (v *Vector3) ApplyQuaternion(q *Quaternion) *Vector3

func (*Vector3) Ceil

func (v *Vector3) Ceil() *Vector3

func (*Vector3) Clamp

func (v *Vector3) Clamp(min, max *Vector3) *Vector3

func (*Vector3) ClampLength

func (v *Vector3) ClampLength(min, max float64) *Vector3

func (*Vector3) ClampScalar

func (v *Vector3) ClampScalar(minVal, maxVal float64) *Vector3

func (*Vector3) Clone

func (v *Vector3) Clone() *Vector3

func (*Vector3) Copy

func (v *Vector3) Copy(other *Vector3) *Vector3

func (*Vector3) Cross

func (v *Vector3) Cross(other *Vector3) *Vector3

func (*Vector3) CrossVectors

func (v *Vector3) CrossVectors(a, b *Vector3) *Vector3

func (*Vector3) DistanceTo

func (v *Vector3) DistanceTo(other *Vector3) float64

func (*Vector3) DistanceToManhattan

func (v *Vector3) DistanceToManhattan(other *Vector3) float64

func (*Vector3) DistanceToSquared

func (v *Vector3) DistanceToSquared(other *Vector3) float64

func (*Vector3) Divide

func (v *Vector3) Divide(other *Vector3) *Vector3

func (*Vector3) DivideScalar

func (v *Vector3) DivideScalar(scalar float64) *Vector3

func (*Vector3) Dot

func (v *Vector3) Dot(other *Vector3) float64

func (*Vector3) Equals

func (v *Vector3) Equals(other *Vector3) bool

func (*Vector3) Floor

func (v *Vector3) Floor() *Vector3

func (*Vector3) FromArray

func (v *Vector3) FromArray(array []float64, offset int) *Vector3

func (*Vector3) GetComponent

func (v *Vector3) GetComponent(index int) float64

func (*Vector3) Length

func (v *Vector3) Length() float64

func (*Vector3) LengthManhattan

func (v *Vector3) LengthManhattan() float64

func (*Vector3) LengthSq

func (v *Vector3) LengthSq() float64

func (*Vector3) Lerp

func (v *Vector3) Lerp(other *Vector3, alpha float64) *Vector3

func (*Vector3) LerpVectors

func (v *Vector3) LerpVectors(v1, v2 *Vector3, alpha float64) *Vector3

func (*Vector3) Max

func (v *Vector3) Max(other *Vector3) *Vector3

func (*Vector3) Min

func (v *Vector3) Min(other *Vector3) *Vector3

func (*Vector3) Multiply

func (v *Vector3) Multiply(other *Vector3) *Vector3

func (*Vector3) MultiplyScalar

func (v *Vector3) MultiplyScalar(scalar float64) *Vector3

func (*Vector3) MultiplyVectors

func (v *Vector3) MultiplyVectors(a, b *Vector3) *Vector3

func (*Vector3) Negate

func (v *Vector3) Negate() *Vector3

func (*Vector3) Normalize

func (v *Vector3) Normalize() *Vector3

func (*Vector3) Project

func (v *Vector3) Project(camera Projector) *Vector3

func (*Vector3) ProjectOnPlane

func (v *Vector3) ProjectOnPlane(planeNormal *Vector3) *Vector3

func (*Vector3) ProjectOnVector

func (v *Vector3) ProjectOnVector(vector *Vector3) *Vector3

func (*Vector3) Reflect

func (v *Vector3) Reflect(normal *Vector3) *Vector3

func (*Vector3) Round

func (v *Vector3) Round() *Vector3

func (*Vector3) RoundToZero

func (v *Vector3) RoundToZero() *Vector3

func (*Vector3) Set

func (v *Vector3) Set(x, y, z float64) *Vector3

func (*Vector3) SetComponent

func (v *Vector3) SetComponent(index int, value float64) *Vector3

func (*Vector3) SetFromMatrixColumn

func (v *Vector3) SetFromMatrixColumn(m *Matrix4, index int) *Vector3

func (*Vector3) SetFromMatrixPosition

func (v *Vector3) SetFromMatrixPosition(m *Matrix4) *Vector3

func (*Vector3) SetFromMatrixScale

func (v *Vector3) SetFromMatrixScale(m *Matrix4) *Vector3

func (*Vector3) SetLength

func (v *Vector3) SetLength(length float64) *Vector3

func (*Vector3) SetScalar

func (v *Vector3) SetScalar(scalar float64) *Vector3

func (*Vector3) SetX

func (v *Vector3) SetX(x float64) *Vector3

func (*Vector3) SetY

func (v *Vector3) SetY(y float64) *Vector3

func (*Vector3) SetZ

func (v *Vector3) SetZ(z float64) *Vector3

func (*Vector3) String

func (v *Vector3) String() string

func (*Vector3) Sub

func (v *Vector3) Sub(other *Vector3) *Vector3

func (*Vector3) SubScalar

func (v *Vector3) SubScalar(s float64) *Vector3

func (*Vector3) SubVectors

func (v *Vector3) SubVectors(a, b *Vector3) *Vector3

func (*Vector3) ToArray

func (v *Vector3) ToArray(target []float64, offset int) []float64

func (*Vector3) ToArray32

func (v *Vector3) ToArray32(target []float32, offset int) []float32

func (*Vector3) TransformDirection

func (v *Vector3) TransformDirection(m *Matrix4) *Vector3

func (*Vector3) Unproject

func (v *Vector3) Unproject(camera Projector) *Vector3

type WindowRenderer

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

func NewWindowRenderer

func NewWindowRenderer(w, h int, title string) (*WindowRenderer, error)

func (*WindowRenderer) Destroy

func (r *WindowRenderer) Destroy()

func (*WindowRenderer) Render

func (r *WindowRenderer) Render(scene *Scene, camera Projector)

func (*WindowRenderer) ShouldClose

func (r *WindowRenderer) ShouldClose() bool

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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