engine: github.com/g3n/engine/camera/control Index | Files

package control

import "github.com/g3n/engine/camera/control"

Package control implements controllers for cameras


Package Files

doc.go orbit_control.go

type OrbitControl Uses

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 Uses

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 Uses

func (oc *OrbitControl) Dispose()

Dispose unsubscribes from all events

func (*OrbitControl) Pan Uses

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

Pan the camera and target by the specified deltas

func (*OrbitControl) Reset Uses

func (oc *OrbitControl) Reset()

Reset to initial camera position

func (*OrbitControl) RotateLeft Uses

func (oc *OrbitControl) RotateLeft(angle float32)

RotateLeft rotates the camera left by specified angle

func (*OrbitControl) RotateUp Uses

func (oc *OrbitControl) RotateUp(angle float32)

RotateUp rotates the camera up by specified angle

func (*OrbitControl) Zoom Uses

func (oc *OrbitControl) Zoom(delta float32)

Zoom in or out

Package control imports 5 packages (graph) and is imported by 5 packages. Updated 2018-07-29. Refresh now. Tools for package owners.