Advertisement
Zgragselus

InstanceNode.h

Nov 15th, 2023
850
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 1.92 KB | None | 0 0
  1. ///////////////////////////////////////////////////////////////////////////////////////////////////
  2. //
  3. // InstanceNode.h
  4. //
  5. // Implementation of instance node - a single node in scene representing an object instance
  6. //
  7. ///////////////////////////////////////////////////////////////////////////////////////////////////
  8.  
  9. #ifndef __RAYTRACER__INSTANCE_NODE__H__
  10. #define __RAYTRACER__INSTANCE_NODE__H__
  11.  
  12. ///////////////////////////////////////////////////////////////////////////////////////////////////
  13. // Header section
  14.  
  15. #include "Core/Memory/Memory.h"
  16. #include "Core/Math/Numeric/Mat4.h"
  17.  
  18. ///////////////////////////////////////////////////////////////////////////////////////////////////
  19. // Class & Structures definition
  20.  
  21. namespace Raytracer
  22. {
  23.     /// <summary>
  24.     /// Single instance node in scene
  25.     ///
  26.     /// This instance node structure holds instance information for either software/compute ray
  27.     /// tracing implementations or hardware ray tracing implementations. Theoretically it can hold
  28.     /// both to allow for ray tracing on either device.
  29.     /// </summary>
  30.     class ALIGN(16) InstanceNode
  31.     {
  32.     public:
  33.         /// <summary>
  34.         /// Transformation matrix for this instance
  35.         /// </summary>
  36.         Engine::mat4 mTransform;
  37.  
  38.         /// <summary>
  39.         /// Inverse of transformation matrix for this instance
  40.         /// </summary>
  41.         Engine::mat4 mTransformInverse;
  42.  
  43.         /// <summary>
  44.         /// Index to geometry node in scene for Software and Compute ray tracing implementation
  45.         /// </summary>
  46.         unsigned int mGeometryNode;
  47.  
  48.         /// <summary>
  49.         /// Padding to ensure 16-byte alignment
  50.         /// </summary>
  51.         unsigned int mPad0;
  52.  
  53.         /// <summary>
  54.         /// Pointer to acceleration structure for Hardware ray tracing implementation
  55.         /// </summary>
  56.         void* mAccelerationStructure;
  57.  
  58.         ALIGNED_NEW_DELETE("Raytracer::InstanceNode")
  59.     };
  60. }
  61.  
  62. ///////////////////////////////////////////////////////////////////////////////////////////////////
  63. // EOH
  64.  
  65. #endif
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement