MeshTypes

package
v0.5.0 Latest Latest
Warning

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

Go to latest
Published: Nov 23, 2025 License: Apache-2.0 Imports: 2 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Matrix

type Matrix struct {
	X00, X01, X02, X03 float64
	X10, X11, X12, X13 float64
	X20, X21, X22, X23 float64
	X30, X31, X32, X33 float64
}

func IdentityMatrix

func IdentityMatrix() Matrix

func (Matrix) Mul

func (a Matrix) Mul(b Matrix) Matrix

func (Matrix) MulPosition

func (a Matrix) MulPosition(b Vector) Vector

type Mesh

type Mesh struct {
	Triangles []*Triangle
}

func (*Mesh) Add

func (obj *Mesh) Add(mesh *Mesh) *Mesh

func (*Mesh) AddTriangle

func (obj *Mesh) AddTriangle(triangle *Triangle)

func (*Mesh) Copy

func (obj *Mesh) Copy() Mesh

func (*Mesh) RotateAndTranslate

func (obj *Mesh) RotateAndTranslate(translationMatrix Matrix)

func (*Mesh) ScaleToDimensions

func (obj *Mesh) ScaleToDimensions(desiredSize *Vector) error

type Triangle

type Triangle struct {
	V0 *Vertex
	V1 *Vertex
	V2 *Vertex
}

func (*Triangle) Copy

func (obj *Triangle) Copy() Triangle

func (*Triangle) Normal

func (t *Triangle) Normal() Vector

type Vector

type Vector struct {
	X float64
	Y float64
	Z float64
}

func (Vector) Add

func (a Vector) Add(b Vector) Vector

func (Vector) Cross

func (a Vector) Cross(b Vector) Vector

func (Vector) Div

func (a Vector) Div(b Vector) Vector

func (Vector) DivScalar added in v0.5.0

func (a Vector) DivScalar(b float64) Vector

func (Vector) Max

func (a Vector) Max(b *Vector) Vector

func (Vector) Min

func (a Vector) Min(b *Vector) Vector

func (Vector) Mult

func (a Vector) Mult(b Vector) Vector

func (Vector) Normalize

func (a Vector) Normalize() Vector

func (Vector) Sub

func (a Vector) Sub(b Vector) Vector

func (Vector) ToVertex

func (obj Vector) ToVertex(normal *Vector) *Vertex

type Vertex

type Vertex struct {
	Position Vector
	Normal   *Vector
}

func (*Vertex) Copy

func (obj *Vertex) Copy() Vertex

Jump to

Keyboard shortcuts

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