camera

package
v0.0.0-...-e7326f8 Latest Latest
Warning

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

Go to latest
Published: May 18, 2024 License: GPL-3.0 Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Camera

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

A base component that implements camera features, such as view range, resolution.

func New

func New(tf interfaces.ITransform, resolutionWidth, resolutionHeight int) *Camera

func (*Camera) GetID

func (c *Camera) GetID() string

Implementation of the goi.Component

func (*Camera) GetOffset

func (c *Camera) GetOffset() *vector2.Vector2

Get a screen offset of the camera. Offset - Is a vector thattakes into account the current camera coordinates and resolution size. Also takes into account the camera scale.

func (*Camera) GetResolutionHeight

func (c *Camera) GetResolutionHeight() int

Returns a height of the screen resolution. Measured in pixels.

func (*Camera) GetResolutionVector

func (c *Camera) GetResolutionVector() *vector2.Vector2

Returns a vector with the screen resolution. Measured in pixels.

func (*Camera) GetResolutionWidth

func (c *Camera) GetResolutionWidth() int

Returns a width of the screen resolution. Measured in pixels.

func (*Camera) GetTransform

func (c *Camera) GetTransform() interfaces.ITransform

Returns transform of the camera. Rotation doesn't implemented and will be ignored.

func (*Camera) GetViewRange

func (c *Camera) GetViewRange() float64

Returns layer limit (Z coordinate) at which the camera stops displaying the object.

func (*Camera) SetOffset

func (c *Camera) SetOffset(offset *vector2.Vector2)

* BE CAREFUL

Set a offset of the camera. Offset - Is a vector thattakes into account the current camera coordinates and resolution size. Also takes into account the camera scale.

func (*Camera) SetResolution

func (c *Camera) SetResolution(width int, height int)

Set a resolution of the screen. Measured in pixels.

func (*Camera) SetResolutionHeight

func (c *Camera) SetResolutionHeight(height int)

Set a height of the screen resolution. Measured in pixels.

func (*Camera) SetResolutionWidth

func (c *Camera) SetResolutionWidth(width int)

Set a width of the screen resolution. Measured in pixels.

func (*Camera) SetViewRange

func (c *Camera) SetViewRange(viewRange float64)

Set the layer limit (Z coordinate) at which the camera stops displaying the object.

Jump to

Keyboard shortcuts

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