<commit_before>﻿using System.Numerics;
using OpenSage.Mathematics;

namespace OpenSage.Graphics.Cameras
{
    public sealed class CameraComponent
    {
        private readonly Game _game;

        private readonly BoundingFrustum _frustum;

        private float _nearPlaneDistance;
        private float _farPlaneDistance;

        private Matrix4x4? _cachedProjectionMatrix;

        private bool _boundingFrustumDirty = true;

        /// <summary>
        /// Initializes a new instance of this class.
        /// </summary>
        public CameraComponent(Game game)
        {
            _game = game;
            _frustum = new BoundingFrustum(Matrix4x4.Identity);

            NearPlaneDistance = 0.125f;
            FarPlaneDistance = 10000.0f;
        }

        /// <summary>
        /// Gets or sets a value that specifies the distance from the camera of the camera's far clip plane.
        /// </summary>
        public float FarPlaneDistance
        {
            get { return _farPlaneDistance; }
            set
            {
                _farPlaneDistance = value;
                ClearCachedProjectionMatrix();
            }
        }

        /// <summary>
        /// Gets or sets a value that specifies the distance from the camera of the camera's near clip plane.
        /// </summary>
        public float NearPlaneDistance
        {
            get { return _nearPlaneDistance; }
            set<commit_msg>Fix z fighting issues by changing the near clipping plane to a more reasonable value<commit_after>﻿using System.Numerics;
using OpenSage.Mathematics;

namespace OpenSage.Graphics.Cameras
{
    public sealed class CameraComponent
    {
        private readonly Game _game;

        private readonly BoundingFrustum _frustum;

        private float _nearPlaneDistance;
        private float _farPlaneDistance;

        private Matrix4x4? _cachedProjectionMatrix;

        private bool _boundingFrustumDirty = true;

        /// <summary>
        /// Initializes a new instance of this class.
        /// </summary>
        public CameraComponent(Game game)
        {
            _game = game;
            _frustum = new BoundingFrustum(Matrix4x4.Identity);

            NearPlaneDistance = 4.0f;
            FarPlaneDistance = 10000.0f;
        }

        /// <summary>
        /// Gets or sets a value that specifies the distance from the camera of the camera's far clip plane.
        /// </summary>
        public float FarPlaneDistance
        {
            get { return _farPlaneDistance; }
            set
            {
                _farPlaneDistance = value;
                ClearCachedProjectionMatrix();
            }
        }

        /// <summary>
        /// Gets or sets a value that specifies the distance from the camera of the camera's near clip plane.
        /// </summary>
        public float NearPlaneDistance
        {
            get { return _nearPlaneDistance; }
            set
{'fraction_non_alphanumeric': 0.06800408024481469, 'fraction_numerical': 0.00884053043182591, 'mean_word_length': 1.7418452935694315, 'pattern_counts': {'":': 0, '<': 15, '<?xml version=': 0, '>': 15, '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': '1786492', 'n_tokens_mistral': 790, 'n_tokens_neox': 735, 'n_words': 231}