Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2026-04-09 07:48:52

0001 // ./csg_intersect_leaf_test.sh
0002 
0003 #include <cstdio>
0004 
0005 #include "ssys.h"
0006 #include "scuda.h"
0007 #include "squad.h"
0008 #include "sqat4.h"
0009 #include "csg_intersect_leaf.h"
0010 
0011 #include "CSGNode.h"
0012 
0013 void test_intersect_leaf_Sphere()
0014 {
0015     CSGNode nd = CSGNode::Sphere(100.f); 
0016 
0017     const CSGNode* node = &nd ; 
0018     const float4* plan = nullptr ; 
0019     const qat4* itra = nullptr ; 
0020     const float t_min = 0 ; 
0021 
0022     float3 ray_origin    = {0.f, 0.f, -50.f }; 
0023     float3 ray_direction = {0.f, 0.f, -1.f }; 
0024     float4 isect = {0.f, 0.f, 0.f, 0.f } ; 
0025 
0026     bool is = intersect_leaf(isect, node, plan, itra, t_min, ray_origin, ray_direction ); 
0027 
0028     printf("// is = %d ; isect = np.array([%10.5f,%10.5f,%10.5f,%10.5f]) \n", is, isect.x, isect.y, isect.z, isect.w ) ;  
0029 }
0030 
0031 int main()
0032 {
0033     test_intersect_leaf_Sphere() ; 
0034 
0035     return 0 ; 
0036 }