math3d

package module
v0.0.0-...-fee95ee Latest Latest
Warning

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

Go to latest
Published: Jan 24, 2016 License: MIT Imports: 2 Imported by: 1

README

math3d

go, golang - basic 3d math functions. Ongoing project. Utilised by my 'parse-obj' repo.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Triangle

type Triangle struct {
	Vertices []*Vertex

	Id      int
	Normal  Vector3
	Removed bool
	// contains filtered or unexported fields
}

func (Triangle) CalcNormal

func (this Triangle) CalcNormal() Vector3

func (Triangle) HasVertex

func (t Triangle) HasVertex(tv *Vertex) bool

func (Triangle) ReplaceVertex

func (this Triangle) ReplaceVertex(vOld *Vertex, vNew *Vertex, debug bool)

func (Triangle) SetUV

func (t Triangle) SetUV(uv1 Vector2, uv2 Vector2, uv3 Vector2)

type Vector2

type Vector2 struct {
	X float64
	Y float64
}

type Vector3

type Vector3 struct {
	X float64
	Y float64
	Z float64
}

func (Vector3) Add

func (v Vector3) Add(vadd *Vector3) Vector3

func (Vector3) Cross

func (v Vector3) Cross(vec Vector3) Vector3

func (Vector3) Dot

func (this Vector3) Dot(vec Vector3) float64

func (Vector3) Magnitude

func (v Vector3) Magnitude() float64

func (Vector3) Normalise

func (v Vector3) Normalise()

func (Vector3) Subtract

func (v Vector3) Subtract(vsub *Vector3) Vector3

type Vertex

type Vertex struct {
	Position *Vector3
	Cost     float64
	Id       int
	Collapse *Vertex
	Removed  bool
}

Jump to

Keyboard shortcuts

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