Skip to content

Commit

Permalink
Fix windows build error due to windows header definition leakage (#270)
Browse files Browse the repository at this point in the history
* Fix windows build error due to windows header definition leakage

* Remove undef of near on windows and rename parameters with Distance postfix

---------

Co-authored-by: Josef <[email protected]>
  • Loading branch information
AlgoryxJosef and Josef authored Mar 22, 2024
1 parent 1cc5bec commit 5317f9d
Show file tree
Hide file tree
Showing 4 changed files with 15 additions and 13 deletions.
10 changes: 5 additions & 5 deletions include/rgl/api/core.h
Original file line number Diff line number Diff line change
Expand Up @@ -644,14 +644,14 @@ RGL_API rgl_status_t rgl_node_raytrace_configure_distortion(rgl_node_t node, boo
* Modifies RaytraceNode to set non-hit values for distance.
* Default non-hit value for the RGL_FIELD_DISTANCE_F32 field is set to infinity.
* This function allows to set custom values:
* - for non-hits closer than a minimum range (`near`),
* - for non-hits beyond a maximum range (`far`).
* - for non-hits closer than a minimum range (`nearDistance`),
* - for non-hits beyond a maximum range (`farDistance`).
* Concurrently, it computes the RGL_FIELD_XYZ_VEC3_F32 field for these non-hit scenarios based on these distances, along with ray origin and direction.
* @param node RaytraceNode to modify.
* @param near Distance value for non-hits closer than minimum range.
* @param far Distance value for non-hits beyond maximum range.
* @param nearDistance Distance value for non-hits closer than minimum range.
* @param farDistance Distance value for non-hits beyond maximum range.
*/
RGL_API rgl_status_t rgl_node_raytrace_configure_non_hits(rgl_node_t node, float near, float far);
RGL_API rgl_status_t rgl_node_raytrace_configure_non_hits(rgl_node_t node, float nearDistance, float farDistance);

/**
* Creates or modifies FormatPointsNode.
Expand Down
10 changes: 6 additions & 4 deletions src/api/apiCore.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -869,15 +869,17 @@ void TapeCore::tape_node_raytrace_configure_distortion(const YAML::Node& yamlNod
rgl_node_raytrace_configure_distortion(node, yamlNode[1].as<bool>());
}

RGL_API rgl_status_t rgl_node_raytrace_configure_non_hits(rgl_node_t node, float near, float far)
RGL_API rgl_status_t rgl_node_raytrace_configure_non_hits(rgl_node_t node, float nearDistance,
float farDistance)
{
auto status = rglSafeCall([&]() {
RGL_API_LOG("rgl_node_raytrace_configure_non_hits(node={}, near={}, far={})", repr(node), near, far);
RGL_API_LOG("rgl_node_raytrace_configure_non_hits(node={}, nearDistance={}, farDistance={})",
repr(node), nearDistance, farDistance);
CHECK_ARG(node != nullptr);
RaytraceNode::Ptr raytraceNode = Node::validatePtr<RaytraceNode>(node);
raytraceNode->setNonHitDistanceValues(near, far);
raytraceNode->setNonHitDistanceValues(nearDistance, farDistance);
});
TAPE_HOOK(node, near, far);
TAPE_HOOK(node, nearDistance, farDistance);
return status;
}

Expand Down
2 changes: 1 addition & 1 deletion src/graph/NodesCore.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -125,7 +125,7 @@ struct RaytraceNode : IPointsNode
// RaytraceNode specific
void setVelocity(const Vec3f& linearVelocity, const Vec3f& angularVelocity);
void enableRayDistortion(bool enabled) { doApplyDistortion = enabled; }
void setNonHitDistanceValues(float near, float far);
void setNonHitDistanceValues(float nearDistance, float farDistance);

private:
IRaysNode::Ptr raysNode;
Expand Down
6 changes: 3 additions & 3 deletions src/graph/RaytraceNode.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -172,8 +172,8 @@ void RaytraceNode::setVelocity(const Vec3f& linearVelocity, const Vec3f& angular
sensorAngularVelocityRPY = angularVelocity;
}

void RaytraceNode::setNonHitDistanceValues(float near, float far)
void RaytraceNode::setNonHitDistanceValues(float nearDistance, float farDistance)
{
nearNonHitDistance = near;
farNonHitDistance = far;
nearNonHitDistance = nearDistance;
farNonHitDistance = farDistance;
}

0 comments on commit 5317f9d

Please sign in to comment.