PreviousFrameData.cs 1.9 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071
  1. using UnityEngine;
  2. namespace UnityEngine.Rendering.Universal.Internal
  3. {
  4. internal sealed class PreviousFrameData
  5. {
  6. #region Fields
  7. bool m_IsFirstFrame;
  8. int m_LastFrameActive;
  9. Matrix4x4 m_viewProjectionMatrix;
  10. Matrix4x4 m_PreviousViewProjectionMatrix;
  11. #if ENABLE_VR && ENABLE_XR_MODULE
  12. Matrix4x4[] m_ViewProjectionMatrixStereo = new Matrix4x4[2];
  13. Matrix4x4[] m_PreviousViewProjectionMatrixStereo = new Matrix4x4[2];
  14. #endif
  15. #endregion
  16. #region Constructors
  17. internal PreviousFrameData()
  18. {
  19. // Set data
  20. m_IsFirstFrame = true;
  21. m_LastFrameActive = -1;
  22. m_viewProjectionMatrix = Matrix4x4.identity;
  23. m_PreviousViewProjectionMatrix = Matrix4x4.identity;
  24. }
  25. #endregion
  26. #region Properties
  27. internal bool isFirstFrame
  28. {
  29. get => m_IsFirstFrame;
  30. set => m_IsFirstFrame = value;
  31. }
  32. internal int lastFrameActive
  33. {
  34. get => m_LastFrameActive;
  35. set => m_LastFrameActive = value;
  36. }
  37. internal Matrix4x4 viewProjectionMatrix
  38. {
  39. get => m_viewProjectionMatrix;
  40. set => m_viewProjectionMatrix = value;
  41. }
  42. internal Matrix4x4 previousViewProjectionMatrix
  43. {
  44. get => m_PreviousViewProjectionMatrix;
  45. set => m_PreviousViewProjectionMatrix = value;
  46. }
  47. #if ENABLE_VR && ENABLE_XR_MODULE
  48. internal Matrix4x4[] previousViewProjectionMatrixStereo
  49. {
  50. get => m_PreviousViewProjectionMatrixStereo;
  51. set => m_PreviousViewProjectionMatrixStereo = value;
  52. }
  53. internal Matrix4x4[] viewProjectionMatrixStereo
  54. {
  55. get => m_ViewProjectionMatrixStereo;
  56. set => m_ViewProjectionMatrixStereo = value;
  57. }
  58. #endif
  59. }
  60. #endregion
  61. }