Ejemplo n.º 1
0
 def OnActivated(self, lastCamera=None, itemID=None, **kwargs):
     BaseSpaceCamera.OnActivated(self, **kwargs)
     if lastCamera and lastCamera.cameraID in evecamera.INSPACE_CAMERAS:
         self.SetAtPosition(lastCamera.atPosition)
         self.SetEyePosition(lastCamera.eyePosition)
         self.fov = lastCamera.fov
     self.SetFovTarget(self.default_fov)
Ejemplo n.º 2
0
 def OnActivated(self,
                 lastCamera=None,
                 itemID=None,
                 duration=None,
                 **kwargs):
     settings.char.ui.Set('spaceCameraID', evecamera.CAM_TACTICAL)
     if lastCamera:
         distance = max(
             self.maxZoom,
             min(geo2.Vec3Length(self.eyePosition), self.minZoom))
         if lastCamera.cameraID in (evecamera.CAM_SHIPORBIT,
                                    evecamera.CAM_UNDOCK,
                                    evecamera.CAM_ENTERSPACE):
             self._ResetEyeAndAtPosition(lastCamera.eyePosition,
                                         lastCamera.atPosition, distance)
         else:
             animate = lastCamera.cameraID not in (evecamera.CAM_SHIPPOV,
                                                   evecamera.CAM_HANGAR)
             self._ResetEyeAndAtPosition(self.eyePosition, self.atPosition,
                                         distance, animate)
         self._SetLookAtBall(GetBall(lastCamera.GetItemID()))
         if lastCamera.cameraID != evecamera.CAM_SHIPPOV:
             self.fov = lastCamera.fov
         self.ResetFOV()
     else:
         if not itemID:
             itemID = self.ego
         self._SetLookAtBall(GetBall(itemID))
         self.SetEyePosition(self.default_eyePosition)
     BaseSpaceCamera.OnActivated(self, **kwargs)
Ejemplo n.º 3
0
 def OnActivated(self, **kwargs):
     BaseSpaceCamera.OnActivated(self, **kwargs)
     duration = max(blue.os.desiredSimDilation, 0.2) * 1.75
     self._eyePosition = geo2.Vec3Scale(self.GetLookAtDirection(), -30.0)
     eyePos1 = geo2.Vec3Scale(self.GetLookAtDirection(), 8.0)
     uicore.animations.MorphVector3(self,
                                    '_eyePosition',
                                    self._eyePosition,
                                    eyePos1,
                                    duration=duration)
     uicore.animations.MorphScalar(self,
                                   'fov',
                                   startVal=self.fov,
                                   endVal=0.55,
                                   duration=duration)
Ejemplo n.º 4
0
 def OnActivated(self, itemID=None, lastCamera=None, **kwargs):
     BaseSpaceCamera.OnActivated(self, **kwargs)
     self._LerpSpeedOffset()
     settings.char.ui.Set('spaceCameraID', evecamera.CAM_SHIPORBIT)
     if lastCamera and lastCamera.cameraID in (
             evecamera.CAM_TACTICAL, evecamera.CAM_SHIPPOV,
             evecamera.CAM_JUMP, evecamera.CAM_UNDOCK,
             evecamera.CAM_ENTERSPACE):
         itemID = itemID or getattr(lastCamera, 'lastLookAtID',
                                    None) or self.ego
         self._SetLookAtBall(itemID)
         atPos1 = self.GetTrackPosition(self.lookAtBall)
         eyePos1 = geo2.Vec3Add(
             atPos1,
             geo2.Vec3Scale(lastCamera.GetLookAtDirection(),
                            self.GetInitialZoomDist(lastCamera)))
         if lastCamera.cameraID in (evecamera.CAM_TACTICAL,
                                    evecamera.CAM_JUMP,
                                    evecamera.CAM_UNDOCK,
                                    evecamera.CAM_ENTERSPACE):
             if lastCamera.cameraID == evecamera.CAM_JUMP:
                 duration = 0.1
             else:
                 duration = GetDurationByDistance(lastCamera.eyePosition,
                                                  eyePos1, 0.4, 0.6)
             self.Transit(lastCamera.atPosition,
                          lastCamera.eyePosition,
                          atPos1,
                          eyePos1,
                          duration=duration,
                          smoothing=0.0)
             currFov = self.fov
             self.fov = lastCamera.fov
             self.SetFovTarget(currFov)
         else:
             self.SetAtPosition(atPos1)
             self.SetEyePosition(eyePos1)
     elif itemID:
         self._SetLookAtBall(itemID)
     elif not self.lookAtBall:
         self._SetLookAtBall(self.ego)
Ejemplo n.º 5
0
 def OnActivated(self, **kwargs):
     BaseSpaceCamera.OnActivated(self, **kwargs)
     self.animEntryThread = uthread.new(self._OnActivated)
Ejemplo n.º 6
0
 def OnActivated(self, **kwargs):
     BaseSpaceCamera.OnActivated(self, **kwargs)
     sm.StartService('state').SetState(self.ego, states.lookingAt, True)
     settings.char.ui.Set('spaceCameraID', evecamera.CAM_SHIPPOV)
     self.UpdateTrackBall()
     uthread.new(self.ConstructInSceneContainer)