#pragma once#include"math3d.h"// tools for finding intersectionsstructRay{vec3dorigin;// origin of rayvec3ddirection;// direction of ray (must be unit vector!)};//-----------------------------------------------------------------------------structIntersection{vec3dpoint;// point of intersectionfloatr[2];// natural coordinatesintm_index;// index of item that was intersected (context dependent)intm_faceIndex;// index of face that was intersected (context dependent)};//-----------------------------------------------------------------------------structTriangle{vec3dr0;vec3dr1;vec3dr2;vec3dfn;// face normal};//-----------------------------------------------------------------------------structQuad{vec3dr0;vec3dr1;vec3dr2;vec3dr3;};//-----------------------------------------------------------------------------// Find intersection of a ray with a triangle// To evaluate the normal automatically, set evalNormal to true. Otherwise, the normal in Triangle is usedboolIntersectTriangle(constRay&ray,constTriangle&tri,Intersection&q,boolevalNormal=true);//-----------------------------------------------------------------------------// Find intersection of a ray with a quadboolIntersectQuad(constRay&ray,constQuad&quad,Intersection&q);boolFastIntersectQuad(constRay&ray,constQuad&quad,Intersection&q);