Skip to content

Commit

Permalink
Remove M_PIf to enable compilation on Windows (#272)
Browse files Browse the repository at this point in the history
* Remove M_PIf to enable compilation on Windows

* Update test/src/scene/rcsAngleDistributionTest.cpp

Co-authored-by: Mateusz Szczygielski <112629916+msz-rai@users.noreply.github.com>

---------

Co-authored-by: Mateusz Szczygielski <112629916+msz-rai@users.noreply.github.com>
  • Loading branch information
prybicki and msz-rai authored Mar 25, 2024
1 parent 5317f9d commit 650ac95
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions src/gpu/nodeKernels.cu
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,7 @@ __global__ void kRadarComputeEnergy(size_t count, float rayAzimuthStepRad, float
constexpr float c0 = 299792458.0f;
constexpr float reflectionCoef = 1.0f; // TODO
const float waveLen = c0 / freq;
const float waveNum = 2.0f * M_PIf / waveLen;
const float waveNum = 2.0f * static_cast<float>(M_PI) / waveLen;
const thrust::complex<float> i = {0, 1.0};
const Vec3f dirX = {1, 0, 0};
const Vec3f dirY = {0, 1, 0};
Expand Down Expand Up @@ -142,7 +142,7 @@ __global__ void kRadarComputeEnergy(size_t count, float rayAzimuthStepRad, float

thrust::complex<float> BU = (-(apE.cross(-dirP) + apH.cross(dirT))).dot(rayDir);
thrust::complex<float> BR = (-(apE.cross(dirT) + apH.cross(dirP))).dot(rayDir);
thrust::complex<float> factor = thrust::complex<float>(0.0, ((waveNum * rayArea) / (4.0f * M_PIf))) *
thrust::complex<float> factor = thrust::complex<float>(0.0, ((waveNum * rayArea) / (4.0f * static_cast<float>(M_PI)))) *
exp(-i * vecK.dot(hitPos[tid]));

// printf("GPU: point=%d ray=??: dist=%f, pos=(%.2f, %.2f, %.2f), norm=(%.2f, %.2f, %.2f), BU=(%.2f+%.2fi), BR=(%.2f+%.2fi), factor=(%.2f+%.2fi)\n", tid, hitDist[tid],
Expand Down
4 changes: 2 additions & 2 deletions test/src/scene/rcsAngleDistributionTest.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,8 @@ const auto minElevation = -7.5f;
const auto maxElevation = 7.5f;
const auto azimuthStep = 0.05f;
const auto elevationStep = 0.05f;
const auto azimuthRad = (maxAzimuth - minAzimuth) * M_PIf / 180.0f;
const auto elevationRad = (maxElevation - minElevation) * M_PIf / 180.0f;
const auto azimuthRad = (maxAzimuth - minAzimuth) * std::numbers::pi_v<float> / 180.0f;
const auto elevationRad = (maxElevation - minElevation) * std::numbers::pi_v<float> / 180.0f;

std::vector<rgl_mat3x4f> genRadarRays()
{
Expand Down

0 comments on commit 650ac95

Please sign in to comment.