summaryrefslogtreecommitdiff
path: root/indra/llmath
diff options
context:
space:
mode:
Diffstat (limited to 'indra/llmath')
-rw-r--r--indra/llmath/CMakeLists.txt24
-rw-r--r--indra/llmath/llcalcparser.h38
-rw-r--r--indra/llmath/llvolume.cpp2
3 files changed, 23 insertions, 41 deletions
diff --git a/indra/llmath/CMakeLists.txt b/indra/llmath/CMakeLists.txt
index 4617309606..eb29df245a 100644
--- a/indra/llmath/CMakeLists.txt
+++ b/indra/llmath/CMakeLists.txt
@@ -4,16 +4,9 @@ project(llmath)
include(00-Common)
include(LLCommon)
-include(LLMeshOptimizer)
include(bugsplat)
include(Boost)
-include_directories(
- ${LLCOMMON_INCLUDE_DIRS}
- ${LLCOMMON_SYSTEM_INCLUDE_DIRS}
- ${LLMESHOPTIMIZER_INCLUDE_DIRS}
- )
-
set(llmath_SOURCE_FILES
llbbox.cpp
llbboxlocal.cpp
@@ -102,17 +95,12 @@ set(llmath_HEADER_FILES
xform.h
)
-set_source_files_properties(${llmath_HEADER_FILES}
- PROPERTIES HEADER_FILE_ONLY TRUE)
-
list(APPEND llmath_SOURCE_FILES ${llmath_HEADER_FILES})
add_library (llmath ${llmath_SOURCE_FILES})
-target_link_libraries(llmath
- ${LLCOMMON_LIBRARIES}
- ${LLMESHOPTIMIZER_LIBRARIES}
- )
+target_link_libraries(llmath llcommon llmeshoptimizer)
+target_include_directories( llmath INTERFACE ${CMAKE_CURRENT_SOURCE_DIR})
# Add tests
if (LL_TESTS)
@@ -127,15 +115,11 @@ if (LL_TESTS)
v4color.cpp
v4coloru.cpp
)
- set_source_files_properties(
- ${llmath_TEST_SOURCE_FILES}
- PROPERTIES
- LL_TEST_ADDITIONAL_LIBRARIES "${BOOST_THREAD_LIBRARY}"
- )
+
LL_ADD_PROJECT_UNIT_TESTS(llmath "${llmath_TEST_SOURCE_FILES}")
# INTEGRATION TESTS
- set(test_libs llmath llcommon ${LLCOMMON_LIBRARIES} ${WINDOWS_LIBRARIES})
+ set(test_libs llmath llcommon)
# TODO: Some of these need refactoring to be proper Unit tests rather than Integration tests.
LL_ADD_INTEGRATION_TEST(alignment "" "${test_libs}")
LL_ADD_INTEGRATION_TEST(llbbox llbbox.cpp "${test_libs}")
diff --git a/indra/llmath/llcalcparser.h b/indra/llmath/llcalcparser.h
index e2388d6702..dff5bf3af3 100644
--- a/indra/llmath/llcalcparser.h
+++ b/indra/llmath/llcalcparser.h
@@ -81,28 +81,28 @@ struct LLCalcParser : grammar<LLCalcParser>
;
unary_func =
- ((str_p("SIN") >> '(' >> expression[unary_func.value = bind(&LLCalcParser::_sin)(self,arg1)]) |
- (str_p("COS") >> '(' >> expression[unary_func.value = bind(&LLCalcParser::_cos)(self,arg1)]) |
- (str_p("TAN") >> '(' >> expression[unary_func.value = bind(&LLCalcParser::_tan)(self,arg1)]) |
- (str_p("ASIN") >> '(' >> expression[unary_func.value = bind(&LLCalcParser::_asin)(self,arg1)]) |
- (str_p("ACOS") >> '(' >> expression[unary_func.value = bind(&LLCalcParser::_acos)(self,arg1)]) |
- (str_p("ATAN") >> '(' >> expression[unary_func.value = bind(&LLCalcParser::_atan)(self,arg1)]) |
- (str_p("SQRT") >> '(' >> expression[unary_func.value = bind(&LLCalcParser::_sqrt)(self,arg1)]) |
- (str_p("LOG") >> '(' >> expression[unary_func.value = bind(&LLCalcParser::_log)(self,arg1)]) |
- (str_p("EXP") >> '(' >> expression[unary_func.value = bind(&LLCalcParser::_exp)(self,arg1)]) |
- (str_p("ABS") >> '(' >> expression[unary_func.value = bind(&LLCalcParser::_fabs)(self,arg1)]) |
- (str_p("FLR") >> '(' >> expression[unary_func.value = bind(&LLCalcParser::_floor)(self,arg1)]) |
- (str_p("CEIL") >> '(' >> expression[unary_func.value = bind(&LLCalcParser::_ceil)(self,arg1)])
+ ((str_p("SIN") >> '(' >> expression[unary_func.value = phoenix::bind(&LLCalcParser::_sin)(self,arg1)]) |
+ (str_p("COS") >> '(' >> expression[unary_func.value = phoenix::bind(&LLCalcParser::_cos)(self,arg1)]) |
+ (str_p("TAN") >> '(' >> expression[unary_func.value = phoenix::bind(&LLCalcParser::_tan)(self,arg1)]) |
+ (str_p("ASIN") >> '(' >> expression[unary_func.value = phoenix::bind(&LLCalcParser::_asin)(self,arg1)]) |
+ (str_p("ACOS") >> '(' >> expression[unary_func.value = phoenix::bind(&LLCalcParser::_acos)(self,arg1)]) |
+ (str_p("ATAN") >> '(' >> expression[unary_func.value = phoenix::bind(&LLCalcParser::_atan)(self,arg1)]) |
+ (str_p("SQRT") >> '(' >> expression[unary_func.value = phoenix::bind(&LLCalcParser::_sqrt)(self,arg1)]) |
+ (str_p("LOG") >> '(' >> expression[unary_func.value = phoenix::bind(&LLCalcParser::_log)(self,arg1)]) |
+ (str_p("EXP") >> '(' >> expression[unary_func.value = phoenix::bind(&LLCalcParser::_exp)(self,arg1)]) |
+ (str_p("ABS") >> '(' >> expression[unary_func.value = phoenix::bind(&LLCalcParser::_fabs)(self,arg1)]) |
+ (str_p("FLR") >> '(' >> expression[unary_func.value = phoenix::bind(&LLCalcParser::_floor)(self,arg1)]) |
+ (str_p("CEIL") >> '(' >> expression[unary_func.value = phoenix::bind(&LLCalcParser::_ceil)(self,arg1)])
) >> assert_syntax(ch_p(')'))
;
binary_func =
((str_p("ATAN2") >> '(' >> expression[binary_func.value = arg1] >> ',' >>
- expression[binary_func.value = bind(&LLCalcParser::_atan2)(self, binary_func.value, arg1)]) |
+ expression[binary_func.value = phoenix::bind(&LLCalcParser::_atan2)(self, binary_func.value, arg1)]) |
(str_p("MIN") >> '(' >> expression[binary_func.value = arg1] >> ',' >>
- expression[binary_func.value = bind(&LLCalcParser::_min)(self, binary_func.value, arg1)]) |
+ expression[binary_func.value = phoenix::bind(&LLCalcParser::_min)(self, binary_func.value, arg1)]) |
(str_p("MAX") >> '(' >> expression[binary_func.value = arg1] >> ',' >>
- expression[binary_func.value = bind(&LLCalcParser::_max)(self, binary_func.value, arg1)])
+ expression[binary_func.value = phoenix::bind(&LLCalcParser::_max)(self, binary_func.value, arg1)])
) >> assert_syntax(ch_p(')'))
;
@@ -118,10 +118,10 @@ struct LLCalcParser : grammar<LLCalcParser>
// Lookup throws an Unknown Symbol error if it is unknown, while this works fine,
// would be "neater" to handle symbol lookup from here with an assertive parser.
// constants_p[factor.value = arg1]|
- identifier[factor.value = bind(&LLCalcParser::lookup)(self, arg1, arg2)]
+ identifier[factor.value = phoenix::bind(&LLCalcParser::lookup)(self, arg1, arg2)]
) >>
// Detect and throw math errors.
- assert_domain(eps_p(bind(&LLCalcParser::checkNaN)(self, factor.value)))
+ assert_domain(eps_p(phoenix::bind(&LLCalcParser::checkNaN)(self, factor.value)))
;
unary_expr =
@@ -131,14 +131,14 @@ struct LLCalcParser : grammar<LLCalcParser>
power =
unary_expr[power.value = arg1] >>
- *('^' >> assert_syntax(unary_expr[power.value = bind(&powf)(power.value, arg1)]))
+ *('^' >> assert_syntax(unary_expr[power.value = phoenix::bind(&powf)(power.value, arg1)]))
;
term =
power[term.value = arg1] >>
*(('*' >> assert_syntax(power[term.value *= arg1])) |
('/' >> assert_syntax(power[term.value /= arg1])) |
- ('%' >> assert_syntax(power[term.value = bind(&fmodf)(term.value, arg1)]))
+ ('%' >> assert_syntax(power[term.value = phoenix::bind(&fmodf)(term.value, arg1)]))
)
;
diff --git a/indra/llmath/llvolume.cpp b/indra/llmath/llvolume.cpp
index 40f7b1e9fb..1879ff2a05 100644
--- a/indra/llmath/llvolume.cpp
+++ b/indra/llmath/llvolume.cpp
@@ -5482,14 +5482,12 @@ bool LLVolumeFace::cacheOptimize()
new_indices.push_back(tri->mVertex[2]->mIdx);
tri->complete();
- U32 breaks = 0;
for (U32 i = 1; i < mNumIndices/3; ++i)
{
cache.updateScores();
tri = cache.mBestTriangle;
if (!tri)
{
- breaks++;
for (U32 j = 0; j < triangle_data.size(); ++j)
{
if (triangle_data[j].mActive)