geom

package
v0.0.0-...-692212b Latest Latest
Warning

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

Go to latest
Published: May 5, 2023 License: Apache-2.0 Imports: 1 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Mat4

type Mat4 [16]float32

Mat4 is 4x4 matrix

func Mat4Frustum

func Mat4Frustum(_left float32, _right float32, _bottom float32, _top float32, _near float32, _far float32) (m Mat4)

func Mat4Ident

func Mat4Ident() Mat4

Mat4Ident return identity

func Mat4LookAt

func Mat4LookAt(_eye Vec3, _lookAt Vec3, _up Vec3) (m Mat4)

func Mat4Ortho

func Mat4Ortho(xMin float32, xMax float32, yMin float32, yMax float32, zMin float32, zMax float32) (m Mat4)

func Mat4Perspective

func Mat4Perspective(_fovy float32, _aspect float32, _near float32, _far float32) (m Mat4)

func Mat4Rot

func Mat4Rot(rad float32, _x float32, _y float32, _z float32) (rot Mat4)

func Mat4RotX

func Mat4RotX(rad float32) (rot Mat4)

func Mat4RotY

func Mat4RotY(rad float32) (rot Mat4)

func Mat4RotZ

func Mat4RotZ(rad float32) (rot Mat4)

func Mat4Scale

func Mat4Scale(_sx float32, _sy float32, _sz float32) (n Mat4)

func Mat4Trans

func Mat4Trans(_dx float32, _dy float32, _dz float32) (trans Mat4)

func (Mat4) Det

func (m Mat4) Det() float32

func (Mat4) Inverse

func (m Mat4) Inverse() (b Mat4)

func (Mat4) Mult

func (a Mat4) Mult(b Mat4) (c Mat4)

Mult calculate a * b

func (Mat4) MultVec3

func (m Mat4) MultVec3(a Vec3) (b Vec3)

func (Mat4) MultVec4

func (m Mat4) MultVec4(a [4]float32) (b [4]float32)

func (Mat4) Transpose

func (m Mat4) Transpose() (x Mat4)

type Mat4Stack

type Mat4Stack []Mat4

func (*Mat4Stack) Get

func (s *Mat4Stack) Get() Mat4

func (*Mat4Stack) GetFloatPtr

func (s *Mat4Stack) GetFloatPtr() *float32

func (*Mat4Stack) GetPtr

func (s *Mat4Stack) GetPtr() *Mat4

func (*Mat4Stack) Load

func (s *Mat4Stack) Load(m Mat4)

func (*Mat4Stack) Multi

func (s *Mat4Stack) Multi(m Mat4)

func (*Mat4Stack) Pop

func (s *Mat4Stack) Pop()

func (*Mat4Stack) Push

func (s *Mat4Stack) Push()

type Rect

type Rect [4]float32

Rect is 2D rectangle in (x0,y0,x1,y1) format

func (Rect) Center

func (r Rect) Center() (x, y float32)

Center point

func (Rect) Contains

func (r Rect) Contains(x, y float32) bool

Contains reports whether the rect contains the point.

func (Rect) Height

func (r Rect) Height() float32

Height is Y1 - Y0

func (Rect) IsEmpty

func (r Rect) IsEmpty() bool

IsEmpty reports whether the rect is empty

func (Rect) IsNegative

func (r Rect) IsNegative() bool

IsNegative reports x1 < x0 or y1 < y0

func (Rect) PositiveCopy

func (r Rect) PositiveCopy() (x Rect)

PositiveCopy return a copy of r which guarantee x1 >= x0 and y1 >= y0

func (Rect) Width

func (r Rect) Width() float32

Width is X1 - X0

func (Rect) X0

func (r Rect) X0() float32

X0 is left position, r[0]

func (Rect) X1

func (r Rect) X1() float32

X1 is right position, r[2]

func (Rect) Y0

func (r Rect) Y0() float32

Y0 is top position, r[1]

func (Rect) Y1

func (r Rect) Y1() float32

Y1 is bottom position, r[3]

type Vec2

type Vec2 [2]float32

Vec2 is 2D vector

func (Vec2) Add

func (v Vec2) Add(a Vec2) Vec2

Add vector

func (Vec2) Dot

func (v Vec2) Dot(b Vec2) float32

Dot product

func (Vec2) Kross

func (v Vec2) Kross(b Vec2) float32

Kross product

func (Vec2) Neg

func (v Vec2) Neg() Vec2

Neg returns negative vector

func (Vec2) Normal

func (v Vec2) Normal() (ret Vec2)

Normal vector

func (Vec2) Sub

func (v Vec2) Sub(a Vec2) Vec2

Sub substract vector

func (Vec2) X

func (v Vec2) X() float32

X component

func (Vec2) Y

func (v Vec2) Y() float32

Y component

type Vec3

type Vec3 [3]float32

Vec3 is 3D vector

func (Vec3) Add

func (v Vec3) Add(a Vec3) Vec3

Add vector

func (Vec3) Cross

func (v Vec3) Cross(b Vec3) Vec3

Cross product

func (Vec3) Dot

func (v Vec3) Dot(b Vec3) float32

Dot product

func (Vec3) Neg

func (v Vec3) Neg() Vec3

Neg returns negative vector

func (Vec3) Normal

func (v Vec3) Normal() (ret Vec3)

Normal vector

func (Vec3) Sub

func (v Vec3) Sub(a Vec3) Vec3

Sub substract vector

func (Vec3) X

func (v Vec3) X() float32

X component

func (Vec3) Y

func (v Vec3) Y() float32

Y component

func (Vec3) Z

func (v Vec3) Z() float32

Z component

type Vec4

type Vec4 [4]float32

Vec4 is 4D vector

func (Vec4) Add

func (v Vec4) Add(a Vec4) Vec4

Add vector

func (Vec4) Dot

func (v Vec4) Dot(b Vec4) float32

Dot product

func (Vec4) Neg

func (v Vec4) Neg() Vec4

Neg returns negative vector

func (Vec4) Normal

func (v Vec4) Normal() (ret Vec4)

Normal vector

func (Vec4) Sub

func (v Vec4) Sub(a Vec4) Vec4

Sub substract vector

func (Vec4) W

func (v Vec4) W() float32

W component

func (Vec4) X

func (v Vec4) X() float32

X component

func (Vec4) Y

func (v Vec4) Y() float32

Y component

func (Vec4) Z

func (v Vec4) Z() float32

Z component

Jump to

Keyboard shortcuts

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