control

package
v0.0.0-...-b8d9494 Latest Latest
Warning

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

Go to latest
Published: May 13, 2021 License: BSD-3-Clause, BSD-2-Clause Imports: 5 Imported by: 0

Documentation

Overview

Package control implements controllers for cameras

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type OrbitControl

type OrbitControl struct {
	Enabled         bool    // Control enabled state
	EnableRotate    bool    // Rotate enabled state
	EnableZoom      bool    // Zoom enabled state
	EnablePan       bool    // Pan enabled state
	EnableKeys      bool    // Enable keys state
	ZoomSpeed       float32 // Zoom speed factor. Default is 1.0
	RotateSpeed     float32 // Rotate speed factor. Default is 1.0
	MinDistance     float32 // Minimum distance from target. Default is 0.01
	MaxDistance     float32 // Maximum distance from target. Default is infinity
	MinPolarAngle   float32 // Minimum polar angle for rotatiom
	MaxPolarAngle   float32
	MinAzimuthAngle float32
	MaxAzimuthAngle float32
	KeyRotateSpeed  float32
	KeyPanSpeed     float32
	// contains filtered or unexported fields
}

OrbitControl is a camera controller that allows orbiting a center point while looking at it.

func NewOrbitControl

func NewOrbitControl(icam camera.ICamera, win window.IWindow) *OrbitControl

NewOrbitControl creates and returns a pointer to a new orbito control for the specified camera and window

func (*OrbitControl) Dispose

func (oc *OrbitControl) Dispose()

Dispose unsubscribes from all events

func (*OrbitControl) Pan

func (oc *OrbitControl) Pan(deltaX, deltaY float32)

Pan the camera and target by the specified deltas

func (*OrbitControl) Reset

func (oc *OrbitControl) Reset()

Reset to initial camera position

func (*OrbitControl) RotateLeft

func (oc *OrbitControl) RotateLeft(angle float32)

RotateLeft rotates the camera left by specified angle

func (*OrbitControl) RotateUp

func (oc *OrbitControl) RotateUp(angle float32)

RotateUp rotates the camera up by specified angle

func (*OrbitControl) Zoom

func (oc *OrbitControl) Zoom(delta float32)

Zoom in or out

Jump to

Keyboard shortcuts

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