From 1a17e19a610b598650624fb0ae3e67352f00e499 Mon Sep 17 00:00:00 2001 From: Andrey Kleshchev Date: Thu, 8 Jul 2021 20:29:28 +0300 Subject: DRTVWR-542 WIP #2 --- indra/llmeshoptimizer/llmeshoptimizer.cpp | 24 +++++++++++++++++++----- 1 file changed, 19 insertions(+), 5 deletions(-) (limited to 'indra/llmeshoptimizer/llmeshoptimizer.cpp') diff --git a/indra/llmeshoptimizer/llmeshoptimizer.cpp b/indra/llmeshoptimizer/llmeshoptimizer.cpp index c46fa8dcf3..02e97ef984 100644 --- a/indra/llmeshoptimizer/llmeshoptimizer.cpp +++ b/indra/llmeshoptimizer/llmeshoptimizer.cpp @@ -28,7 +28,6 @@ #include "meshoptimizer.h" - LLMeshOptimizer::LLMeshOptimizer() { // Todo: Looks like for memory management, we can add allocator and deallocator callbacks @@ -38,12 +37,27 @@ LLMeshOptimizer::LLMeshOptimizer() LLMeshOptimizer::~LLMeshOptimizer() { - } //static -U32 LLMeshOptimizer::simplifyModel() +U64 LLMeshOptimizer::simplify(U16 *destination, + const U16 *indices, + U64 index_count, + const LLVector4a *vertex_positions, + U64 vertex_count, + U64 target_index_count, + F32 target_error, + F32* result_error + ) { - LL_WARNS() << "NOT IMPLEMENTED" << LL_ENDL; - return 0; + return meshopt_simplify(destination, + indices, + index_count, + (const float*)vertex_positions, // verify that it is correct to convert to float + vertex_count, + sizeof(LLVector4a), // should be either 0 or 4 + target_index_count, + target_error, + result_error + ); } -- cgit v1.2.3