Ejemplo n.º 1
0
        public void SetCamera(ModelPanelViewport v, float frame, bool retainAspect)
        {
            ViewportProjection proj = (ViewportProjection)(int)ProjectionType;

            if (v.ViewType != proj)
            {
                v.SetProjectionType(proj);
            }

            GLCamera             cam = v.Camera;
            CameraAnimationFrame f   = GetAnimFrame(frame);

            cam.Reset();
            cam.Translate(f.Pos);

            Vector3 rotate = f.GetRotation(Type);

            cam.Rotate(rotate);

            float aspect = retainAspect ? cam.Aspect : f.Aspect;

            cam.SetProjectionParams(aspect, f.FovY, f.FarZ, f.NearZ);
        }