parameters: (self, state)
docstring: Constrained 2D motion perpendicular to camera's image plane
          This moves the object in the camera's XY plane if shift is held
          Moves object toward camera if control is held
docstring_summary: Constrained 2D motion perpendicular to camera's image plane
          This moves the object in the camera's XY plane if shift is held
          Moves object toward camera if control is held
docstring_tokens: Constrained 2D motion perpendicular to camera s image plane This moves the object in the camera s XY plane if shift is held Moves object toward camera if control is held
function: def xlateCamXY(self, state):
          """Constrained 2D motion perpendicular to camera's image plane
          This moves the object in the camera's XY plane if shift is held
          Moves object toward camera if control is held
          """
          # Reset scaling init flag
          self.fScaleInit = 1
          # Now, where is the widget relative to current camera view
          vWidget2Camera = SEditor.widget.getPos(SEditor.camera)
          # If this is first time around, record initial y distance
          if self.fHitInit:
              self.fHitInit = 0
              # Use distance to widget to scale motion along Y
              self.xlateSF = Vec3(vWidget2Camera).length()
              # Get widget's current xy coords in screen space
              coaCenter = getNearProjectionPoint(SEditor.widget)
              self.deltaNearX = coaCenter[0] - SEditor.dr.nearVec[0]
          # Which way do we move the object?
          if SEditor.fControl:
              moveDir = Vec3(vWidget2Camera)
              # If widget is behind camera invert vector
              if moveDir[1] < 0.0:
                  moveDir.assign(moveDir * -1)
              moveDir.normalize()
          else:
              moveDir = Vec3(Y_AXIS)
          # Move selected objects
          dr = SEditor.dr
          # Scale move dir
          moveDir.assign(moveDir * (2.0 * dr.mouseDeltaY * self.xlateSF))
          # Add it to current widget offset
          vWidget2Camera += moveDir
          # The object, however, stays at the same relative point to mouse in X
          vWidget2Camera.setX((dr.nearVec[0] + self.deltaNearX) *
                              (vWidget2Camera[1]/dr.near))
          # Move widget
          SEditor.widget.setPos(SEditor.camera, vWidget2Camera)
function_tokens: def xlateCamXY ( self , state ) : # Reset scaling init flag self . fScaleInit = 1 # Now, where is the widget relative to current camera view vWidget2Camera = SEditor . widget . getPos ( SEditor . camera ) # If this is first time around, record initial y distance if self . fHitInit : self . fHitInit = 0 # Use distance to widget to scale motion along Y self . xlateSF = Vec3 ( vWidget2Camera ) . length ( ) # Get widget's current xy coords in screen space coaCenter = getNearProjectionPoint ( SEditor . widget ) self . deltaNearX = coaCenter [ 0 ] - SEditor . dr . nearVec [ 0 ] # Which way do we move the object? if SEditor . fControl : moveDir = Vec3 ( vWidget2Camera ) # If widget is behind camera invert vector if moveDir [ 1 ] < 0.0 : moveDir . assign ( moveDir * - 1 ) moveDir . normalize ( ) else : moveDir = Vec3 ( Y_AXIS ) # Move selected objects dr = SEditor . dr # Scale move dir moveDir . assign ( moveDir * ( 2.0 * dr . mouseDeltaY * self . xlateSF ) ) # Add it to current widget offset vWidget2Camera += moveDir # The object, however, stays at the same relative point to mouse in X vWidget2Camera . setX ( ( dr . nearVec [ 0 ] + self . deltaNearX ) * ( vWidget2Camera [ 1 ] / dr . near ) ) # Move widget SEditor . widget . setPos ( SEditor . camera , vWidget2Camera )