-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Move medium event to own header file
GitOrigin-RevId: 1619a75854609ec073e8c82dec8dfb89d8b21b78
- Loading branch information
1 parent
4f08469
commit 6fbc1f2
Showing
3 changed files
with
60 additions
and
30 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
46 changes: 46 additions & 0 deletions
46
devertexwahn/flatland/rendering/scene/shape/medium_event.h
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,46 @@ | ||
/* | ||
* SPDX-FileCopyrightText: Copyright 2024 Julian Amann <[email protected]> | ||
* SPDX-License-Identifier: Apache-2.0 | ||
*/ | ||
|
||
#pragma once | ||
#ifndef De_Vertexwahn_Core_MediumEvent_0348b3b2_3d75_4489_a2a5_7d4a6f7c0801_h | ||
#define De_Vertexwahn_Core_MediumEvent_0348b3b2_3d75_4489_a2a5_7d4a6f7c0801_h | ||
|
||
#include "math/frame.h" | ||
|
||
#include "core/namespace.h" | ||
|
||
DE_VERTEXWAHN_BEGIN_NAMESPACE | ||
|
||
template <typename ScalarType, unsigned int Dimension> | ||
class ShapeType; | ||
|
||
template<typename ScalarType, unsigned int Dimension> | ||
struct MediumEventType { | ||
using Scalar = ScalarType; | ||
using Point = PointType<ScalarType, Dimension>; | ||
using Normal = NormalType<ScalarType, Dimension>; | ||
using Frame = FrameType<ScalarType, Dimension>; | ||
|
||
Point p; // intersection point | ||
Scalar t; // distance to intersection point | ||
Frame geo_frame; // geo_frame regarding to world space | ||
Frame sh_frame; // shading frame | ||
|
||
const ShapeType<ScalarType, Dimension> *shape = nullptr; | ||
}; | ||
|
||
template <typename ScalarType> | ||
using MediumEvent2 = MediumEventType<ScalarType, 2>; | ||
template <typename ScalarType> | ||
using MediumEvent3 = MediumEventType<ScalarType, 3>; | ||
|
||
using MediumEvent2f = MediumEvent2<float>; | ||
using MediumEvent2d = MediumEvent2<double>; | ||
using MediumEvent3f = MediumEvent3<float>; | ||
using MediumEvent3d = MediumEvent3<double>; | ||
|
||
DE_VERTEXWAHN_END_NAMESPACE | ||
|
||
#endif // end define De_Vertexwahn_Core_MediumEvent_0348b3b2_3d75_4489_a2a5_7d4a6f7c0801_h |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters