Exemplo n.º 1
0
        public void Update(BaseCamera camera, float dt) {
            _camera = camera;

            if (_first) {
                Position = camera.Position;
                ViewProj = camera.ViewProj;
                ViewProjInvert = camera.ViewProjInvert;
                _first = false;
            } else {
                Position = (Position * Smoothiness + camera.Position) / (1f + Smoothiness);
                ViewProj = (ViewProj * Smoothiness + camera.ViewProj) / (1f + Smoothiness);
                ViewProjInvert = (ViewProjInvert * Smoothiness + camera.ViewProjInvert) / (1f + Smoothiness);
            }
        }
Exemplo n.º 2
0
        public void Update(BaseCamera camera, float dt)
        {
            _camera = camera;

            if (_first)
            {
                Position       = camera.Position;
                ViewProj       = camera.ViewProj;
                Proj           = camera.Proj;
                View           = camera.Proj;
                ViewProjInvert = camera.ViewProjInvert;
                _first         = false;
            }
            else
            {
                Position       = (Position * Smoothiness + camera.Position) / (1f + Smoothiness);
                ViewProj       = (ViewProj * Smoothiness + camera.ViewProj) / (1f + Smoothiness);
                Proj           = (Proj * Smoothiness + camera.Proj) / (1f + Smoothiness);
                View           = (View * Smoothiness + camera.View) / (1f + Smoothiness);
                ViewProjInvert = (ViewProjInvert * Smoothiness + camera.ViewProjInvert) / (1f + Smoothiness);
            }
        }
Exemplo n.º 3
0
 protected virtual void ResetCamera() {
     Camera = GetCamera();
     Camera.SetLens(AspectRatio);
 }
Exemplo n.º 4
0
 public float GetShadowDepth(BaseCamera camera) {
     var m = Vector3.Transform(new Vector3(0, 0, Size / 2), camera.Proj);
     return m.Z / m.W;
 }
Exemplo n.º 5
0
 public void Update(Vector3 direction, BaseCamera camera) {
     foreach (var split in Splits) {
         split.LookAt(direction, camera.Position + camera.Look * split.Size / 2);
     }
 }