Skip to content

Commit

Permalink
Revert initial points to surface
Browse files Browse the repository at this point in the history
  • Loading branch information
tobre1 committed Mar 26, 2024
1 parent 7d85b25 commit 4adeb1f
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 16 deletions.
File renamed without changes.
21 changes: 5 additions & 16 deletions include/viennaps/psMeanFreePath.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -84,22 +84,11 @@ template <class NumericType, int D> class psMeanFreePath {
auto particleSeed = rayInternal::tea<3>(idx, seed);
rayRNG RngState(particleSeed);

rayTriple<NumericType> origin, direction;
int cellIdx = -1;

if constexpr (D == 3) {
auto pointIdx = pointDist(RngState);
direction = rayReflectionDiffuse<NumericType, 3>(
surfaceNormals[pointIdx], RngState);
cellIdx = getStartingCell(surfacePoints[pointIdx]);
origin = cellSet->getCellCenter(cellIdx);
} else {
auto cellIdx = cellDist(RngState);
while (
!psMaterialMap::isMaterial(materialIds->at(cellIdx), material)) {
cellIdx = cellDist(RngState);
}
}
auto pointIdx = pointDist(RngState);
auto direction = rayReflectionDiffuse<NumericType, 3>(
surfaceNormals[pointIdx], RngState);
int cellIdx = getStartingCell(surfacePoints[pointIdx]);
auto origin = cellSet->getCellCenter(cellIdx);

NumericType distanceOffset = 0.;

Expand Down

0 comments on commit 4adeb1f

Please sign in to comment.