Documentation ¶
Overview ¶
The geom package provides basic geometry types and functions.
Index ¶
- type Circle
- type Collision
- type Line
- type Normal
- type Point
- type Point3D
- type Polygon
- type Ray
- type Rect
- func (r Rect) ContainsPoint(p Point) bool
- func (r Rect) Dimension(i int) float32
- func (r Rect) Dimensions() int
- func (r Rect) GetCenter() (float32, float32)
- func (r Rect) GetOverlap(other Rect) (float32, float32)
- func (r Rect) HasRayIntersection(ray Ray, collision *Collision) bool
- func (r Rect) IsAxisAlignedCollision(other Rect) bool
- type Segment
- type Square
- type Triangle
- type Vector
- func (v Vector) Add(other Vector) Vector
- func (v Vector) Divide(other Vector) Vector
- func (v Vector) GetDirection(b Vector) float32
- func (v Vector) GetDistance(b Vector) float32
- func (v Vector) Multiply(other Vector) Vector
- func (v Vector) Offset(o Vector) Vector
- func (v Vector) String() string
- func (v Vector) Subtract(other Vector) Vector
- func (v Vector) ToPoint() Point
- type Vector3D
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Line ¶
type Line struct { Segment Segment // contains filtered or unexported fields }
func (Line) IsParrallel ¶
type Point3D ¶
type Point3D struct {
X, Y, Z float32
}
func MakePoint3D ¶
func (Point3D) ToVector3D ¶
type Polygon ¶
type Polygon []Point
func MakePolygon ¶
MakePolygon creates a new polygon from a slice of points.
type Rect ¶
type Rect [4]float32
Rect a float32 slice with 4 elements []float32{x, y, width, height}
func (Rect) ContainsPoint ¶
func (Rect) Dimensions ¶
Dimensions returns the total number of dimensions
func (Rect) HasRayIntersection ¶
HasRayIntersection returns true if an intersection exists the collision argument will contain information about the collision
func (Rect) IsAxisAlignedCollision ¶
type Vector ¶
type Vector [2]float32
Vector a float32 slice with 2 elements [2]float32{x, y}
func MakeVector ¶
func (Vector) GetDirection ¶
func (Vector) GetDistance ¶
type Vector3D ¶
type Vector3D [3]float32
func MakeVector3D ¶
func (Vector3D) DistanceTo ¶
Click to show internal directories.
Click to hide internal directories.