4#include "MRPch/MRBindingMacros.h"
6#if defined(__x86_64__) || defined(_M_X64)
8#elif defined(__aarch64__) || defined(_M_ARM64)
10#elif defined(__wasm_simd128__)
11#include <wasm_simd128.h>
40 dimZ = 2; dimX = 1; dimY = 0;
44 dimZ = 0; dimX = 1; dimY = 2;
52 dimZ = 1; dimX = 0; dimY = 2;
56 dimZ = 0; dimX = 1; dimY = 2;
65 dimZ = 1; dimX = 0; dimY = 2;
69 dimZ = 2; dimX = 0; dimY = 1;
82 dimZ = 0; dimX = 2; dimY = 1;
86 dimZ = 1; dimX = 2; dimY = 0;
94 dimZ = 2; dimX = 1; dimY = 0;
98 dimZ = 1; dimX = 2; dimY = 0;
107 dimZ = 0; dimX = 2; dimY = 1;
111 dimZ = 2; dimX = 0; dimY = 1;
140 sign.x = dir.
x >= T( 0 ) ? 1 : 0;
141 sign.y = dir.
y >= T( 0 ) ? 1 : 0;
142 sign.z = dir.
z >= T( 0 ) ? 1 : 0;
148 invDir.x = ( dir.
x == 0 ) ? std::numeric_limits<T>::max() : T( 1 ) / dir.
x;
149 invDir.y = ( dir.
y == 0 ) ? std::numeric_limits<T>::max() : T( 1 ) / dir.
y;
150 invDir.z = ( dir.
z == 0 ) ? std::numeric_limits<T>::max() : T( 1 ) / dir.
z;
156#if defined(__x86_64__) || defined(_M_X64)
158struct IntersectionPrecomputes<float>
182 ( dir.z == 0 ) ? std::numeric_limits<float>::max() : 1 / dir.z,
183 ( dir.y == 0 ) ? std::numeric_limits<float>::max() : 1 / dir.y,
184 ( dir.x == 0 ) ? std::numeric_limits<float>::max() : 1 / dir.x );
190#elif defined(__aarch64__) || defined(_M_ARM64)
193MR_BIND_IGNORE inline float32x4_t toFloat32x4(
float x,
float y,
float z,
float w )
195 const float a[4] = { x, y, z, w };
196 return vld1q_f32( a );
223 ( dir.x == 0 ) ? std::numeric_limits<float>::max() : 1 / dir.x,
224 ( dir.y == 0 ) ? std::numeric_limits<float>::max() : 1 / dir.y,
225 ( dir.z == 0 ) ? std::numeric_limits<float>::max() : 1 / dir.z,
232#elif defined(__wasm_simd128__)
257 ( dir.x == 0 ) ? std::numeric_limits<float>::max() : 1 / dir.x,
258 ( dir.y == 0 ) ? std::numeric_limits<float>::max() : 1 / dir.y,
259 ( dir.z == 0 ) ? std::numeric_limits<float>::max() : 1 / dir.z,
266 #pragma message("IntersectionPrecomputes<float>: no hardware optimized instructions")
void findMaxVectorDim(int &dimX, int &dimY, int &dimZ, const Vector3< T > &dir)
finds index of maximum axis and stores it into dimZ
Definition MRIntersectionPrecomputes.h:29
T x
Definition MRVector3.h:39
T y
Definition MRVector3.h:39
std::array< Vector3f, 3 > MR_BIND_IGNORE
Definition MRMeshBuilderTypes.h:13
T z
Definition MRVector3.h:39
only for bindings generation
Definition MRCameraOrientationPlugin.h:8
Definition MRIntersectionPrecomputes.h:121
MR_BIND_IGNORE Vector3i sign
stores signs of direction vector;
Definition MRIntersectionPrecomputes.h:131
int idxY
Definition MRIntersectionPrecomputes.h:128
MR_BIND_IGNORE Vector3< T > invDir
{1 / dir}
Definition MRIntersectionPrecomputes.h:123
T Sx
precomputed factors
Definition MRIntersectionPrecomputes.h:134
int idxX
Definition MRIntersectionPrecomputes.h:127
T Sz
Definition MRIntersectionPrecomputes.h:134
IntersectionPrecomputes()=default
IntersectionPrecomputes(const Vector3< T > &dir)
Definition MRIntersectionPrecomputes.h:136
T Sy
Definition MRIntersectionPrecomputes.h:134
int maxDimIdxZ
Definition MRIntersectionPrecomputes.h:126
Definition MRVector3.h:33