Skip to content

Commit b6355d6

Browse files
committed
Initial VHACD based llconvexdecomposition and autobuild package
1 parent 25756df commit b6355d6

18 files changed

+1421
-55
lines changed

autobuild.xml

Lines changed: 39 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -1352,41 +1352,19 @@
13521352
<map>
13531353
<key>platforms</key>
13541354
<map>
1355-
<key>darwin64</key>
1356-
<map>
1357-
<key>archive</key>
1358-
<map>
1359-
<key>hash</key>
1360-
<string>f290b000b31f9e36f2489946cbc99f5e</string>
1361-
<key>url</key>
1362-
<string>http://automated-builds-secondlife-com.s3.amazonaws.com/ct2/59995/563653/llphysicsextensions_stub-1.0.542456-darwin64-542456.tar.bz2</string>
1363-
</map>
1364-
<key>name</key>
1365-
<string>darwin64</string>
1366-
</map>
1367-
<key>linux64</key>
1368-
<map>
1369-
<key>archive</key>
1370-
<map>
1371-
<key>hash</key>
1372-
<string>711f4ec769e4b5f59ba25ee43c11bcbc</string>
1373-
<key>url</key>
1374-
<string>http://automated-builds-secondlife-com.s3.amazonaws.com/ct2/4724/14846/llphysicsextensions_stub-1.0.504712-linux64-504712.tar.bz2</string>
1375-
</map>
1376-
<key>name</key>
1377-
<string>linux64</string>
1378-
</map>
1379-
<key>windows64</key>
1355+
<key>common</key>
13801356
<map>
13811357
<key>archive</key>
13821358
<map>
13831359
<key>hash</key>
1384-
<string>2e5f1f7046a49d8b0bc295aa878116bc</string>
1360+
<string>bc41438b10ac6474cf5560465a3662a64f9e65a81342e4c33f18f6694581c7ee28c9ee6f091c36e80a0b1e10c68205be71eb5f8e40fef115d2c744fc2bbfcb43</string>
1361+
<key>hash_algorithm</key>
1362+
<string>blake2b</string>
13851363
<key>url</key>
1386-
<string>http://automated-builds-secondlife-com.s3.amazonaws.com/ct2/60043/564063/llphysicsextensions_stub-1.0.542456-windows-542456.tar.bz2</string>
1364+
<string>https://github.com/AlchemyViewer/llphysicsextensions_stub/releases/download/v1.0-cb4900e/llphysicsextensions_stub-1.0-common-17836965684.tar.zst</string>
13871365
</map>
13881366
<key>name</key>
1389-
<string>windows64</string>
1367+
<string>common</string>
13901368
</map>
13911369
</map>
13921370
<key>license</key>
@@ -1396,7 +1374,7 @@
13961374
<key>copyright</key>
13971375
<string>Copyright (c) 2010, Linden Research, Inc.</string>
13981376
<key>version</key>
1399-
<string>1.0.542456</string>
1377+
<string>1.0</string>
14001378
<key>name</key>
14011379
<string>llphysicsextensions_stub</string>
14021380
</map>
@@ -2765,6 +2743,38 @@ Copyright (c) 2012, 2014, 2015, 2016 nghttp2 contributors</string>
27652743
<key>description</key>
27662744
<string>Alchemy Branding Material</string>
27672745
</map>
2746+
<key>vhacd</key>
2747+
<map>
2748+
<key>platforms</key>
2749+
<map>
2750+
<key>common</key>
2751+
<map>
2752+
<key>archive</key>
2753+
<map>
2754+
<key>hash</key>
2755+
<string>140d8fc952a10edb5f2d72ab405336019ef32cadfa64f0cfce76c9de4bc6268cbc87cc8cd89d3417fb78b531d441701afc8d016bafe4bd275df2707f7daf1387</string>
2756+
<key>hash_algorithm</key>
2757+
<string>blake2b</string>
2758+
<key>url</key>
2759+
<string>https://github.com/AlchemyViewer/3p-vhacd/releases/download/v4.1.0-r2/vhacd-4.1.0-r2-common-18166921729.tar.zst</string>
2760+
</map>
2761+
<key>name</key>
2762+
<string>common</string>
2763+
</map>
2764+
</map>
2765+
<key>license</key>
2766+
<string>BSD</string>
2767+
<key>license_file</key>
2768+
<string>LICENSES/vhacd.txt</string>
2769+
<key>copyright</key>
2770+
<string>Copyright (c) 2011, Khaled Mamou</string>
2771+
<key>version</key>
2772+
<string>4.1.0-r2</string>
2773+
<key>name</key>
2774+
<string>vhacd</string>
2775+
<key>description</key>
2776+
<string>Voxelized Hierarchical Approximate Convex Decomposition</string>
2777+
</map>
27682778
</map>
27692779
<key>package_description</key>
27702780
<map>

