# Conflicts:
#	.github/workflows/pre-commit.yaml
#	indra/cmake/LLPhysicsExtensions.cmake
#	indra/llwindow/llopenglview-objc.mm
#	indra/newview/CMakeLists.txt
#	indra/newview/llappdelegate-objc.mm
master
Ansariel 2025-10-20 23:56:48 +02:00
commit 431b3b0c6d
32 changed files with 1282 additions and 612 deletions

View File

@ -1,6 +1,7 @@
# Replace tabs with spaces # Replace tabs with spaces
1b68f71348ecf3983b76b40d7940da8377f049b7 1b68f71348ecf3983b76b40d7940da8377f049b7
33418a77b716e122da9778869cdbabe97c83ff37 33418a77b716e122da9778869cdbabe97c83ff37
6b974724826a038b0db794460b322eb4921da735
# Trim trailing whitespace # Trim trailing whitespace
a0b3021bdcf76859054fda8e30abb3ed47749e83 a0b3021bdcf76859054fda8e30abb3ed47749e83
8444cd9562a6a7b755fcb075864e205122354192 8444cd9562a6a7b755fcb075864e205122354192

7
.github/dependabot.yaml vendored Normal file
View File

@ -0,0 +1,7 @@
version: 2
updates:
- package-ecosystem: github-actions
directory: /
schedule:
interval: monthly

View File

@ -7,14 +7,14 @@ repos:
- id: no-trigraphs - id: no-trigraphs
- id: copyright - id: copyright
- id: end-of-file - id: end-of-file
files: \.(cpp|c|h|py|glsl|cmake|txt)$ files: \.(cpp|c|m|mm|h|py|glsl|cmake|txt)$
exclude: language.txt exclude: language.txt
- id: indent-with-spaces - id: indent-with-spaces
files: \.(cpp|c|h|inl|py|glsl|cmake)$ files: \.(cpp|c|m|mm|h|inl|py|glsl|cmake)$
- repo: https://github.com/pre-commit/pre-commit-hooks - repo: https://github.com/pre-commit/pre-commit-hooks
rev: v5.0.0 rev: v6.0.0
hooks: hooks:
- id: check-xml - id: check-xml
- id: mixed-line-ending - id: mixed-line-ending
- id: trailing-whitespace - id: trailing-whitespace
files: \.(cpp|c|h|inl|py|glsl|cmake|yaml|sh)$ files: \.(cpp|c|m|mm|h|inl|py|glsl|cmake|yaml|sh)$

View File

@ -1674,36 +1674,6 @@
<key>name</key> <key>name</key>
<string>llphysicsextensions_source</string> <string>llphysicsextensions_source</string>
</map> </map>
<key>llphysicsextensions_stub</key>
<map>
<key>platforms</key>
<map>
<key>common</key>
<map>
<key>archive</key>
<map>
<key>hash</key>
<string>bc41438b10ac6474cf5560465a3662a64f9e65a81342e4c33f18f6694581c7ee28c9ee6f091c36e80a0b1e10c68205be71eb5f8e40fef115d2c744fc2bbfcb43</string>
<key>hash_algorithm</key>
<string>blake2b</string>
<key>url</key>
<string>https://github.com/AlchemyViewer/llphysicsextensions_stub/releases/download/v1.0-cb4900e/llphysicsextensions_stub-1.0-common-17836965684.tar.zst</string>
</map>
<key>name</key>
<string>common</string>
</map>
</map>
<key>license</key>
<string>internal</string>
<key>license_file</key>
<string>LICENSES/llphysicsextensions.txt</string>
<key>copyright</key>
<string>Copyright (c) 2010, Linden Research, Inc.</string>
<key>version</key>
<string>1.0</string>
<key>name</key>
<string>llphysicsextensions_stub</string>
</map>
<key>llphysicsextensions_tpv</key> <key>llphysicsextensions_tpv</key>
<map> <map>
<key>platforms</key> <key>platforms</key>

View File

@ -128,9 +128,6 @@ endif (USE_TRACY)
add_subdirectory(${LIBS_OPEN_PREFIX}llaudio) add_subdirectory(${LIBS_OPEN_PREFIX}llaudio)
add_subdirectory(${LIBS_OPEN_PREFIX}llappearance) add_subdirectory(${LIBS_OPEN_PREFIX}llappearance)
add_subdirectory(${LIBS_OPEN_PREFIX}llcharacter) add_subdirectory(${LIBS_OPEN_PREFIX}llcharacter)
if (NOT HAVOK AND NOT HAVOK_TPV)
add_subdirectory(${LIBS_OPEN_PREFIX}llconvexdecomposition)
endif ()
add_subdirectory(${LIBS_OPEN_PREFIX}llcommon) add_subdirectory(${LIBS_OPEN_PREFIX}llcommon)
add_subdirectory(${LIBS_OPEN_PREFIX}llcorehttp) add_subdirectory(${LIBS_OPEN_PREFIX}llcorehttp)
add_subdirectory(${LIBS_OPEN_PREFIX}llimage) add_subdirectory(${LIBS_OPEN_PREFIX}llimage)
@ -140,6 +137,7 @@ add_subdirectory(${LIBS_OPEN_PREFIX}llinventory)
add_subdirectory(${LIBS_OPEN_PREFIX}llmath) add_subdirectory(${LIBS_OPEN_PREFIX}llmath)
add_subdirectory(${LIBS_OPEN_PREFIX}llmeshoptimizer) add_subdirectory(${LIBS_OPEN_PREFIX}llmeshoptimizer)
add_subdirectory(${LIBS_OPEN_PREFIX}llmessage) add_subdirectory(${LIBS_OPEN_PREFIX}llmessage)
add_subdirectory(${LIBS_OPEN_PREFIX}llphysicsextensionsos)
add_subdirectory(${LIBS_OPEN_PREFIX}llprimitive) add_subdirectory(${LIBS_OPEN_PREFIX}llprimitive)
add_subdirectory(${LIBS_OPEN_PREFIX}llrender) add_subdirectory(${LIBS_OPEN_PREFIX}llrender)
add_subdirectory(${LIBS_OPEN_PREFIX}llfilesystem) add_subdirectory(${LIBS_OPEN_PREFIX}llfilesystem)

View File

@ -22,7 +22,6 @@ if (HAVOK)
include(Havok) include(Havok)
use_prebuilt_binary(llphysicsextensions_source) use_prebuilt_binary(llphysicsextensions_source)
set(LLPHYSICSEXTENSIONS_SRC_DIR ${LIBS_PREBUILT_DIR}/llphysicsextensions/src) set(LLPHYSICSEXTENSIONS_SRC_DIR ${LIBS_PREBUILT_DIR}/llphysicsextensions/src)
target_compile_definitions( llphysicsextensions_impl INTERFACE LL_HAVOK=1 )
if(DARWIN) if(DARWIN)
set(LLPHYSICSEXTENSIONS_STUB_DIR ${LIBS_PREBUILT_DIR}/llphysicsextensions/stub) set(LLPHYSICSEXTENSIONS_STUB_DIR ${LIBS_PREBUILT_DIR}/llphysicsextensions/stub)
# can't set these library dependencies per-arch here, need to do it using XCODE_ATTRIBUTE_OTHER_LDFLAGS[arch=*] in newview/CMakeLists.txt # can't set these library dependencies per-arch here, need to do it using XCODE_ATTRIBUTE_OTHER_LDFLAGS[arch=*] in newview/CMakeLists.txt
@ -30,28 +29,18 @@ if (HAVOK)
#target_link_libraries( llphysicsextensions_impl INTERFACE llphysicsextensionsstub) #target_link_libraries( llphysicsextensions_impl INTERFACE llphysicsextensionsstub)
else() else()
target_link_libraries( llphysicsextensions_impl INTERFACE llphysicsextensions) target_link_libraries( llphysicsextensions_impl INTERFACE llphysicsextensions)
target_compile_definitions( llphysicsextensions_impl INTERFACE LL_HAVOK=1 )
endif() endif()
target_include_directories( llphysicsextensions_impl INTERFACE ${LIBS_PREBUILT_DIR}/include/llphysicsextensions)
elseif (HAVOK_TPV) elseif (HAVOK_TPV)
use_prebuilt_binary(llphysicsextensions_tpv) use_prebuilt_binary(llphysicsextensions_tpv)
if (NOT DARWIN)
if(WINDOWS) if(WINDOWS)
target_link_libraries( llphysicsextensions_impl INTERFACE ${ARCH_PREBUILT_DIRS}/llphysicsextensions_tpv.lib) target_link_libraries( llphysicsextensions_impl INTERFACE ${ARCH_PREBUILT_DIRS}/llphysicsextensions_tpv.lib)
else() elseif(LINUX)
target_link_libraries( llphysicsextensions_impl INTERFACE ${ARCH_PREBUILT_DIRS}/libllphysicsextensions_tpv.a) target_link_libraries( llphysicsextensions_impl INTERFACE ${ARCH_PREBUILT_DIRS}/libllphysicsextensions_tpv.a)
endif() endif()
target_compile_definitions( llphysicsextensions_impl INTERFACE LL_HAVOK=1 ) target_compile_definitions( llphysicsextensions_impl INTERFACE LL_HAVOK=1 )
else (HAVOK)
use_prebuilt_binary(llphysicsextensions_stub)
set(LLPHYSICSEXTENSIONS_SRC_DIR ${LIBS_PREBUILT_DIR}/llphysicsextensions/stub)
target_link_libraries( llphysicsextensions_impl INTERFACE llphysicsextensionsstub)
# <FS:Ansariel> Hotfix pathing lib header and add missing BOOL typedef
file(READ ${LIBS_PREBUILT_DIR}/include/llphysicsextensions/llpathinglib.h PATHINGLIB_HEADER_CONTENTS)
string(FIND "${PATHINGLIB_HEADER_CONTENTS}" "typedef int BOOL;" BOOL_TYPEDEF_POS)
if (${BOOL_TYPEDEF_POS} EQUAL -1)
string(REPLACE "typedef int bool32;" "typedef int bool32;\ntypedef int BOOL;" PATHINGLIB_HEADER_CONTENTS "${PATHINGLIB_HEADER_CONTENTS}")
file(WRITE ${LIBS_PREBUILT_DIR}/include/llphysicsextensions/llpathinglib.h "${PATHINGLIB_HEADER_CONTENTS}")
endif() endif()
# </FS:Ansariel>
endif (HAVOK)
target_include_directories( llphysicsextensions_impl INTERFACE ${LIBS_PREBUILT_DIR}/include/llphysicsextensions) target_include_directories( llphysicsextensions_impl INTERFACE ${LIBS_PREBUILT_DIR}/include/llphysicsextensions)
endif ()

