Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- ///////////////////////////////////////////////////////////////////////////////////////////////////
- //
- // InstanceNode.h
- //
- // Implementation of instance node - a single node in scene representing an object instance
- //
- ///////////////////////////////////////////////////////////////////////////////////////////////////
- #ifndef __RAYTRACER__INSTANCE_NODE__H__
- #define __RAYTRACER__INSTANCE_NODE__H__
- ///////////////////////////////////////////////////////////////////////////////////////////////////
- // Header section
- #include "Core/Memory/Memory.h"
- #include "Core/Math/Numeric/Mat4.h"
- ///////////////////////////////////////////////////////////////////////////////////////////////////
- // Class & Structures definition
- namespace Raytracer
- {
- /// <summary>
- /// Single instance node in scene
- ///
- /// This instance node structure holds instance information for either software/compute ray
- /// tracing implementations or hardware ray tracing implementations. Theoretically it can hold
- /// both to allow for ray tracing on either device.
- /// </summary>
- class ALIGN(16) InstanceNode
- {
- public:
- /// <summary>
- /// Transformation matrix for this instance
- /// </summary>
- Engine::mat4 mTransform;
- /// <summary>
- /// Inverse of transformation matrix for this instance
- /// </summary>
- Engine::mat4 mTransformInverse;
- /// <summary>
- /// Index to geometry node in scene for Software and Compute ray tracing implementation
- /// </summary>
- unsigned int mGeometryNode;
- /// <summary>
- /// Padding to ensure 16-byte alignment
- /// </summary>
- unsigned int mPad0;
- /// <summary>
- /// Pointer to acceleration structure for Hardware ray tracing implementation
- /// </summary>
- void* mAccelerationStructure;
- ALIGNED_NEW_DELETE("Raytracer::InstanceNode")
- };
- }
- ///////////////////////////////////////////////////////////////////////////////////////////////////
- // EOH
- #endif
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement