Commit 2e5011fe authored by Philipp Schäfer's avatar Philipp Schäfer
Browse files

ART - RayToPropagationPath

- fixed a bug where receiver would have data of second last element instead of last
parent 2d7f3311
......@@ -45,7 +45,7 @@ namespace ITAPropagationPathSim
VistaVector3D position, wavefrontNormal;
propagationPath.push_back( std::make_shared<ITAGeo::CEmitterInhomogeneous>(ray.SourcePoint(), ray.InitialDirection()) );
for (int idx = 1; idx < ray.size()-1; idx++)
for (int idx = 1; idx < ray.size(); idx++)
{
position = ray[idx].position;
wavefrontNormal = ray[idx].wavefrontNormal;
......@@ -55,7 +55,13 @@ namespace ITAPropagationPathSim
wavefrontNormal[Vista::Z] = -wavefrontNormal[Vista::Z];
}
if (ray.IsReflectionIdx(idx))
if (idx == ray.size() - 1)
{
auto pReceiver = std::make_shared<ITAGeo::CSensorInhomogeneous>(position, wavefrontNormal, ray[idx].timeStamp);
pReceiver->dSpreadingLoss = ray.SpreadingLoss();
propagationPath.push_back(pReceiver);
}
else if (ray.IsReflectionIdx(idx))
{
auto anchor = std::make_shared<ITAGeo::CSpecularReflectionInhomogeneous>(position, wavefrontNormal, ray[idx].timeStamp);
anchor->v3FaceNormal = VistaVector3D(0, 0, 1);
......@@ -64,9 +70,6 @@ namespace ITAPropagationPathSim
else
propagationPath.push_back(std::make_shared<ITAGeo::CInhomogeneity>(position, wavefrontNormal, ray[idx].timeStamp));
}
auto pReceiver = std::make_shared<ITAGeo::CSensorInhomogeneous>(position, wavefrontNormal, ray.LastTimeStamp());
pReceiver->dSpreadingLoss = ray.SpreadingLoss();
propagationPath.push_back(pReceiver);
return propagationPath;
}
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment