camera

package
v1.1.0 Latest Latest
Warning

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

Go to latest
Published: Mar 8, 2018 License: BSD-3-Clause Imports: 2 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type LimitedCamera

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

LimitedCamera is a camera implementation with ranged controls for zooming and moving.

func NewLimited

func NewLimited(minZoom, maxZoom float32, minPos, maxPos float32) *LimitedCamera

NewLimited returns a new instance of a LimitedCamera.

func (*LimitedCamera) MoveBy

func (cam *LimitedCamera) MoveBy(dx, dy float32)

MoveBy adjusts the requested view offset by given delta values in world coordinates.

func (*LimitedCamera) MoveTo

func (cam *LimitedCamera) MoveTo(worldX, worldY float32)

MoveTo sets the requested view offset to the given world coordinates.

func (*LimitedCamera) SetViewportSize

func (cam *LimitedCamera) SetViewportSize(width, height float32)

SetViewportSize notifies the camera how big the view is.

func (*LimitedCamera) ViewMatrix

func (cam *LimitedCamera) ViewMatrix() *mgl.Mat4

ViewMatrix implements the Viewer interface.

func (*LimitedCamera) ZoomAt

func (cam *LimitedCamera) ZoomAt(levelDelta float32, x, y float32)

ZoomAt adjusts the requested zoom level by given delta, centered around given world position. Positive values zoom in.

type Viewer

type Viewer interface {
	// ViewMatrix returns the transformation matrix for the current view.
	ViewMatrix() *mgl.Mat4
}

Viewer represents the view of a camera.

Jump to

Keyboard shortcuts

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