camera

package
v0.0.0-...-4901950 Latest Latest
Warning

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

Go to latest
Published: Feb 14, 2016 License: MIT Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	AxisFront = mgl.Vec3{0, 0, 1}
	AxisUp    = mgl.Vec3{0, 1, 0}
	AxisRight = mgl.Vec3{1, 0, 0}
)

Functions

This section is empty.

Types

type Camera

type Camera interface {
	View() mgl.Mat4
	Projection() mgl.Mat4
	Position() mgl.Vec3
}

type EulerCamera

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

func (*EulerCamera) Move

func (c *EulerCamera) Move(delta mgl.Vec3)

Move adjusts the position of the camera by a delta vector relative to the camera is facing.

func (*EulerCamera) Position

func (c *EulerCamera) Position() mgl.Vec3

func (*EulerCamera) Projection

func (c *EulerCamera) Projection() mgl.Mat4

Projection returns the projection matrix for the camera perspective

func (*EulerCamera) Rotate

func (c *EulerCamera) Rotate(delta mgl.Vec3)

Rotate adjusts the direction vectors by a delta vector of {pitch, yaw, roll}. Roll is ignored for now.

func (*EulerCamera) RotateTo

func (c *EulerCamera) RotateTo(center mgl.Vec3)

RotateTo adjusts the yaw and pitch to face a point.

func (*EulerCamera) SetPerspective

func (c *EulerCamera) SetPerspective(fovy, aspect, near, far float32)

Perspective computes the projection matrix and saves it

func (*EulerCamera) String

func (c *EulerCamera) String() string

String returns a string representation of the camera for debugging.

func (*EulerCamera) View

func (c *EulerCamera) View() mgl.Mat4

View returns the transform matrix from world space into camera space

type FixedCamera

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

func (FixedCamera) Position

func (c FixedCamera) Position() mgl.Vec3

func (FixedCamera) Projection

func (c FixedCamera) Projection() mgl.Mat4

func (FixedCamera) View

func (c FixedCamera) View() mgl.Mat4

type QuatCamera

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

QuatCamera is a Camera implementation using quaternion for rotation.

func NewQuatCamera

func NewQuatCamera() *QuatCamera

func (*QuatCamera) Center

func (c *QuatCamera) Center() mgl.Vec3

Center returns the direction vector of the camera

func (*QuatCamera) Lerp

func (c *QuatCamera) Lerp(position mgl.Vec3, center mgl.Vec3, amount float32)

Lerp will interpolate between the desired position/center by amount.

func (*QuatCamera) Move

func (c *QuatCamera) Move(delta mgl.Vec3)

Move adjusts the position of the camera by a delta vector relative to the camera is facing.

func (*QuatCamera) MoveTo

func (c *QuatCamera) MoveTo(position mgl.Vec3)

MoveTo adjusts the absolute position of the camera

func (*QuatCamera) Position

func (c *QuatCamera) Position() mgl.Vec3

func (*QuatCamera) Projection

func (c *QuatCamera) Projection() mgl.Mat4

Projection returns the projection matrix for the camera perspective

func (*QuatCamera) Rotate

func (c *QuatCamera) Rotate(delta mgl.Vec3)

func (*QuatCamera) RotateTo

func (c *QuatCamera) RotateTo(center mgl.Vec3)

RotateTo adjusts the yaw and pitch to face a point.

func (*QuatCamera) SetPerspective

func (c *QuatCamera) SetPerspective(fovy, aspect, near, far float32)

Perspective computes the projection matrix and saves it

func (*QuatCamera) String

func (c *QuatCamera) String() string

String returns a string representation of the camera for debugging.

func (*QuatCamera) Up

func (c *QuatCamera) Up() mgl.Vec3

Center returns the direction vector of the camera

func (*QuatCamera) View

func (c *QuatCamera) View() mgl.Mat4

View returns the transform matrix from world space into camera space

Jump to

Keyboard shortcuts

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