utils

package
v0.0.0-...-33f8f51 Latest Latest
Warning

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

Go to latest
Published: Jul 27, 2018 License: MIT Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CircleToPolygon

func CircleToPolygon(center mgl32.Vec2, radius float32, numSegments int, startAngle float32) ([]mgl32.Vec2, error)

Approximate a circle shape with a regular polygon

func GetBoundingBox

func GetBoundingBox(points []mgl32.Vec2) (mgl32.Vec2, mgl32.Vec2)

Returns the top left and the bottom right points of the 2D box bounding all the points passed.

Types

type FPSCounter

type FPSCounter struct {
	// contains filtered or unexported fields
}

func (*FPSCounter) FPS

func (f *FPSCounter) FPS() uint32

func (*FPSCounter) Update

func (f *FPSCounter) Update(deltaTime float64, updateRate uint32)

deltaTime: seconds since the previous frame updateRate: rate, in seconds, at which the FPS are computed

Jump to

Keyboard shortcuts

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