geom

package
v0.0.0-...-e9df9b9 Latest Latest
Warning

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

Go to latest
Published: Jun 28, 2022 License: MIT Imports: 2 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Clamp

func Clamp(x, min, max float32) float32

func Max

func Max(x, y float32) float32

func Min

func Min(x, y float32) float32

Types

type Triangle

type Triangle struct {
	A, B, C Vec2
}

func NewTriangle

func NewTriangle(a, b, c Vec2) *Triangle

func (*Triangle) AppendVerticesIndices

func (t *Triangle) AppendVerticesIndices(vertices []ebiten.Vertex, indices []uint16, index int, cr, cg, cb, ca float32) ([]ebiten.Vertex, []uint16)

func (*Triangle) IntersectsCircle

func (t *Triangle) IntersectsCircle(p Vec2, radius float32) bool

func (*Triangle) Rotate

func (t *Triangle) Rotate(center Vec2, angle float32)

func (*Triangle) Scale

func (t *Triangle) Scale(center Vec2, v float32)

func (*Triangle) Translate

func (t *Triangle) Translate(x, y float32)

type Vec2

type Vec2 struct {
	X, Y float32
}

func (*Vec2) Add

func (v *Vec2) Add(v2 Vec2)

func (*Vec2) Atan2

func (v *Vec2) Atan2() float32

func (*Vec2) DistanceSqTo

func (v *Vec2) DistanceSqTo(v2 Vec2) float32

func (*Vec2) DistanceTo

func (v *Vec2) DistanceTo(v2 Vec2) float32

func (*Vec2) Dot

func (v *Vec2) Dot(v2 Vec2) float32

func (*Vec2) Equals

func (v *Vec2) Equals(v2 Vec2) bool

func (*Vec2) Hypot

func (v *Vec2) Hypot(v2 Vec2) float32

func (*Vec2) IsZero

func (v *Vec2) IsZero() bool

func (*Vec2) Length

func (v *Vec2) Length() float32

func (*Vec2) MulN

func (v *Vec2) MulN(n float32)

func (*Vec2) Normalize

func (v *Vec2) Normalize()

func (*Vec2) Project

func (v *Vec2) Project(v2 Vec2) Vec2

func (*Vec2) Rotate

func (v *Vec2) Rotate(center Vec2, angle float32)

func (*Vec2) Sub

func (v *Vec2) Sub(v2 Vec2)

type Vec3

type Vec3 struct {
	X, Y, Z float32
}

func (*Vec3) Add

func (v *Vec3) Add(v2 Vec3)

Jump to

Keyboard shortcuts

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