dolly

package
v0.0.0-...-a3e6692 Latest Latest
Warning

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

Go to latest
Published: May 14, 2024 License: CC0-1.0 Imports: 8 Imported by: 0

Documentation

Overview

Package dolly maps user input to camera movements.

Index

Constants

View Source
const (
	// Let the direction of the positive Y-axis of the parent frame of the
	// camera frame be taken as pointing 'up'.
	Y = AxisPointingUp(iota)
	// Let the direction of the positive X-axis of the parent frame of the
	// camera frame be taken as pointing 'up'.
	X
	// Let the direction of the positive Z-axis of the parent frame of the
	// camera frame be taken as pointing 'up'.
	Z
)
View Source
const (
	SpatialMiasmaMode = SpatialMode(iota)
	SpatialGameMode
	SpatialJetPackMode
)
View Source
const (
	SphericalInnyMode = SphericalMode(iota)
	SphericalOutyMode
	SphericalSurfaceInnyMode
	SphericalSurfaceOutyMode
)

Variables

View Source
var (
	SpatialGame = NewSpatial(SpatialSpec{
		SpatialMode: SpatialGameMode,
		Up:          Y,
	})
	SpatialJetPack = NewSpatial(SpatialSpec{
		SpatialMode: SpatialJetPackMode,
		Up:          Y,
	})
	SpatialMiasma = NewSpatial(SpatialSpec{
		SpatialMode: SpatialMiasmaMode,
		Up:          Y,
	})
)
View Source
var (
	SphericalInwardsSurface = NewSpherical(SphericalSpec{
		SphericalMode: SphericalSurfaceInnyMode,
		Up:            Y,
	})
	SphericalOutwardsSurface = NewSpherical(SphericalSpec{
		SphericalMode: SphericalSurfaceOutyMode,
		Up:            Y,
	})
)

Functions

This section is empty.

Types

type AxisPointingUp

type AxisPointingUp uint

AxisPointingUp defines which axis points in the direction of what is considered 'up' in the implied reference frame.

Note that the camera's local up direction is always taken as the positive Y-axis direction.

The choice of up direction is relevant, for example, when used in conjunction with a static roll mode and/or a static elevation mode.

func (AxisPointingUp) Up

func (ax AxisPointingUp) Up() maf.Vec

Up direction unit vector.

type Camera

type Camera struct {
	Aspect  float64
	Inverse maf.Mat4 // Inverse of the lens (eye-to-clip) transformation.
	Name    string
	Node    *mechtree.Node
}

A Camera attached to a tree.

type Dollies

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

A Dollies is a collection of dollies.

func NewDollies

func NewDollies() Dollies

NewDollies constructs a new Dollies.

func (Dollies) Add

func (dols Dollies) Add(dol Dolly)

Add the dolly to the dollies.

func (Dollies) DeleteCamera

func (dols Dollies) DeleteCamera(name string) dryad.Set[string]

DeleteCamera from the dollies by deleting any dollies with that camera name.

Return the newly disconnected sources.

func (Dollies) DeleteSources

func (dols Dollies) DeleteSources(sources dryad.Set[string])

DeleteSources from the dollies.

func (Dollies) Drive

func (dols Dollies) Drive(
	fresh mechuievent.Collections,
	delta watchable.ChronoShift,
)

Drive all the dollies taking into account the given fresh UI events.

func (Dollies) KeepSourcesIn

func (dols Dollies) KeepSourcesIn(sources dryad.Set[string])

KeepSourcesIn the dollies which are present in the argument.

func (Dollies) UnconnectedSourcesIn

func (dols Dollies) UnconnectedSourcesIn(
	sources dryad.Set[string],
) dryad.Set[string]

UnconnectedSourcesIn the argument sources.

This is sources which are present in the argument but not in the dollies.

func (Dollies) UpdateCamera

func (dols Dollies) UpdateCamera(camera Camera)

UpdateCamera in the dollies.

type Dolly

type Dolly interface {
	// contains filtered or unexported methods
}

type DollyMaker

type DollyMaker func(camera Camera, source string) Dolly

A DollyMaker links a camera and input source to a new Dolly.

func NewSpatial

func NewSpatial(spec SpatialSpec) DollyMaker

NewSpatial constructs a new Spatial dolly (maker).

func NewSpherical

func NewSpherical(spec SphericalSpec) DollyMaker

NewSpherical constructs a new Spherical dolly (maker).

type SpatialMode

type SpatialMode uint

type SpatialSpec

type SpatialSpec struct {
	SpatialMode SpatialMode
	Up          AxisPointingUp
}

A SpatialSpec specifies the properties of a new Spatial dolly.

type SphericalMode

type SphericalMode uint

type SphericalSpec

type SphericalSpec struct {
	SphericalMode SphericalMode
	Up            AxisPointingUp
}

A SphericalSpec specifies the properties of a new Spherical dolly.

Jump to

Keyboard shortcuts

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