Rework new convex decomp into a physicsextensions stub package and fix havok and havok_tpv builds for darwin universal to utilize new vhacd stub (#4858)

master
Rye 2025-10-20 13:10:19 -04:00 committed by Hecklezz
parent b6ba43bed5
commit d63cb2052f
19 changed files with 771 additions and 109 deletions

View File

@ -1674,36 +1674,6 @@
<key>name</key>
<string>llphysicsextensions_source</string>
</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>
<map>
<key>platforms</key>

View File

@ -127,9 +127,6 @@ endif (USE_TRACY)
add_subdirectory(${LIBS_OPEN_PREFIX}llaudio)
add_subdirectory(${LIBS_OPEN_PREFIX}llappearance)
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}llcorehttp)
add_subdirectory(${LIBS_OPEN_PREFIX}llimage)
@ -139,6 +136,7 @@ add_subdirectory(${LIBS_OPEN_PREFIX}llinventory)
add_subdirectory(${LIBS_OPEN_PREFIX}llmath)
add_subdirectory(${LIBS_OPEN_PREFIX}llmeshoptimizer)
add_subdirectory(${LIBS_OPEN_PREFIX}llmessage)
add_subdirectory(${LIBS_OPEN_PREFIX}llphysicsextensionsos)
add_subdirectory(${LIBS_OPEN_PREFIX}llprimitive)
add_subdirectory(${LIBS_OPEN_PREFIX}llrender)
add_subdirectory(${LIBS_OPEN_PREFIX}llfilesystem)

View File

@ -22,22 +22,25 @@ if (HAVOK)
include(Havok)
use_prebuilt_binary(llphysicsextensions_source)
set(LLPHYSICSEXTENSIONS_SRC_DIR ${LIBS_PREBUILT_DIR}/llphysicsextensions/src)
target_link_libraries( llphysicsextensions_impl INTERFACE llphysicsextensions)
target_compile_definitions( llphysicsextensions_impl INTERFACE LL_HAVOK=1 )
if(DARWIN)
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
#target_link_libraries( llphysicsextensions_impl INTERFACE llphysicsextensions)
#target_link_libraries( llphysicsextensions_impl INTERFACE llphysicsextensionsstub)
else()
target_link_libraries( llphysicsextensions_impl INTERFACE llphysicsextensions)
target_compile_definitions( llphysicsextensions_impl INTERFACE LL_HAVOK=1 )
endif()
target_include_directories( llphysicsextensions_impl INTERFACE ${LIBS_PREBUILT_DIR}/include/llphysicsextensions)
elseif (HAVOK_TPV)
use_prebuilt_binary(llphysicsextensions_tpv)
if(WINDOWS)
target_link_libraries( llphysicsextensions_impl INTERFACE ${ARCH_PREBUILT_DIRS}/llphysicsextensions_tpv.lib)
else()
target_link_libraries( llphysicsextensions_impl INTERFACE ${ARCH_PREBUILT_DIRS}/libllphysicsextensions_tpv.a)
if (NOT DARWIN)
if(WINDOWS)
target_link_libraries( llphysicsextensions_impl INTERFACE ${ARCH_PREBUILT_DIRS}/llphysicsextensions_tpv.lib)
elseif(LINUX)
target_link_libraries( llphysicsextensions_impl INTERFACE ${ARCH_PREBUILT_DIRS}/libllphysicsextensions_tpv.a)
endif()
target_compile_definitions( llphysicsextensions_impl INTERFACE LL_HAVOK=1 )
endif()
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)
endif (HAVOK)
# <FS:ND> include paths for LLs version and ours are different.
#target_include_directories( llphysicsextensions_impl INTERFACE ${LIBS_PREBUILT_DIR}/include/llphysicsextensions)
# </FS:ND>
target_include_directories( llphysicsextensions_impl INTERFACE ${LIBS_PREBUILT_DIR}/include/llphysicsextensions)
endif ()

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,15 +66,18 @@ target_link_libraries(llprimitive
llxml
llcharacter
llrender
llphysicsextensions_impl
ll::colladadom
ll::glm
)
if (TARGET llconvexdecomposition)
if (HAVOK OR HAVOK_TPV)
target_link_libraries(llprimitive
llconvexdecomposition
)
llphysicsextensions_impl
)
else()
target_link_libraries(llprimitive
llphysicsextensionsos
)
endif ()
if(LINUX)

View File

@ -56,10 +56,6 @@ include(ColladaDom)
include(jemalloc)
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 (LLPHYSICSEXTENSIONS_SRC_DIR)
# </FS:ND>
if (HAVOK)
# When using HAVOK_TPV, the library is precompiled, so no need for this
@ -88,10 +84,6 @@ if (HAVOK)
endif()
endif ()
# <FS:ND>
endif (LLPHYSICSEXTENSIONS_SRC_DIR)
# </FS:ND>
set(viewer_SOURCE_FILES
# <Add FS includes below this line>
alfloaterregiontracker.cpp
@ -2506,12 +2498,10 @@ elseif (DARWIN)
PROPERTIES
RESOURCE Firestorm.xib
LINK_FLAGS_RELEASE "${LINK_FLAGS_RELEASE} -Xlinker -dead_strip"
#<FS:TS> Force the SDK version in the linked executable to be 10.12. This will fool
#<FS:TS> Force the SDK version in the linked executable to be 10.12. This will fool
# macOS into using the pre-Mojave display system, avoiding the blurry display that
# 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"
# <FS:TJ> We can only do these if building with Havok
)
if(HAVOK)
set_target_properties(${VIEWER_BINARY_NAME}
@ -2521,22 +2511,21 @@ elseif (DARWIN)
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${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_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) \
${ND_HACDCONVEXDECOMPOSITION_LIBRARY} \
${HACD_LIBRARY} \
${ND_PATHING_LIBRARY}"
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()
# </FS:TJ>
else (WINDOWS)
# Linux
set_target_properties(${VIEWER_BINARY_NAME}