# Copyright (C) 2009-2012 Mortal Coil Games # See LICENSE for details. """ Interfaces for services """ from zope.interface import Interface from mv3d.util.enum import Enum class RelativeTo(Enum): """ Enum to help describing camera rotation and translations """ local = 0 parent = 1 world = 2 class ICameraController(Interface): """ Pluggable camera controls for Guide RenderFrames """ def setup(guideWidget, renderer, renderWindow): #@NoSelf """ setup """ def postSetup(): #@NoSelf """ Derived classes can override this to do stuff after setup() """ def getRealCamera(): #@NoSelf """ getRealCamera """ def getRealCameraNode(): #@NoSelf """ getRealCameraNode """ def update(timeSinceLastFrame): #@NoSelf """ update """ def lookAt(vector, relativeTo=RelativeTo.local, localDirectionVector=None): #@NoSelf """ lookAt """ def translate(offset, relativeTo=RelativeTo.local): #@NoSelf """ translate """ def pitch(angle, relativeTo=RelativeTo.local): #@NoSelf """ pitch """ def yaw(angle, relativeTo=RelativeTo.local): #@NoSelf """ yaw """ def roll(angle, relativeTo=RelativeTo.local): #@NoSelf """ roll """ def getCameraToViewportRay(position): #@NoSelf """ Gets a world space ray as cast from the camera through a viewport position. """ def getPosition(): #@NoSelf """ getPosition """ def setPosition(position): #@NoSelf """ setPosition """ def getOrientation(): #@NoSelf """ getOrientation """ def setOrientation(orientation): #@NoSelf """ setOrientation """ def getNearClip(): #@NoSelf """ getNearClip """ def setNearClip(distance): #@NoSelf """ setNearClip """ def getFarClip(): #@NoSelf """ getFarClip """ def setFarClip(distance): #@NoSelf """ setFarClip """ def getFov(): #@NoSelf """ getFov """ def setFov(angle): #@NoSelf """ setFov """ def getAspectRatio(): #@NoSelf """ getAspectRatio """ def setAspectRatio(ratio): #@NoSelf """ setAspectRatio """ def getAutoAspectRatio(): #@NoSelf """ getAspectRatio """ def setAutoAspectRatio(auto): #@NoSelf """ setAspectRatio """ def pickObject(position): #@NoSelf """ Casts a ray at position and returns the object underneath or none """ def getViewportRay(position): #@NoSelf """ Returns (origin, normalized direction vector) for the given 2d position on the screen. """ def getViewpointLocation(position): #@NoSelf """ the x and y component are the 2d space, and the z is how far away from the screen """