求大老指教下 C转火山 一直报错
本帖最后由 暗香 于 2023-2-22 16:44 编辑vector3 取坐标(uint64_t transform)
{
vector3 ret_value;
uint64_t matrix_list_base = 0;
uint64_t dependency_index_table_base = 0;
uint64_t transform_internal = transform;
uint64_t matrices = 0;
读写::读字节集(transform_internal + 0x38, &matrices, 8);
if (matrices == 0)
return ret_value;
int index = 0;
读写::读字节集(transform_internal + 0x40, &index, 4);
读写::读字节集(matrices + 0x18, &matrix_list_base, 8);
if (matrix_list_base == 0)
return ret_value;
读写::读字节集(matrices + 0x20, &dependency_index_table_base, 8);
if (dependency_index_table_base == 0)
return ret_value;
int index_relation = 0;
读写::读字节集(dependency_index_table_base + index * 4, &index_relation, 4);
float base_matrix3x4,
* matrix3x4_buffer0 = (float*)((uint64_t)base_matrix3x4 + 16),
* matrix3x4_buffer1 = (float*)((uint64_t)base_matrix3x4 + 32),
* matrix3x4_buffer2 = (float*)((uint64_t)base_matrix3x4 + 48);
读写::读字节集(matrix_list_base + index * 0x30, base_matrix3x4, 0x10);
__m128 xmmword_1410D1340 = { -2.f, 2.f, -2.f, 0.f };
__m128 xmmword_1410D1350 = { 2.f, -2.f, -2.f, 0.f };
__m128 xmmword_1410D1360 = { -2.f, -2.f, 2.f, 0.f };
int time = 0;
ULONG matrix_relation_index = 6 * index_relation;
读写::读字节集(matrix_list_base + 8 * matrix_relation_index, matrix3x4_buffer2, 0x10);
__m128 v_0 = *(__m128*)matrix3x4_buffer2;
读写::读字节集(matrix_list_base + 8 * matrix_relation_index + 32, matrix3x4_buffer0, 0x10);
__m128 v_1 = *(__m128*)matrix3x4_buffer0;
读写::读字节集(matrix_list_base + 8 * matrix_relation_index + 16, matrix3x4_buffer1, 0x10);
__m128i v9 = *(__m128i*)matrix3x4_buffer1;
__m128* v3 = (__m128*)base_matrix3x4;
__m128 v10, v11, v12, v13, v14, v15, v16, v17;
v10 = _mm_mul_ps(v_1, *v3);
v11 = _mm_castsi128_ps(_mm_shuffle_epi32(v9, 0));
v12 = _mm_castsi128_ps(_mm_shuffle_epi32(v9, 85));
v13 = _mm_castsi128_ps(_mm_shuffle_epi32(v9, 142));
v14 = _mm_castsi128_ps(_mm_shuffle_epi32(v9, 219));
v15 = _mm_castsi128_ps(_mm_shuffle_epi32(v9, 170));
v16 = _mm_castsi128_ps(_mm_shuffle_epi32(v9, 113));
v17 = _mm_add_ps(_mm_add_ps(_mm_add_ps(_mm_mul_ps(_mm_sub_ps(_mm_mul_ps(_mm_mul_ps(v11, xmmword_1410D1350), v13), _mm_mul_ps(_mm_mul_ps(v12, xmmword_1410D1360), v14)),
_mm_castsi128_ps(_mm_shuffle_epi32(_mm_castps_si128(v10), 170))), _mm_mul_ps(_mm_sub_ps(_mm_mul_ps(_mm_mul_ps(v15, xmmword_1410D1360), v14),
_mm_mul_ps(_mm_mul_ps(v11, xmmword_1410D1340), v16)), _mm_castsi128_ps(_mm_shuffle_epi32(_mm_castps_si128(v10), 85)))),
_mm_add_ps(_mm_mul_ps(_mm_sub_ps(_mm_mul_ps(_mm_mul_ps(v12, xmmword_1410D1340), v16), _mm_mul_ps(_mm_mul_ps(v15, xmmword_1410D1350), v13)),
_mm_castsi128_ps(_mm_shuffle_epi32(_mm_castps_si128(v10), 0))), v10)), v_0);
*v3 = v17;
读写::读字节集(dependency_index_table_base + index_relation * 4, &index_relation, sizeof(index_relation));
ret_value.x = base_matrix3x4;
ret_value.y = base_matrix3x4;
ret_value.z = base_matrix3x4;
return ret_value;
}
有没有大老帮忙转一下 万分感谢
页:
[1]