1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 #pragma once19 20 #include "../MathGeoLibFwd.h"21 #include "../Math/float3.h"22 #include "[Triangle.h]"23 24 [MATH_BEGIN_NAMESPACE]25 26 27 28 class [TriangleMesh]29 {30 public:31 [TriangleMesh]();32 [~TriangleMesh]();33 34 [TriangleMesh](const [TriangleMesh] &rhs);35 [TriangleMesh] &[operator =](const [TriangleMesh] &rhs);36 37 38 39 40 void [Set](const float *triangleMesh, int numTriangles, int vertexSizeBytes);41 void [Set](const [float3] *triangleMesh, int numTriangles) { [Set](reinterpret_cast<const float *>(triangleMesh), numTriangles, sizeof([float3])); }42 void [Set](const [Triangle] *triangleMesh, int numTriangles) { [Set](reinterpret_cast<const float *>(triangleMesh), numTriangles, sizeof([Triangle])/3); }43 44 void [Set](const [Polyhedron] &polyhedron);45 46 float [IntersectRay](const [Ray] &ray) const;47 float [IntersectRay_TriangleIndex](const [Ray] &ray, int &outTriangleIndex) const;48 float [IntersectRay_TriangleIndex_UV](const [Ray] &ray, int &outTriangleIndex, float &outU, float &outV) const;49 50 void [SetAoS](const float *vertexData, int numTriangles, int vertexSizeBytes);51 void [SetSoA4](const float *vertexData, int numTriangles, int vertexSizeBytes);52 void [SetSoA8](const float *vertexData, int numTriangles, int vertexSizeBytes);53 54 float [IntersectRay_TriangleIndex_UV_CPP](const [Ray] &ray, int &outTriangleIndex, float &outU, float &outV) const;55 56 #ifdef MATH_SSE257 float IntersectRay_SSE2(const [Ray] &ray) const;58 float IntersectRay_TriangleIndex_SSE2(const [Ray] &ray, int &outTriangleIndex) const;59 float IntersectRay_TriangleIndex_UV_SSE2(const [Ray] &ray, int &outTriangleIndex, float &outU, float &outV) const;60 #endif61 62 #ifdef MATH_SSE4163 float IntersectRay_SSE41(const [Ray] &ray) const;64 float IntersectRay_TriangleIndex_SSE41(const [Ray] &ray, int &outTriangleIndex) const;65 float IntersectRay_TriangleIndex_UV_SSE41(const [Ray] &ray, int &outTriangleIndex, float &outU, float &outV) const;66 #endif67 68 #ifdef MATH_AVX69 float IntersectRay_AVX(const [Ray] &ray) const;70 float IntersectRay_TriangleIndex_AVX(const [Ray] &ray, int &outTriangleIndex) const;71 float IntersectRay_TriangleIndex_UV_AVX(const [Ray] &ray, int &outTriangleIndex, float &outU, float &outV) const;72 #endif73 74 private:75 float *data; 76 int numTriangles;77 int vertexSizeBytes;78 #ifdef _DEBUG79 int vertexDataLayout; 80 #endif81 void ReallocVertexBuffer(int numTriangles, int vertexSizeBytes);82 };83 84 [MATH_END_NAMESPACE] Go back to previous page