<commit_before>﻿namespace Dunamis.Graphics
{
    public class Camera // TODO: convert to quat (gltut)
    {
        Matrix4 _view;      
        Matrix4 _projection;
        bool _viewCalculated;
        bool _projectionCalculated;

        Vector3 _position;
        Vector3 _rotation;
        Angle _fieldOfView;
        Vector2 _aspect;
        float _zNear;
        float _zFar;

        internal Matrix4 Projection2D;

        // TODO: add errors if didn't clear/display?
        #region Properties
        public Matrix4 View
        {
            get
            {
                if (!_viewCalculated)
                {
                    _view = OpenTK.Matrix4.LookAt(_position, _position + new Vector3(0, 0, -1), OpenTK.Vector3.UnitY) *
                        OpenTK.Matrix4.CreateRotationZ(_rotation.Z) *
                        OpenTK.Matrix4.CreateRotationY(_rotation.Y) *
                        OpenTK.Matrix4.CreateRotationX(_rotation.X);
                    _viewCalculated = true;
                }
                return _view;
            }
            set
            {
                _view = value;
            }
        }
        public Matrix4 Projection
        {
            get
            {<commit_msg>Stop recalculating view on manual update.<commit_after>﻿namespace Dunamis.Graphics
{
    public class Camera // TODO: convert to quat (gltut)
    {
        Matrix4 _view;      
        Matrix4 _projection;
        bool _viewCalculated;
        bool _projectionCalculated;

        Vector3 _position;
        Vector3 _rotation;
        Angle _fieldOfView;
        Vector2 _aspect;
        float _zNear;
        float _zFar;

        internal Matrix4 Projection2D;

        // TODO: add errors if didn't clear/display?
        #region Properties
        public Matrix4 View
        {
            get
            {
                if (!_viewCalculated)
                {
                    _view = OpenTK.Matrix4.LookAt(_position, _position + new Vector3(0, 0, -1), OpenTK.Vector3.UnitY) *
                        OpenTK.Matrix4.CreateRotationZ(_rotation.Z) *
                        OpenTK.Matrix4.CreateRotationY(_rotation.Y) *
                        OpenTK.Matrix4.CreateRotationX(_rotation.X);
                    _viewCalculated = true;
                }
                return _view;
            }
            set
            {
                _view = value;
                _viewCalculated = true;
            }
        }
        public Matrix4 Projection
        {
            get
            {
{'fraction_non_alphanumeric': 0.06590370955011839, 'fraction_numerical': 0.014206787687450671, 'mean_word_length': 1.2197898423817863, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '3918842', 'n_tokens_mistral': 706, 'n_tokens_neox': 645, 'n_words': 145}