geom

package
v0.4.0 Latest Latest
Warning

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

Go to latest
Published: Dec 29, 2019 License: MIT Imports: 1 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Rect

type Rect struct {
	Vec      // Position (contains X,Y)
	Size Vec // Size (X,Y)
}

func (*Rect) Bottom

func (rect *Rect) Bottom() float64

func (*Rect) CollisionPoint

func (rect *Rect) CollisionPoint(pos Vec) bool

func (Rect) CollisionRectangle

func (r1 Rect) CollisionRectangle(r2 Rect) bool

func (*Rect) DistancePoint

func (rect *Rect) DistancePoint(point Vec) float64

func (*Rect) DistanceRect

func (rect *Rect) DistanceRect(otherRect Rect) float64

DistanceRect will give you the distance in pixels between two rectangles this is useful for seeing how far an object is from another object.

func (*Rect) Left

func (rect *Rect) Left() float64

func (*Rect) Pos

func (rect *Rect) Pos() Vec

func (*Rect) Right

func (rect *Rect) Right() float64

func (*Rect) Top

func (rect *Rect) Top() float64

type RoomEditorDebugRect

type RoomEditorDebugRect struct {
	LeftTop     Vec
	RightBottom Vec
}

func R

func R(a Vec, b Vec) RoomEditorDebugRect

func (*RoomEditorDebugRect) Bottom

func (rect *RoomEditorDebugRect) Bottom() float64

func (*RoomEditorDebugRect) Left

func (rect *RoomEditorDebugRect) Left() float64

func (*RoomEditorDebugRect) Right

func (rect *RoomEditorDebugRect) Right() float64

func (*RoomEditorDebugRect) Top

func (rect *RoomEditorDebugRect) Top() float64

type Vec

type Vec struct {
	X float64 `json:"X"`
	Y float64 `json:"Y"`
}

func (Vec) DistancePoint

func (v Vec) DistancePoint(ov Vec) float64

func (Vec) Dot

func (v Vec) Dot(ov Vec) float64

func (Vec) Norm

func (v Vec) Norm() float64

Norm returns the vector's norm.

func (Vec) Sub

func (v Vec) Sub(ov Vec) Vec

Jump to

Keyboard shortcuts

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