Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
25 changes: 9 additions & 16 deletions CSG/csg_intersect_leaf_newcone.h
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
#pragma once

/**
Expand Down Expand Up @@ -100,23 +100,16 @@
const float4 roots = make_float4( t_near, t_far, t_cap1, t_cap2 );
const float t_cand = fminf(roots) ;

Comment on lines 101 to 102
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

clang-format suggestion

Suggested change
const float t_cand = fminf(roots) ;
const float t_cand = fminf(roots) ;

valid_isect = t_cand > t_min && t_cand < RT_DEFAULT_MAX ;
if(valid_isect)
valid_isect = (t_cand > t_min && t_cand < RT_DEFAULT_MAX);
if (valid_isect)
{
if( t_cand == t_cap1 || t_cand == t_cap2 )
{
isect.x = 0.f ;
isect.y = 0.f ;
isect.z = t_cand == t_cap2 ? 1.f : -1.f ;
}
else
{
float3 n = normalize(make_float3( o.x+t_cand*d.x, o.y+t_cand*d.y, (z0-(o.z+t_cand*d.z))*tth2 )) ;
isect.x = n.x ;
isect.y = n.y ;
isect.z = n.z ;
}
isect.w = t_cand ;
float3 intersection_point = make_float3(o.x + t_cand * d.x, o.y + t_cand * d.y, o.z + t_cand * d.z);
float3 n = normalize(make_float3(intersection_point.x, intersection_point.y, (z0 - intersection_point.z)*tth2));
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

clang-format suggestion

Suggested change
float3 n = normalize(make_float3(intersection_point.x, intersection_point.y, (z0 - intersection_point.z)*tth2));
float3 n =
normalize(make_float3(intersection_point.x, intersection_point.y, (z0 - intersection_point.z) * tth2));


isect.x = n.x;
isect.y = n.y;
isect.z = n.z;
isect.w = t_cand;
}
}

Expand Down
Loading