View File

@ -283,6 +283,7 @@ bool LLPolyMeshSharedData::loadMesh( const std::string& fileName )
LLFILE* fp = LLFile::fopen(fileName, "rb"); /*Flawfinder: ignore*/ LLFILE* fp = LLFile::fopen(fileName, "rb"); /*Flawfinder: ignore*/
if (!fp) if (!fp)
{ {
LLError::LLUserWarningMsg::showMissingFiles();
LL_ERRS() << "can't open: " << fileName << LL_ENDL; LL_ERRS() << "can't open: " << fileName << LL_ENDL;
return false; return false;
} }

View File

@ -1,39 +0,0 @@
# -*- cmake -*-
project(llconvexdecomposition)
include(00-Common)
include(LLCommon)
include(LLMath)
include(VHACD)
set(llconvexdecomposition_SOURCE_FILES
llconvexdecomposition.cpp
llconvexdecompositionvhacd.cpp
)
set(llconvexdecomposition_HEADER_FILES
CMakeLists.txt
llconvexdecomposition.h
llconvexdecompositionvhacd.h
)
set_source_files_properties(${llconvexdecomposition_HEADER_FILES}
PROPERTIES HEADER_FILE_ONLY TRUE)
list(APPEND llconvexdecomposition_SOURCE_FILES ${llconvexdecomposition_HEADER_FILES})
add_library (llconvexdecomposition ${llconvexdecomposition_SOURCE_FILES})
target_include_directories(llconvexdecomposition INTERFACE ${CMAKE_CURRENT_SOURCE_DIR})
target_link_libraries(llconvexdecomposition
llcommon
llmath
ll::vhacd)
if(WINDOWS)
target_compile_options(llconvexdecomposition PRIVATE /bigobj)
endif()
# Add tests

View File

@ -0,0 +1,47 @@
# -*- cmake -*-
project(llphysicsextensionsos)
include(00-Common)
include(LLCommon)
include(LLMath)
include(VHACD)
set(llphysicsextensionsos_SOURCE_FILES
llconvexdecomposition.cpp
llconvexdecompositionvhacd.cpp
llpathinglib.cpp
LLPathingLibStubImpl.cpp
llphysicsextensions.cpp
LLPhysicsExtensionsStubImpl.cpp
)
set(llphysicsextensionsos_HEADER_FILES
CMakeLists.txt
llconvexdecomposition.h
llconvexdecompositionvhacd.h
llpathinglib.h
LLPathingLibStubImpl.h
llphysicsextensions.h
LLPhysicsExtensionsStubImpl.h
)
set_source_files_properties(${llphysicsextensionsos_HEADER_FILES}
PROPERTIES HEADER_FILE_ONLY TRUE)
list(APPEND llphysicsextensionsos_SOURCE_FILES ${llphysicsextensionsos_HEADER_FILES})
add_library (llphysicsextensionsos ${llphysicsextensionsos_SOURCE_FILES})
target_include_directories(llphysicsextensionsos INTERFACE ${CMAKE_CURRENT_SOURCE_DIR})
target_link_libraries(llphysicsextensionsos
llcommon
llmath
ll::vhacd)
if(WINDOWS)
target_compile_options(llphysicsextensionsos PRIVATE /bigobj)
endif()
# Add tests

View File

@ -0,0 +1,109 @@
/**
* @file LLPathingLibStubImpl.cpp
* @author prep@lindenlab.com
* @brief A stubbed implementation of LLPathingLib
*
* $LicenseInfo:firstyear=2012&license=viewerlgpl$
* Second Life Viewer Source Code
* Copyright (C) 20112010, Linden Research, Inc.
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation;
* version 2.1 of the License only.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this library; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*
* Linden Research, Inc., 945 Battery Street, San Francisco, CA 94111 USA
* $/LicenseInfo$
*/
#include "linden_common.h"
#include "llpathinglib.h"
#include "LLPathingLibStubImpl.h"
#include "llsd.h"
//=============================================================================
LLPathingLibImpl::LLPathingLibImpl()
{
}
LLPathingLibImpl::~LLPathingLibImpl()
{
}
LLPathingLib* LLPathingLibImpl::getInstance()
{
return NULL;
}
LLPathingLib::LLPLResult LLPathingLibImpl::initSystem()
{
return LLPL_NOT_IMPLEMENTED;
}
LLPathingLib::LLPLResult LLPathingLibImpl::quitSystem()
{
return LLPL_NOT_IMPLEMENTED;
}
LLPathingLib::LLPLResult LLPathingLibImpl::extractNavMeshSrcFromLLSD( const LLSD::Binary& dataBlock, int dir )
{
return LLPL_NOT_IMPLEMENTED;
}
void LLPathingLibImpl::processNavMeshData()
{
}
LLPathingLibImpl::LLPLResult LLPathingLibImpl::generatePath( const PathingPacket& pathingPacket )
{
return LLPL_NOT_IMPLEMENTED;
}
void LLPathingLibImpl::setNavMeshMaterialType( LLPLCharacterType materialType )
{
}
void LLPathingLibImpl::setNavMeshColors( const NavMeshColors& color )
{
}
void LLPathingLibImpl::renderNavMesh()
{
}
void LLPathingLibImpl::renderNavMeshEdges()
{
}
void LLPathingLibImpl::renderNavMeshShapesVBO( U32 shapeRenderFlags )
{
}
void LLPathingLibImpl::renderPath()
{
}
void LLPathingLibImpl::renderPathBookend( LLRender& gl, LLPathingLib::LLPLPathBookEnd type )
{
}
void LLPathingLibImpl::cleanupVBOManager()
{
}
void LLPathingLibImpl::cleanupResidual()
{
}

View File

@ -0,0 +1,78 @@
/**
* @file LLPathingLibSubImpl.h
* @author prep@lindenlab.com
* @brief A stubbed implementation of LLPathingLib
*
* $LicenseInfo:firstyear=2012&license=viewerlgpl$
* Second Life Viewer Source Code
* Copyright (C) 2012, Linden Research, Inc.
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation;
* version 2.1 of the License only.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this library; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*
* Linden Research, Inc., 945 Battery Street, San Francisco, CA 94111 USA
* $/LicenseInfo$
*/
#ifndef LL_PATHING_LIB_H
#define LL_PATHING_LIB_H
#include "llpathinglib.h"
class LLSD;
//=============================================================================
class LLPathingLibImpl : public LLPathingLib
{
public:
LLPathingLibImpl();
virtual ~LLPathingLibImpl();
// Obtain a pointer to the actual implementation
static LLPathingLib* getInstance();
static LLPathingLib::LLPLResult initSystem();
static LLPathingLib::LLPLResult quitSystem();
//Extract and store navmesh data from the llsd datablock sent down by the server
virtual LLPLResult extractNavMeshSrcFromLLSD( const LLSD::Binary& dataBlock, int dir );
//Stitch any stored navmeshes together
virtual void processNavMeshData();
//Method used to generate and visualize a path on the viewers navmesh
virtual LLPLResult generatePath( const PathingPacket& pathingPacket );
//Set the material type for the heatmap type
virtual void setNavMeshMaterialType( LLPLCharacterType materialType );
//Set the various navmesh colors
virtual void setNavMeshColors( const NavMeshColors& color );
//The entry method to rendering the client side navmesh
virtual void renderNavMesh();
//The entry method to rendering the client side navmesh edges
virtual void renderNavMeshEdges();
//The entry method to render the client navmesh shapes VBO
virtual void renderNavMeshShapesVBO( U32 shapeRenderFlags );
//The entry method to render the clients designated path
virtual void renderPath();
//The entry method to render the capsule bookends for the clients designated path
virtual void renderPathBookend( LLRender& gl, LLPathingLib::LLPLPathBookEnd type );
//Method to delete any vbo's that are currently being managed by the pathing library
virtual void cleanupVBOManager();
//Method to cleanup any allocations within the implementation
virtual void cleanupResidual();
};
#endif //LL_PATHING_LIB_H

View File

@ -0,0 +1,51 @@
/**
* @file LLPhysicsExtensionsStubImpl.cpp
* @author prep@lindenlab.com
* @brief A stubbed implementation of LLPhysicsExtensions
*
* $LicenseInfo:firstyear=2012&license=viewerlgpl$
* Second Life Viewer Source Code
* Copyright (C) 2012, Linden Research, Inc.
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation;
* version 2.1 of the License only.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this library; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*
* Linden Research, Inc., 945 Battery Street, San Francisco, CA 94111 USA
* $/LicenseInfo$
*/
#include "linden_common.h"
#include "llphysicsextensions.h"
#include "LLPhysicsExtensionsStubImpl.h"
//=============================================================================
LLPhysicsExtensionsImpl::LLPhysicsExtensionsImpl()
{
}
LLPhysicsExtensionsImpl::~LLPhysicsExtensionsImpl()
{
}
bool LLPhysicsExtensionsImpl::initSystem()
{
return false;
}
bool LLPhysicsExtensionsImpl::quitSystem()
{
return false;
}

View File

@ -0,0 +1,46 @@
/**
* @file LLPhysicsExtensionsSubImpl.h
* @author prep@lindenlab.com
* @brief A stubbed implementation of LLPhysicsExtensions
*
* $LicenseInfo:firstyear=2012&license=viewerlgpl$
* Second Life Viewer Source Code
* Copyright (C) 2012, Linden Research, Inc.
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation;
* version 2.1 of the License only.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this library; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*
* Linden Research, Inc., 945 Battery Street, San Francisco, CA 94111 USA
* $/LicenseInfo$
*/
#ifndef LL_PHYSICS_EXTENSIONS_STUB_IMPL_H
#define LL_PHYSICS_EXTENSIONS_STUB_IMPL_H
#include "llphysicsextensions.h"
//=============================================================================
class LLPhysicsExtensionsImpl : public LLPhysicsExtensions
{
public:
LLPhysicsExtensionsImpl();
virtual ~LLPhysicsExtensionsImpl();
static bool initSystem();
static bool quitSystem();
};
#endif //LL_PHYSICS_EXTENSIONS_STUB_IMPL_H

View File

@ -0,0 +1,83 @@
/**
* @file llpathinglib.cpp
* @author prep@lindenlab.com
* @brief LLPathingLib core creation methods
*
* $LicenseInfo:firstyear=2012&license=lgpl$
* Second Life Viewer Source Code
* Copyright (C) 2011, Linden Research, Inc.
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation;
* version 2.1 of the License only.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this library; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*
* Linden Research, Inc., 945 Battery Street, San Francisco, CA 94111 USA
* $/LicenseInfo$
*/
#include "linden_common.h"
#include "LLPathingLibStubImpl.h"
#include "llpathinglib.h"
//=============================================================================
/*static */bool LLPathingLib::s_isInitialized = false;
//=============================================================================
/*static*/bool LLPathingLib::isFunctional()
{
return false;
}
/*static*/LLPathingLib* LLPathingLib::getInstance()
{
if ( !s_isInitialized )
{
return NULL;
}
else
{
return LLPathingLibImpl::getInstance();
}
}
//=============================================================================
/*static */LLPathingLib::LLPLResult LLPathingLib::initSystem()
{
if ( LLPathingLibImpl::initSystem() == LLPL_OK )
{
s_isInitialized = true;
return LLPL_OK;
}
return LLPL_UNKOWN_ERROR;
}
//=============================================================================
/*static */LLPathingLib::LLPLResult LLPathingLib::quitSystem()
{
LLPLResult quitResult = LLPL_UNKOWN_ERROR;
if (s_isInitialized)
{
quitResult = LLPathingLibImpl::quitSystem();
s_isInitialized = false;
}
return quitResult;
}
//=============================================================================

View File

@ -0,0 +1,187 @@
/**
* @file llpathinglib.cpp
* @author prep@lindenlab.com
* @brief LLPathingLib interface definition
*
* $LicenseInfo:firstyear=2012&license=lgpl$
* Second Life Viewer Source Code
* Copyright (C) 2011, Linden Research, Inc.
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation;
* version 2.1 of the License only.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this library; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*
* Linden Research, Inc., 945 Battery Street, San Francisco, CA 94111 USA
* $/LicenseInfo$
*/
#ifndef LL_PATHING_LIBRARY
#define LL_PATHING_LIBRARY
#include "llpreprocessor.h"
#include "llsd.h"
#include "v3dmath.h"
#include "v4math.h"
#include "v4color.h"
#include "v4coloru.h"
#include "llphysicsextensions.h"
typedef int bool32;
#if defined(_WIN32) || defined(_WIN64)
#define LLCD_CALL __cdecl
#else
#define LLCD_CALL
#endif
class LLRender;
//=============================================================================
class LLPathingLib
{
public:
enum LLShapeType
{
LLST_WalkableObjects = 0,
LLST_ObstacleObjects,
LLST_MaterialPhantoms,
LLST_ExclusionPhantoms,
LLST_MaxShapeTypes = LLST_ExclusionPhantoms+1,
LLST_None = LLST_MaxShapeTypes+2,
LLST_SimpleBox = LLST_None+1,
LLST_SimpleCapsule = LLST_SimpleBox+1,
};
enum LLShapeTypeFlag
{
LLSTB_WalkableObjects = 0x1 << 1,
LLSTB_ObstacleObjects = 0x1 << 2,
LLSTB_MaterialPhantoms = 0x1 << 3,
LLSTB_ExclusionPhantoms = 0x1 << 4,
LLSTB_None = 0x1 << 5
};
enum LLPLPathBookEnd
{
LLPL_START = 0,
LLPL_END,
};
enum LLPLResult
{
LLPL_OK = 0,
LLPL_NOTSET,
LLPL_ERROR,
LLPL_NO_NAVMESH,
LLPL_UNKOWN_ERROR,
LLPL_NO_PATH,
LLPL_PATH_GENERATED_OK,
LLPL_NOT_IMPLEMENTED,
};
enum LLPLCharacterType
{
LLPL_CHARACTER_TYPE_A = 4,
LLPL_CHARACTER_TYPE_B = 3,
LLPL_CHARACTER_TYPE_C = 2,
LLPL_CHARACTER_TYPE_D = 1,
LLPL_CHARACTER_TYPE_NONE = 0
};
struct PathingPacket
{
PathingPacket() : mHasPointA(false), mHasPointB(false), mCharacterWidth(0.0f), mCharacterType(LLPL_CHARACTER_TYPE_NONE) {}
bool mHasPointA;
LLVector3 mStartPointA;
LLVector3 mEndPointA;
bool mHasPointB;
LLVector3 mStartPointB;
LLVector3 mEndPointB;
F32 mCharacterWidth;
LLPLCharacterType mCharacterType;
};
struct NavMeshColors
{
LLColor4U mWalkable;
LLColor4U mObstacle;
LLColor4U mMaterial;
LLColor4U mExclusion;
LLColor4U mConnectedEdge;
LLColor4U mBoundaryEdge;
LLColor4 mHeatColorBase;
LLColor4 mHeatColorMax;
LLColor4U mFaceColor;
LLColor4U mStarValid;
LLColor4U mStarInvalid;
LLColor4U mTestPath;
LLColor4U mWaterColor;
};
public:
//Ctor
LLPathingLib() {}
virtual ~LLPathingLib() {}
/// @returns false if this is the stub
static bool isFunctional();
// Obtain a pointer to the actual implementation
static LLPathingLib* getInstance();
static LLPathingLib::LLPLResult initSystem();
static LLPathingLib::LLPLResult quitSystem();
//Extract and store navmesh data from the llsd datablock sent down by the server
virtual LLPLResult extractNavMeshSrcFromLLSD( const LLSD::Binary& dataBlock, int dir ) = 0;
//Stitch any stored navmeshes together
virtual void processNavMeshData( ) = 0;
//Method used to generate and visualize a path on the viewers navmesh
virtual LLPLResult generatePath( const PathingPacket& pathingPacket ) = 0;
//Set the material type for the heatmap type
virtual void setNavMeshMaterialType( LLPLCharacterType materialType ) = 0;
//Set the various navmesh colors
virtual void setNavMeshColors( const NavMeshColors& color ) = 0;
//The entry method to rendering the client side navmesh
virtual void renderNavMesh() = 0;
//The entry method to rendering the client side navmesh edges
virtual void renderNavMeshEdges() = 0;
//The entry method to render the client navmesh shapes VBO
virtual void renderNavMeshShapesVBO( U32 shapeRenderFlags ) = 0;
//The entry method to render the clients designated path
virtual void renderPath() = 0;
//The entry method to render the capsule bookends for the clients designated path
virtual void renderPathBookend( LLRender& gl, LLPathingLib::LLPLPathBookEnd type ) = 0;
//Renders all of the generated simple shapes (using their default transforms)
virtual void renderSimpleShapes( LLRender& gl, F32 regionsWaterHeight ) = 0;
//Method called from second life to create a capsule from properties of a character
virtual void createPhysicsCapsuleRep( F32 length, F32 radius, bool horizontal, const LLUUID& id ) = 0;
//Removes any cached physics capsule using a list of cached uuids
virtual void cleanupPhysicsCapsuleRepResiduals() = 0;
//Renders a selected uuids physics rep
virtual void renderSimpleShapeCapsuleID( LLRender& gl, const LLUUID& id, const LLVector3& pos, const LLQuaternion& rot ) = 0;
//Method to delete any vbo's that are currently being managed by the pathing library
virtual void cleanupVBOManager( ) = 0;
//Method to cleanup any allocations within the implementation
virtual void cleanupResidual( ) = 0;
private:
static bool s_isInitialized;
};
#endif //LL_PATHING_LIBRARY

View File

@ -0,0 +1,78 @@
/**
* @file llphysicsextensions.cpp
* @author nyx@lindenlab.com
* @brief LLPhysicsExtensions core initialization methods
*
* $LicenseInfo:firstyear=2012&license=lgpl$
* Second Life Viewer Source Code
* Copyright (C) 2011, Linden Research, Inc.
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation;
* version 2.1 of the License only.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this library; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*
* Linden Research, Inc., 945 Battery Street, San Francisco, CA 94111 USA
* $/LicenseInfo$
*/
#include "linden_common.h"
#include "llphysicsextensions.h"
#include "LLPhysicsExtensionsStubImpl.h"
//disable the undefined symbol optimization
//#pragma warning (disable : 4221)
//=============================================================================
/*static */bool LLPhysicsExtensions::s_isInitialized = false;
/*static*/bool LLPhysicsExtensions::isFunctional()
{
return false;
}
//=============================================================================
/*static*/LLPhysicsExtensions* LLPhysicsExtensions::getInstance()
{
if ( !s_isInitialized )
{
return NULL;
}
else
{
return LLPhysicsExtensionsImpl::getInstance();
}
}
//=============================================================================
/*static */bool LLPhysicsExtensions::initSystem()
{
bool result = LLPhysicsExtensionsImpl::initSystem();
if ( result )
{
s_isInitialized = true;
}
return result;
}
//=============================================================================
/*static */bool LLPhysicsExtensions::quitSystem()
{
return LLPhysicsExtensionsImpl::quitSystem();
}
//=============================================================================

View File