indra/CMakeLists.txt

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -86,6 +86,9 @@ endif ()
8686
add_subdirectory(${LIBS_OPEN_PREFIX}llaudio)
8787
add_subdirectory(${LIBS_OPEN_PREFIX}llappearance)
8888
add_subdirectory(${LIBS_OPEN_PREFIX}llcharacter)
89+
if (NOT HAVOK AND NOT HAVOK_TPV)
90+
add_subdirectory(${LIBS_OPEN_PREFIX}llconvexdecomposition)
91+
endif ()
8992
add_subdirectory(${LIBS_OPEN_PREFIX}llcommon)
9093
add_subdirectory(${LIBS_OPEN_PREFIX}llcorehttp)
9194
add_subdirectory(${LIBS_OPEN_PREFIX}llimage)

indra/cmake/CMakeLists.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -66,6 +66,7 @@ set(cmake_SOURCE_FILES
6666
UI.cmake
6767
UnixInstall.cmake
6868
Variables.cmake
69+
VHACD.cmake
6970
ViewerMiscLibs.cmake
7071
VisualLeakDetector.cmake
7172
LibVLCPlugin.cmake

indra/cmake/LLPhysicsExtensions.cmake

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,9 +23,15 @@ if (HAVOK)
2323
use_prebuilt_binary(llphysicsextensions_source)
2424
set(LLPHYSICSEXTENSIONS_SRC_DIR ${LIBS_PREBUILT_DIR}/llphysicsextensions/src)
2525
target_link_libraries( llphysicsextensions_impl INTERFACE llphysicsextensions)
26+
target_compile_definitions( llphysicsextensions_impl INTERFACE LL_HAVOK=1 )
2627
elseif (HAVOK_TPV)
2728
use_prebuilt_binary(llphysicsextensions_tpv)
28-
target_link_libraries( llphysicsextensions_impl INTERFACE llphysicsextensions_tpv)
29+
if(WINDOWS)
30+
target_link_libraries( llphysicsextensions_impl INTERFACE ${ARCH_PREBUILT_DIRS}/llphysicsextensions_tpv.lib)
31+
else()
32+
target_link_libraries( llphysicsextensions_impl INTERFACE ${ARCH_PREBUILT_DIRS}/libllphysicsextensions_tpv.a)
33+
endif()
34+
target_compile_definitions( llphysicsextensions_impl INTERFACE LL_HAVOK=1 )
2935
else (HAVOK)
3036
use_prebuilt_binary(llphysicsextensions_stub)
3137
set(LLPHYSICSEXTENSIONS_SRC_DIR ${LIBS_PREBUILT_DIR}/llphysicsextensions/stub)

indra/cmake/VHACD.cmake

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
# -*- cmake -*-
2+
include(Prebuilt)
3+
4+
add_library(ll::vhacd INTERFACE IMPORTED)
5+
6+
use_system_binary(vhacd)
7+
use_prebuilt_binary(vhacd)
8+
9+
target_include_directories(ll::vhacd SYSTEM INTERFACE ${LIBS_PREBUILT_DIR}/include/vhacd/)
Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
# -*- cmake -*-
2+
3+
project(llconvexdecomposition)
4+
5+
include(00-Common)
6+
include(LLCommon)
7+
include(LLMath)
8+
include(VHACD)
9+
10+
set(llconvexdecomposition_SOURCE_FILES
11+
llconvexdecomposition.cpp
12+
llconvexdecompositionvhacd.cpp
13+
)
14+
15+
set(llconvexdecomposition_HEADER_FILES
16+
CMakeLists.txt
17+
llconvexdecomposition.h
18+
llconvexdecompositionvhacd.h
19+
)
20+
21+
set_source_files_properties(${llconvexdecomposition_HEADER_FILES}
22+
PROPERTIES HEADER_FILE_ONLY TRUE)
23+
24+
list(APPEND llconvexdecomposition_SOURCE_FILES ${llconvexdecomposition_HEADER_FILES})
25+
26+
add_library (llconvexdecomposition ${llconvexdecomposition_SOURCE_FILES})
27+
target_include_directories( llconvexdecomposition INTERFACE ${CMAKE_CURRENT_SOURCE_DIR})
28+
29+
target_link_libraries(llconvexdecomposition
30+
llcommon
31+
llmath
32+
ll::vhacd
33+
meshoptimizer)
34+
35+
if (USE_PRECOMPILED_HEADERS)
36+
target_precompile_headers(llconvexdecomposition REUSE_FROM llprecompiled)
37+
endif ()
38+
39+
if(WINDOWS)
40+
target_compile_options(llconvexdecomposition PRIVATE /bigobj)
41+
endif()
42+
43+
# Add tests
44+
Lines changed: 81 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,81 @@
1+
/**
2+
* @file llconvexdecomposition.cpp
3+
4+
* @brief Inner implementation of LLConvexDecomposition interface
5+
*
6+
* $LicenseInfo:firstyear=2011&license=lgpl$
7+
* Second Life Viewer Source Code
8+
* Copyright (C) 2011, Linden Research, Inc.
9+
*
10+
* This library is free software; you can redistribute it and/or
11+
* modify it under the terms of the GNU Lesser General Public
12+
* License as published by the Free Software Foundation;
13+
* version 2.1 of the License only.
14+
*
15+
* This library is distributed in the hope that it will be useful,
16+
* but WITHOUT ANY WARRANTY; without even the implied warranty of
17+
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
18+
* Lesser General Public License for more details.
19+
*
20+
* You should have received a copy of the GNU Lesser General Public
21+
* License along with this library; if not, write to the Free Software
22+
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
23+
*
24+
* Linden Research, Inc., 945 Battery Street, San Francisco, CA 94111 USA
25+
* $/LicenseInfo$
26+
*/
27+
28+
#include "llconvexdecompositionvhacd.h"
29+
#include "llconvexdecomposition.h"
30+
31+
bool LLConvexDecomposition::s_isInitialized = false;
32+
33+
// static
34+
bool LLConvexDecomposition::isFunctional()
35+
{
36+
return LLConvexDecompositionVHACD::isFunctional();
37+
}
38+
39+
// static
40+
LLConvexDecomposition* LLConvexDecomposition::getInstance()
41+
{
42+
if ( !s_isInitialized )
43+
{
44+
return nullptr;
45+
}
46+
else
47+
{
48+
return LLConvexDecompositionVHACD::getInstance();
49+
}
50+
}
51+
52+
// static
53+
LLCDResult LLConvexDecomposition::initSystem()
54+
{
55+
LLCDResult result = LLConvexDecompositionVHACD::initSystem();
56+
if ( result == LLCD_OK )
57+
{
58+
s_isInitialized = true;
59+
}
60+
return result;
61+
}
62+
63+
// static
64+
LLCDResult LLConvexDecomposition::initThread()
65+
{
66+
return LLConvexDecompositionVHACD::initThread();
67+
}
68+
69+
// static
70+
LLCDResult LLConvexDecomposition::quitThread()
71+
{
72+
return LLConvexDecompositionVHACD::quitThread();
73+
}
74+
75+
// static
76+
LLCDResult LLConvexDecomposition::quitSystem()
77+
{
78+
return LLConvexDecompositionVHACD::quitSystem();
79+
}
80+
81+

0 commit comments

Comments
 (0)