|
发表于 2020-3-2 12:18:00
|
显示全部楼层
湖北省武汉市
- 私有类:
- 不定长数组3 获取位置(64位不定类型变量 区块)
- {
- if (!区块) return Vector3{ 0.f, 0.f, 0.f };
- 定义结构体 索引34 { BYTE vec0[16]; BYTE vec1[16]; BYTE vec2[16]; };
- 定义 常量 __m128 mulVec0 = { -2.000, 2.000, -2.000, 0.000 };
- 定义 常量 __m128 mulVec1 = { 2.000, -2.000, -2.000, 0.000 };
- 定义 常量 __m128 mulVec2 = { -2.000, -2.000, 2.000, 0.000 };
- 整数变量 索引 = *(P整数变量)(区块 + 0x40);
- 64位不定类型变量 p区块Data = 带校验_read(区块 + 0x38, 64位不定类型变量);
- 64位不定类型变量 区块Data[2];
- 带校验_内存复制(&区块Data, (PVOID)(p区块Data + 0x18), 16);
- 大小_t 大小MatriciesBuf = 48 * 索引 + 48;
- 大小_t 大小IndicesBuf = 4 * 索引 + 4;
- 整数变量 pIndicesBuf[100];
- 索引34 pMatriciesBuf[1000];
-
- 带校验_内存复制(pMatriciesBuf, (PVOID)区块Data[0], 大小MatriciesBuf);
- 带校验_内存复制(pIndicesBuf, (PVOID)区块Data[1], 大小IndicesBuf);
-
- __m128 result = *(__m128*)((ULONGLONG)pMatriciesBuf + 0x30 * 索引);
- 整数变量 区块索引 = *(整数变量*)((ULONGLONG)pIndicesBuf + 0x4 * 索引);
-
- while (区块索引 >= 0)
- {
- 索引34 索引34 = *(索引34*)((ULONGLONG)pMatriciesBuf + 0x30 * 区块索引);
- __m128 xxxx = _mm_castsi128_ps(_mm_shuffle_epi32(*(__m128i*)(&索引34.vec1), 0x00));
- __m128 yyyy = _mm_castsi128_ps(_mm_shuffle_epi32(*(__m128i*)(&索引34.vec1), 0x55));
- __m128 zwxy = _mm_castsi128_ps(_mm_shuffle_epi32(*(__m128i*)(&索引34.vec1), 0x8E));
- __m128 wzyw = _mm_castsi128_ps(_mm_shuffle_epi32(*(__m128i*)(&索引34.vec1), 0xDB));
- __m128 zzzz = _mm_castsi128_ps(_mm_shuffle_epi32(*(__m128i*)(&索引34.vec1), 0xAA));
- __m128 yxwy = _mm_castsi128_ps(_mm_shuffle_epi32(*(__m128i*)(&索引34.vec1), 0x71));
- __m128 tmp7 = _mm_mul_ps(*(__m128*)(&索引34.vec2), result);
- result = _mm_add_ps(
- _mm_add_ps(
- _mm_add_ps(
- _mm_mul_ps(
- _mm_sub_ps(
- _mm_mul_ps(_mm_mul_ps(xxxx, mulVec1), zwxy),
- _mm_mul_ps(_mm_mul_ps(yyyy, mulVec2), wzyw)),
- _mm_castsi128_ps(_mm_shuffle_epi32(_mm_castps_si128(tmp7), 0xAA))),
- _mm_mul_ps(
- _mm_sub_ps(
- _mm_mul_ps(_mm_mul_ps(zzzz, mulVec2), wzyw),
- _mm_mul_ps(_mm_mul_ps(xxxx, mulVec0), yxwy)),
- _mm_castsi128_ps(_mm_shuffle_epi32(_mm_castps_si128(tmp7), 0x55)))),
- _mm_add_ps(
- _mm_mul_ps(
- _mm_sub_ps(
- _mm_mul_ps(_mm_mul_ps(yyyy, mulVec0), yxwy),
- _mm_mul_ps(_mm_mul_ps(zzzz, mulVec1), zwxy)),
- _mm_castsi128_ps(_mm_shuffle_epi32(_mm_castps_si128(tmp7), 0x00))),
- tmp7)), *(__m128*)(&索引34.vec0));
- 区块索引 = *(整数变量*)((ULONGLONG)pIndicesBuf + 0x4 * 区块索引);
- }
- return Vector3(result.m128_f32[0], result.m128_f32[1], result.m128_f32[2]);
- }
复制代码
伪代码 |
|