@ -0,0 +1,59 @@
/**
* @file llphysicsextensions.h
* @author nyx@lindenlab.com
* @brief LLPhysicsExtensions core shared initialization
* routines
*
* $LicenseInfo:firstyear=2012&license=lgpl$
* Second Life Viewer Source Code
* Copyright (C) 2011, Linden Research, Inc.
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation;
* version 2.1 of the License only.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this library; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*
* Linden Research, Inc., 945 Battery Street, San Francisco, CA 94111 USA
* $/LicenseInfo$
*/
#ifndef LL_PHYSICS_EXTENSIONS
#define LL_PHYSICS_EXTENSIONS
#include "llpreprocessor.h"
#include "llsd.h"
#include "v3dmath.h"
#define LLPHYSICSEXTENSIONS_VERSION "1.0"
typedef int bool32;
class LLPhysicsExtensions
{
public:
// Obtain a pointer to the actual implementation
static LLPhysicsExtensions* getInstance();
/// @returns false if this is the stub
static bool isFunctional();
static bool initSystem();
static bool quitSystem();
private:
static bool s_isInitialized;
};
#endif //LL_PATHING_LIBRARY

View File

@ -66,14 +66,17 @@ target_link_libraries(llprimitive
llxml llxml
llcharacter llcharacter
llrender llrender
llphysicsextensions_impl
ll::colladadom ll::colladadom
ll::glm ll::glm
) )
if (TARGET llconvexdecomposition) if (HAVOK OR HAVOK_TPV)
target_link_libraries(llprimitive target_link_libraries(llprimitive
llconvexdecomposition llphysicsextensions_impl
)
else()
target_link_libraries(llprimitive
llphysicsextensionsos
) )
endif () endif ()

View File

@ -30,7 +30,7 @@
#import <Carbon/Carbon.h> #import <Carbon/Carbon.h>
extern BOOL gHiDPISupport; extern bool gHiDPISupport;
#pragma mark local functions #pragma mark local functions

View File

