Eidolon
Public Member Functions | Public Attributes | Private Member Functions | Private Attributes | List of all members
SingleCameraController Class Reference
Inheritance diagram for SingleCameraController:
Inheritance graph
Collaboration diagram for SingleCameraController:
Collaboration graph

Public Member Functions

def __init__ (self, camera, dist, zScale=1.0, tScale=1.0, rScale=1.0)
 
def start (self, mgr)
 
def stop (self, mgr)
 
def reset (self)
 
def getPropTuples (self)
 
def setZLocked (self, zlock)
 
def isZLocked (self)
 
def setSeeAllBoundBox (self, bb)
 
def setVertFOV (self, fov)
 
def setNearClip (self, clip)
 
def setFarClip (self, clip)
 
def getVertFOV (self)
 
def getNearClip (self)
 
def getFarClip (self)
 
def setOrtho (self, ortho)
 
def setWireframe (self, wire)
 
def setAspectRatio (self, aspect)
 
def setCameraLight (self, light)
 
def translate (self, dx, dy, dz)
 
def rotate (self, dx_r, dy=0)
 
def zoom (self, dist)
 
def setPosition (self, pos)
 
def setRotation (self, theta_r, phi=0)
 
def setZoom (self, dist)
 
def getPosition (self)
 
def getCameraPosition (self)
 
def getZoom (self)
 
def getRotator (self)
 
def getCameraRotation (self)
 

Public Attributes

 camera
 
 dist
 
 zScale
 
 rScale
 
 tScale
 
 radiusPower
 
 prevX
 
 prevY
 
 pos
 
 campos
 
 freerotator
 
 theta
 
 phi
 
 rho
 
 phisub
 

Private Member Functions

def _resizeCB (self, w, h)
 
def _mousePressCB (self, e)
 
def _mouseMoveCB (self, e)
 
def _mouseWheelCB (self, e)
 
def _setCamera (self)
 
def _orientCamera (self, cam, pos, lookat, rot)
 

Private Attributes

 _isZLocked
 

Detailed Description

Implements a Z-locked camera controller, where Z is always up on screen. This means that the scene
must first be rotated from the default orientation with Z pointing towards the camera, this is done
by adding pi/2 to phi when constructing the Y-axis rotator.

Constructor & Destructor Documentation

◆ __init__()

def __init__ (   self,
  camera,
  dist,
  zScale = 1.0,
  tScale = 1.0,
  rScale = 1.0 
)

Member Function Documentation

◆ _mouseMoveCB()

def _mouseMoveCB (   self,
  e 
)
private
Here is the call graph for this function:
Here is the caller graph for this function:

◆ _mousePressCB()

def _mousePressCB (   self,
  e 
)
private
Here is the caller graph for this function:

◆ _mouseWheelCB()

def _mouseWheelCB (   self,
  e 
)
private
Here is the call graph for this function:
Here is the caller graph for this function:

◆ _orientCamera()

def _orientCamera (   self,
  cam,
  pos,
  lookat,
  rot 
)
private
Here is the caller graph for this function:

◆ _resizeCB()

def _resizeCB (   self,
  w,
  h 
)
private
Here is the call graph for this function:
Here is the caller graph for this function:

◆ _setCamera()

def _setCamera (   self)
private
Here is the call graph for this function:
Here is the caller graph for this function:

◆ getCameraPosition()

def getCameraPosition (   self)
Returns the camera's position.

◆ getCameraRotation()

def getCameraRotation (   self)
Returns the rotation applied to the camera.

◆ getFarClip()

def getFarClip (   self)

◆ getNearClip()

def getNearClip (   self)

◆ getPosition()

def getPosition (   self)
Returns the look-at position.

◆ getPropTuples()

def getPropTuples (   self)

◆ getRotator()

def getRotator (   self)
Get the rotator for the camera based on self.theta and self.phi or self.freerotator. This represents the
rotation applied to orient the camera to face the look at position and a given up direction from the initial
position as defined by this controller.
Here is the caller graph for this function:

◆ getVertFOV()

def getVertFOV (   self)
Here is the caller graph for this function:

◆ getZoom()

def getZoom (   self)
Returns the zoom distance.

◆ isZLocked()

def isZLocked (   self)

◆ reset()

def reset (   self)
Here is the call graph for this function:

◆ rotate()

def rotate (   self,
  dx_r,
  dy = 0 
)
Rotate the camera using the given arguments. If the camera is Z-locked (isZLocked() is True), `dx_r' is a
float value scaled by self.rScale*0.005 then added to self.theta and `dy' is also a float scaled by
self.rScale*0.005 then added to self.phi. If the camera is not Z-locked, `dx_r' is a rotator applied to the
camera's rotation.
Here is the call graph for this function:
Here is the caller graph for this function:

◆ setAspectRatio()

def setAspectRatio (   self,
  aspect 
)
Here is the caller graph for this function:

◆ setCameraLight()

def setCameraLight (   self,
  light 
)
Here is the call graph for this function:

◆ setFarClip()

def setFarClip (   self,
  clip 
)
Here is the caller graph for this function:

◆ setNearClip()

def setNearClip (   self,
  clip 
)
Here is the caller graph for this function:

◆ setOrtho()

def setOrtho (   self,
  ortho 
)

◆ setPosition()

def setPosition (   self,
  pos 
)
Sets the look-at position to `pos'.
Here is the call graph for this function:
Here is the caller graph for this function:

◆ setRotation()

def setRotation (   self,
  theta_r,
  phi = 0 
)
Sets rotational parameters. If isZLocked() is True, `theta_r' and  `phi' are polar rotation values, these are
used to set self.theta and self.phi contrained within their respective ranges and tolerances. If isZLocked()
is False then `theta_r' is a rotator which is assigned to self.freerotator.
Here is the call graph for this function:
Here is the caller graph for this function:

◆ setSeeAllBoundBox()

def setSeeAllBoundBox (   self,
  bb 
)
Here is the call graph for this function:

◆ setVertFOV()

def setVertFOV (   self,
  fov 
)

◆ setWireframe()

def setWireframe (   self,
  wire 
)

◆ setZLocked()

def setZLocked (   self,
  zlock 
)
Here is the call graph for this function:

◆ setZoom()

def setZoom (   self,
  dist 
)
Sets the distance from the look-at position to max(0,001,`dist').
Here is the call graph for this function:
Here is the caller graph for this function:

◆ start()

def start (   self,
  mgr 
)
Here is the call graph for this function:

◆ stop()

def stop (   self,
  mgr 
)
Here is the call graph for this function:
Here is the caller graph for this function:

◆ translate()

def translate (   self,
  dx,
  dy,
  dz 
)
Translate relative to the initial orientation (Y-forward, Z-up) rotated by the camera's rotator.
Here is the call graph for this function:
Here is the caller graph for this function:

◆ zoom()

def zoom (   self,
  dist 
)
Add `dist`*self.zScale to the view distance.
Here is the call graph for this function:
Here is the caller graph for this function:

Member Data Documentation

◆ _isZLocked

_isZLocked
private

◆ camera

camera

◆ campos

campos

◆ dist

dist

◆ freerotator

freerotator

◆ phi

phi

◆ phisub

phisub

◆ pos

pos

◆ prevX

prevX

◆ prevY

prevY

◆ radiusPower

radiusPower

◆ rho

rho

◆ rScale

rScale

◆ theta

theta

◆ tScale

tScale

◆ zScale

zScale

The documentation for this class was generated from the following file: