//--------------------// #region Recalc View Matrix /// <summary> /// Update cached versions of <see cref="View"/> and related matrices; abstract, to be overwritten in subclass. /// </summary> protected override void UpdateView() { SimpleViewCached = Matrix.RotationQuaternion(_viewQuat); ViewCached = Matrix.Translation(-PositionCached.ApplyOffset(PositionBaseCached)) * SimpleViewCached; CacheSpecialMatrices(); }
//--------------------// #region Recalc View Matrix /// <summary> /// Update cached versions of <see cref="View"/> and related matrices; abstract, to be overwritten in subclass. /// </summary> protected override void UpdateView() { SimpleViewCached = Matrix.LookAtLH(new Vector3(), _target.ApplyOffset(PositionCached), _upVector); ViewCached = Matrix.LookAtLH(PositionCached.ApplyOffset(PositionBaseCached), _target.ApplyOffset(PositionBaseCached), _upVector); CacheSpecialMatrices(); }