camera

package
v0.0.0-...-ddc071b Latest Latest
Warning

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

Go to latest
Published: Feb 26, 2023 License: GPL-3.0 Imports: 4 Imported by: 0

Documentation

Index

Constants

View Source
const (
	YAW = -90.0
	RAD = 0.0174532925
	PI  = 3.1415729
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Camera

type Camera struct {
	Transform  transform.Transform
	ViewMatrix matrix.Mat
	Pos        vector.Vec
	Rot        vector.Vec
	Front      vector.Vec
	Exposure   float32
}

Camera World Identity View Matrix Performs TMRT^ Normalize Operation for matrix construction

func NewCamera

func NewCamera(pos vector.Vec) Camera

Camera FPS Euler Decomposition Matrix

func (*Camera) CopyFront

func (cam *Camera) CopyFront(a vector.Vec)

Updates matrix 4 vec for front from the 3 vec

func (*Camera) FrontVec

func (cam *Camera) FrontVec() vector.Vec

Return Size 3 Vector from the 4 Stored vector

func (*Camera) Log

func (cam *Camera) Log()

func (*Camera) Rotate

func (cam *Camera) Rotate(axis vector.Vec, angle float32)

Rotates camera around a give unit axis

func (*Camera) RotateFPS

func (cam *Camera) RotateFPS(rot vector.Vec)
RotateFPS treats camera rotation as a rotation of its front facing direction

around a fixed up axis and arbitrary and calculated X (right) axis

func (*Camera) Translate

func (cam *Camera) Translate(vec vector.Vec)

Updates the camera view matrix with a translation from an approrpiately scaled vector

func (*Camera) Transpose

func (cam *Camera) Transpose() matrix.Mat

Calculates transpose

func (*Camera) Update

func (cam *Camera) Update() matrix.Mat

Returns the inverse camera view matrix for scene usage

Jump to

Keyboard shortcuts

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