Beispiel #1
0
        public void _blend_source(float dt)
        {
            // 更新下一个镜头源的数据
            if (next_camera_source_timer_timer != null)
            {
                next_camera_source_timer_timer.OnUpdate(dt);
            }

            _dest_source_data = _blend_next(dt);

            if (next_camera_source_timer_timer != null)
            {
                bool reulst = next_camera_source_timer_timer.IsEnd();
                if (!reulst)
                {
                    return;
                }

                _list_camera_source_timer.Remove(next_camera_source_timer_timer);

                int last_index = _list_camera_source_timer.Count - 1;
                if (last_index >= 0)
                {
                    _init_next_camera_source(_list_camera_source_timer[last_index]);
                }
                else
                {
                    next_camera_source_timer_timer = null;
                }
            }
        }
Beispiel #2
0
        public static CameraSourceData Lerp(CameraSourceData from, CameraSourceData to, float dt)
        {
            CameraSourceData d;

            d._rotaion.x = Mathf.LerpAngle(from._rotaion.x, to._rotaion.x, dt);
            d._rotaion.y = Mathf.LerpAngle(from._rotaion.y, to._rotaion.y, dt);
            d._rotaion.z = Mathf.LerpAngle(from._rotaion.z, to._rotaion.z, dt);

            d._offset = Vector3.Lerp(from._offset, to._offset, dt);
            return(d);
        }
Beispiel #3
0
 // 混合form和to之间权重
 public CameraSourceData _blend_next(float dt)
 {
     if (next_camera_source_timer_timer != null)
     {
         CameraSourceData data = next_camera_source_timer_timer.GetData(_form_source, dt);
         return(data);
     }
     else
     {
         CameraSourceData data = CameraData2Player(_default_source, _player.EntityController.WroldPosition);
         return(data);
     }
 }
Beispiel #4
0
 public virtual CameraSourceData CameraLerp(CameraSourceData from, CameraSourceData to, float dt)
 {
     return(Lerp(from, to, dt));
 }
Beispiel #5
0
 // 初始化
 public void _init_camera_source_data()
 {
     _form_source = _to_source;
     _to_source   = next_camera_source_timer_timer._target._data;
     next_camera_source_timer_timer.OnReset();
 }