@ -56,11 +56,7 @@ include(ColladaDom)
include(jemalloc) include(jemalloc)
include(Discord) include(Discord)
# <FS:ND> if using ndPhysicsstub this variable will be unset, we don't need to build any stub code viewer side in that case if (HAVOK)
if (LLPHYSICSEXTENSIONS_SRC_DIR)
# </FS:ND>
if (NOT HAVOK_TPV)
# When using HAVOK_TPV, the library is precompiled, so no need for this # When using HAVOK_TPV, the library is precompiled, so no need for this
# Stub and probably havok lib itself is a hack, autobuild loads a 3p that really is a source tarball # Stub and probably havok lib itself is a hack, autobuild loads a 3p that really is a source tarball
@ -86,11 +82,7 @@ if (NOT HAVOK_TPV)
target_compile_options( llphysicsextensions PRIVATE -Wno-unused-local-typedef) target_compile_options( llphysicsextensions PRIVATE -Wno-unused-local-typedef)
endif (DARWIN) endif (DARWIN)
endif() endif()
endif (NOT HAVOK_TPV) endif ()
# <FS:ND>
endif (LLPHYSICSEXTENSIONS_SRC_DIR)
# </FS:ND>
set(viewer_SOURCE_FILES set(viewer_SOURCE_FILES
# <Add FS includes below this line> # <Add FS includes below this line>
@ -2511,20 +2503,30 @@ elseif (DARWIN)
# otherwise occurs when upscaling the viewer to Retina resolution levels. # otherwise occurs when upscaling the viewer to Retina resolution levels.
LINK_FLAGS_RELEASE "${LINK_FLAGS_RELEASE} -Xlinker -platform_version -Xlinker macos -Xlinker ${CMAKE_OSX_DEPLOYMENT_TARGET} -Xlinker 10.12" LINK_FLAGS_RELEASE "${LINK_FLAGS_RELEASE} -Xlinker -platform_version -Xlinker macos -Xlinker ${CMAKE_OSX_DEPLOYMENT_TARGET} -Xlinker 10.12"
# <FS:TJ> We can only do these if building with Havok
) )
if(HAVOK OR HAVOK_TPV) if(HAVOK)
set_target_properties(${VIEWER_BINARY_NAME} set_target_properties(${VIEWER_BINARY_NAME}
PROPERTIES PROPERTIES
# arch specific flags for universal builds: https://stackoverflow.com/a/77942065 # arch specific flags for universal builds: https://stackoverflow.com/a/77942065
XCODE_ATTRIBUTE_OTHER_CFLAGS[arch=x86_64] "$(inherited) -DLLPHYSICSEXTENSIONS_USE_FULL" XCODE_ATTRIBUTE_OTHER_CFLAGS[arch=x86_64] "$(inherited) -DLLPHYSICSEXTENSIONS_USE_FULL -DLL_HAVOK=1"
XCODE_ATTRIBUTE_OTHER_CFLAGS[arch=arm64] "$(inherited) -DLLPHYSICSEXTENSIONS_USE_STUB" XCODE_ATTRIBUTE_OTHER_CFLAGS[arch=arm64] "$(inherited) -DLLPHYSICSEXTENSIONS_USE_STUB"
# only generate the .MAP file for llphysicsextensions_tpv on x86_64 # only generate the .MAP file for llphysicsextensions_tpv on x86_64
XCODE_ATTRIBUTE_OTHER_LDFLAGS[arch=x86_64] "$(inherited) -L${CMAKE_CURRENT_BINARY_DIR}/llphysicsextensions/$<IF:$<BOOL:${LL_GENERATOR_IS_MULTI_CONFIG}>,$<CONFIG>,${CMAKE_CFG_INTDIR}>/ -lllphysicsextensions -Xlinker -map -Xlinker ${CMAKE_CURRENT_BINARY_DIR}/${VIEWER_BINARY_NAME}.MAP" XCODE_ATTRIBUTE_OTHER_LDFLAGS[arch=x86_64] "$(inherited) -L${CMAKE_CURRENT_BINARY_DIR}/llphysicsextensions/$<IF:$<BOOL:${LL_GENERATOR_IS_MULTI_CONFIG}>,$<CONFIG>,${CMAKE_CFG_INTDIR}>/ -lllphysicsextensions -Xlinker -map -Xlinker ${CMAKE_CURRENT_BINARY_DIR}/${VIEWER_BINARY_NAME}.MAP"
XCODE_ATTRIBUTE_OTHER_LDFLAGS[arch=arm64] "$(inherited) -L${CMAKE_CURRENT_BINARY_DIR}/llphysicsextensionsstub/$<IF:$<BOOL:${LL_GENERATOR_IS_MULTI_CONFIG}>,$<CONFIG>,${CMAKE_CFG_INTDIR}>/ -lllphysicsextensionsstub" XCODE_ATTRIBUTE_OTHER_LDFLAGS[arch=arm64] "$(inherited) -L${CMAKE_BINARY_DIR}/llphysicsextensionsos/$<IF:$<BOOL:${LL_GENERATOR_IS_MULTI_CONFIG}>,$<CONFIG>,${CMAKE_CFG_INTDIR}>/ -lllphysicsextensionsos"
) )
elseif(HAVOK_TPV)
set_target_properties(${VIEWER_BINARY_NAME}
PROPERTIES
# arch specific flags for universal builds: https://stackoverflow.com/a/77942065
XCODE_ATTRIBUTE_OTHER_CFLAGS[arch=x86_64] "$(inherited) -DLLPHYSICSEXTENSIONS_USE_FULL -DLL_HAVOK=1"
XCODE_ATTRIBUTE_OTHER_CFLAGS[arch=arm64] "$(inherited) -DLLPHYSICSEXTENSIONS_USE_STUB"
# only generate the .MAP file for llphysicsextensions_tpv on x86_64
XCODE_ATTRIBUTE_OTHER_LDFLAGS[arch=x86_64] "$(inherited) -L${ARCH_PREBUILT_DIRS}/ -lllphysicsextensions_tpv"
XCODE_ATTRIBUTE_OTHER_LDFLAGS[arch=arm64] "$(inherited) -L${CMAKE_BINARY_DIR}/llphysicsextensionsos/$<IF:$<BOOL:${LL_GENERATOR_IS_MULTI_CONFIG}>,$<CONFIG>,${CMAKE_CFG_INTDIR}>/ -lllphysicsextensionsos"
)
else()
target_link_libraries(${VIEWER_BINARY_NAME} llphysicsextensionsos)
endif() endif()
# </FS:TJ>
else (WINDOWS) else (WINDOWS)
# Linux # Linux
set_target_properties(${VIEWER_BINARY_NAME} set_target_properties(${VIEWER_BINARY_NAME}

View File

@ -5263,7 +5263,7 @@ void LLRiggedVolume::update(
else else
{ {
face_begin = face_index; face_begin = face_index;
face_end = face_begin + 1; face_end = llmin(face_begin + 1, volume->getNumVolumeFaces());
} }
for (S32 i = face_begin; i < face_end; ++i) for (S32 i = face_begin; i < face_end; ++i)
{ {

View File

@ -70,7 +70,7 @@ def process_directory(directory, extensions, tab_stop):
def main(): def main():
parser = argparse.ArgumentParser(description='Convert tabs to spaces in files, considering tab stops.') parser = argparse.ArgumentParser(description='Convert tabs to spaces in files, considering tab stops.')
parser.add_argument('-e', '--extensions', type=str, default='c,cpp,h,hpp,inl,py,glsl,cmake', help='Comma-separated list of file extensions to process (default: "c,cpp,h,hpp,inl,py,glsl,cmake")') parser.add_argument('-e', '--extensions', type=str, default='c,cpp,m,mm,h,hpp,inl,py,glsl,cmake', help='Comma-separated list of file extensions to process (default: "c,cpp,h,hpp,inl,py,glsl,cmake")')
parser.add_argument('-t', '--tabstop', type=int, default=4, help='Tab stop size (default: 4)') parser.add_argument('-t', '--tabstop', type=int, default=4, help='Tab stop size (default: 4)')
parser.add_argument('-d', '--directory', type=str, required=True, help='Directory to process') parser.add_argument('-d', '--directory', type=str, required=True, help='Directory to process')