1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 #pragma once19 20 #include "[MathBuildConfig.h]"21 #include "[Math/MathNamespace.h]"22 23 #include <stddef.h>24 25 26 27 #include <vector>28 29 30 31 32 33 34 #ifdef _MSC_VER35 #define CONST_WIN32 const36 #else37 #define CONST_WIN3238 #endif39 40 #ifdef _MSC_VER41 #define NAMELESS_UNION_BEGIN \42 __pragma(warning(push)) \43 __pragma(warning(disable:4201))44 45 #define NAMELESS_UNION_END \46 __pragma(warning(pop))47 48 #else49 50 #define NAMELESS_UNION_BEGIN union {51 #define NAMELESS_UNION_END };52 53 #endif54 55 #if !defined(MATH_ENABLE_STL_SUPPORT) && !defined(assert)56 #include <stdio.h>57 #define assert(x) do { if (!(x)) { printf("Error: assert(%s) failed!\n", #x); } } while(0)58 #endif59 60 [MATH_BEGIN_NAMESPACE]61 62 class [float2];63 class [float3];64 class [float4];65 class float2x2;66 class float2x3;67 class [float3x3];68 class [float3x4];69 class [float4x4];70 class [Quat];71 72 class [TranslateOp];73 class [ScaleOp];74 75 template<int N>76 class [PBVolume];77 78 class [AABB];79 class [Capsule];80 class [Circle];81 class Cone;82 class Cylinder;83 class Ellipsoid;84 class [Frustum];85 struct [HitInfo];86 class [Line];87 class [LineSegment];88 class [OBB];89 class [Plane];90 class [Polygon];91 class [Polyhedron];92 class [Polynomial];93 class [Quat];94 class [Ray];95 class [Sphere];96 class [TranslateOp];97 class Torus;98 class [ScaleOp];99 class [Triangle];100 class [LCG];101 102 struct [float4_storage];103 104 #define IS16ALIGNED(x) ((((uintptr_t)(x)) & 0xF) == 0)105 #define IS32ALIGNED(x) ((((uintptr_t)(x)) & 0x1F) == 0)106 #define IS64ALIGNED(x) ((((uintptr_t)(x)) & 0x3F) == 0)107 108 #ifdef MATH_SIMD109 110 #ifdef MATH_AVX111 #define ALIGN_MAT ALIGN32112 #define MAT_ALIGNMENT 32113 #define IS_MAT_ALIGNED(x) IS32ALIGNED(x)114 #else115 #define ALIGN_MAT ALIGN16116 #define MAT_ALIGNMENT 16117 #define IS_MAT_ALIGNED(x) IS16ALIGNED(x)118 #endif119 120 #ifdef _MSC_VER121 #define ALIGN16 __declspec(align(16))122 #define ALIGN32 __declspec(align(32))123 #define ALIGN64 __declspec(align(64))124 #else125 #define ALIGN16 __attribute__((aligned(16)))126 #define ALIGN32 __attribute__((aligned(32)))127 #define ALIGN64 __attribute__((aligned(64)))128 #endif129 130 #else131 132 #define ALIGN16133 #define ALIGN32134 #define ALIGN64135 #define ALIGN_MAT136 #define IS_MAT_ALIGNED(x) true137 138 #endif139 140 #ifdef MATH_AUTOMATIC_SSE141 142 #ifndef MATH_VEC_IS_FLOAT4143 #define MATH_VEC_IS_FLOAT4144 #endif145 146 typedef [ALIGN16] [float4] vec;147 typedef [float4_storage] [vec_storage];148 149 #else150 151 typedef [float3] vec;152 typedef [float3] [vec_storage];153 154 #endif155 156 template<class T, size_t Alignment>157 struct [AlignedAllocator];158 159 struct [Triangle_storage];160 struct [LineSegment_storage];161 162 163 #if defined(_MSC_VER) && _MSC_VER < 1800 164 typedef std::vector<Triangle_storage, AlignedAllocator<Triangle_storage, 16> > [TriangleArray];165 typedef std::vector<LineSegment_storage, AlignedAllocator<LineSegment_storage, 16> > [LineSegmentArray];166 typedef std::vector<float4_storage, AlignedAllocator<float4_storage, 16> > [Float4Array];167 #ifdef MATH_AUTOMATIC_SSE168 typedef std::vector<float4_storage, AlignedAllocator<float4_storage, 16> > [VecArray];169 #endif170 #else171 typedef std::vector<Triangle> [TriangleArray];172 typedef std::vector<LineSegment> [LineSegmentArray];173 typedef std::vector<float4> [Float4Array];174 #ifdef MATH_AUTOMATIC_SSE175 typedef std::vector<float4> [VecArray];176 #endif177 #endif178 179 #if !defined(MATH_AUTOMATIC_SSE)180 typedef std::vector<float3> [VecArray];181 #endif182 183 [MATH_END_NAMESPACE]184 185 #ifdef MATH_GRAPHICSENGINE_INTEROP186 class VertexBuffer;187 #endif188 189 #ifdef MATH_ENABLE_STL_SUPPORT190 #include <iosfwd>191 #endif Go back to previous page