Initial work.

This commit is contained in:
Drake Arconis
2013-01-06 03:59:38 -05:00
parent cadf654fae
commit 9c1237ca05
14 changed files with 285 additions and 149 deletions

View File

@@ -36,6 +36,7 @@ set(cmake_SOURCE_FILES
FMOD.cmake
FMODEX.cmake
FreeType.cmake
GLOD.cmake
GStreamer010Plugin.cmake
GooglePerfTools.cmake
Hunspell.cmake
@@ -54,6 +55,7 @@ set(cmake_SOURCE_FILES
LLMessage.cmake
LLPlugin.cmake
LLPrimitive.cmake
LLPhysicsExtensions.cmake
LLQtWebkit.cmake
LLRender.cmake
LLScene.cmake

9
indra/cmake/GLOD.cmake Normal file
View File

@@ -0,0 +1,9 @@
# -*- cmake -*-
include(Prebuilt)
if (NOT STANDALONE)
use_prebuilt_binary(GLOD)
endif (NOT STANDALONE)
set(GLOD_INCLUDE_DIR ${LIBS_PREBUILT_DIR}/${LL_ARCH_DIR}/include)
set(GLOD_LIBRARIES glod)

View File

@@ -0,0 +1,10 @@
# -*- cmake -*-
include(Prebuilt)
use_prebuilt_binary(ndPhysicsStub)
set(LLPHYSICSEXTENSIONS_LIBRARIES nd_hacdConvexDecomposition hacd nd_Pathing )
set(LLPHYSICSEXTENSIONS_INCLUDE_DIRS ${LIBS_PREBUILT_DIR}/${LL_ARCH_DIR}/include/ )

View File

@@ -1,7 +1,33 @@
# -*- cmake -*-
# these should be moved to their own cmake file
include(Prebuilt)
use_prebuilt_binary(colladadom)
use_prebuilt_binary(pcre)
use_prebuilt_binary(libxml)
set(LLPRIMITIVE_INCLUDE_DIRS
${LIBS_OPEN_DIR}/llprimitive
)
if (WINDOWS)
set(LLPRIMITIVE_LIBRARIES
debug llprimitive
optimized llprimitive
debug libcollada14dom22-d
optimized libcollada14dom22
debug libboost_filesystem-mt-gd
optimized libboost_filesystem-mt
debug libboost_system-mt-gd
optimized libboost_system-mt
)
else (WINDOWS)
set(LLPRIMITIVE_LIBRARIES
llprimitive
collada14dom
minizip
xml2
pcrecpp
pcre
)
endif (WINDOWS)
set(LLPRIMITIVE_LIBRARIES llprimitive)

View File

@@ -7,12 +7,16 @@ include(LLCommon)
include(LLMath)
include(LLMessage)
include(LLXML)
include(LLPhysicsExtensions)
include_directories(
${LLCOMMON_INCLUDE_DIRS}
${LLMATH_INCLUDE_DIRS}
${LLMESSAGE_INCLUDE_DIRS}
${LLXML_INCLUDE_DIRS}
${LLPHYSICSEXTENSIONS_INCLUDE_DIRS}
${LIBS_PREBUILT_DIR}/${LL_ARCH_DIR}/include/collada
${LIBS_PREBUILT_DIR}/${LL_ARCH_DIR}/include/collada/1.4
)
set(llprimitive_SOURCE_FILES

View File

@@ -28,18 +28,21 @@
#include "llmodel.h"
#include "llmemory.h"
#if MESH_IMPORT
#include "llconvexdecomposition.h"
#endif //MESH_IMPORT
#include "llsdserialize.h"
#include "llvector4a.h"
#if MESH_IMPORT
#if LL_MSVC
#pragma warning (disable : 4263)
#pragma warning (disable : 4264)
#endif
#include "dae.h"
#include "dae/daeErrorHandler.h"
#include "dom/domConstants.h"
#include "dom/domMesh.h"
#endif //MESH_IMPORT
#if LL_MSVC
#pragma warning (default : 4263)
#pragma warning (default : 4264)
#endif
#ifdef LL_STANDALONE
# include <zlib.h>
@@ -72,13 +75,10 @@ LLModel::~LLModel()
{
if (mDecompID >= 0)
{
#if MESH_IMPORT
LLConvexDecomposition::getInstance()->deleteDecomposition(mDecompID);
#endif //MESH_IMPORT
}
}
#if MESH_IMPORT
bool get_dom_sources(const domInputLocalOffset_Array& inputs, S32& pos_offset, S32& tc_offset, S32& norm_offset, S32 &idx_stride,
domSource* &pos_source, domSource* &tc_source, domSource* &norm_source)
@@ -823,7 +823,6 @@ BOOL LLModel::createVolumeFacesFromDomMesh(domMesh* mesh)
return FALSE;
}
#endif //MESH_IMPORT
void LLModel::offsetMesh( const LLVector3& pivotPoint )
{
@@ -1294,8 +1293,6 @@ void LLModel::generateNormals(F32 angle_cutoff)
}
}
#if MESH_IMPORT
//static
std::string LLModel::getElementLabel(daeElement *element)
{ // try to get a decent label for this element
@@ -1351,7 +1348,6 @@ LLModel* LLModel::loadModelFromDomMesh(domMesh *mesh)
ret->mLabel = getElementLabel(mesh);
return ret;
}
#endif //MESH_IMPORT
std::string LLModel::getName() const
{
@@ -1540,6 +1536,7 @@ LLSD LLModel::writeModel(
mdl[model_names[idx]][i]["TexCoord0Domain"]["Max"] = max_tc.getValue();
mdl[model_names[idx]][i]["TexCoord0"] = tc;
}
mdl[model_names[idx]][i]["TriangleList"] = indices;
if (skinning)

View File

@@ -32,10 +32,8 @@
#include "v4math.h"
#include "m4math.h"
#if MESH_IMPORT
class daeElement;
class domMesh;
#endif //MESH_IMPORT
#define MAX_MODEL_FACES 8
@@ -147,10 +145,8 @@ public:
LLSD& mdl,
BOOL nowrite = FALSE, BOOL as_slm = FALSE);
#if MESH_IMPORT
static LLModel* loadModelFromDomMesh(domMesh* mesh);
static std::string getElementLabel(daeElement* element);
#endif //MESH_IMPORT
std::string getName() const;
std::string getMetric() const {return mMetric;}
EModelStatus getStatus() const {return mStatus;}
@@ -278,10 +274,8 @@ public:
EModelStatus mStatus ;
protected:
#if MESH_IMPORT
void addVolumeFacesFromDomMesh(domMesh* mesh);
virtual BOOL createVolumeFacesFromDomMesh(domMesh *mesh);
#endif //MESH_IMPORT
};
#endif //LL_LLMODEL_H

View File

@@ -155,7 +155,8 @@ bool LLPrimitive::cleanupVolumeManager()
LLPrimitive::LLPrimitive()
: mTextureList(),
mNumTEs(0),
mMiscFlags(0)
mMiscFlags(0),
mNumBumpmapTEs(0)
{
mPrimitiveCode = 0;
@@ -243,7 +244,10 @@ void LLPrimitive::setAllTETextures(const LLUUID &tex_id)
//===============================================================
void LLPrimitive::setTE(const U8 index, const LLTextureEntry& te)
{
mTextureList.copyTexture(index, te);
if(mTextureList.copyTexture(index, te) != TEM_CHANGE_NONE && te.getBumpmap() > 0)
{
mNumBumpmapTEs++;
}
}
S32 LLPrimitive::setTETexture(const U8 index, const LLUUID &id)
@@ -322,6 +326,7 @@ S32 LLPrimitive::setTERotation(const U8 index, const F32 r)
//===============================================================
S32 LLPrimitive::setTEBumpShinyFullbright(const U8 index, const U8 bump)
{
updateNumBumpmap(index, bump);
return mTextureList.setBumpShinyFullbright(index, bump);
}
@@ -332,11 +337,13 @@ S32 LLPrimitive::setTEMediaTexGen(const U8 index, const U8 media)
S32 LLPrimitive::setTEBumpmap(const U8 index, const U8 bump)
{
updateNumBumpmap(index, bump);
return mTextureList.setBumpMap(index, bump);
}
S32 LLPrimitive::setTEBumpShiny(const U8 index, const U8 bump_shiny)
{
updateNumBumpmap(index, bump_shiny);
return mTextureList.setBumpShiny(index, bump_shiny);
}
@@ -1451,6 +1458,26 @@ void LLPrimitive::takeTextureList(LLPrimTextureList& other_list)
mTextureList.take(other_list);
}
void LLPrimitive::updateNumBumpmap(const U8 index, const U8 bump)
{
LLTextureEntry* te = getTE(index);
if(!te)
{
return;
}
U8 old_bump = te->getBumpmap();
if(old_bump > 0)
{
mNumBumpmapTEs--;
}
if((bump & TEM_BUMP_MASK) > 0)
{
mNumBumpmapTEs++;
}
return;
}
//============================================================================
// Moved from llselectmgr.cpp

View File

@@ -427,6 +427,7 @@ public:
inline BOOL isAvatar() const;
inline BOOL isSittingAvatar() const;
inline BOOL isSittingAvatarOnGround() const;
inline bool hasBumpmap() const { return mNumBumpmapTEs > 0;}
void setFlags(U32 flags) { mMiscFlags = flags; }
void addFlags(U32 flags) { mMiscFlags |= flags; }
@@ -441,6 +442,9 @@ public:
inline static BOOL isPrimitive(const LLPCode pcode);
inline static BOOL isApp(const LLPCode pcode);
private:
void updateNumBumpmap(const U8 index, const U8 bump);
protected:
LLPCode mPrimitiveCode; // Primitive code
LLVector3 mVelocity; // how fast are we moving?
@@ -450,8 +454,10 @@ protected:
LLPrimTextureList mTextureList; // list of texture GUIDs, scales, offsets
U8 mMaterial; // Material code
U8 mNumTEs; // # of faces on the primitve
U8 mNumBumpmapTEs; // number of bumpmap TEs.
U32 mMiscFlags; // home for misc bools
public:
static LLVolumeMgr* sVolumeManager;
};

View File

@@ -27,8 +27,8 @@ include(LLImageJ2COJ)
include(LLInventory)
include(LLMath)
include(LLMessage)
include(LLPhysicsExtensions)
include(LLPlugin)
include(StateMachine)
include(LLPrimitive)
include(LLRender)
include(LLUI)
@@ -39,6 +39,7 @@ include(LLXML)
include(Linking)
include(NDOF)
include(GooglePerfTools)
include(StateMachine)
include(TemplateCheck)
include(UI)
include(LLKDU)
@@ -63,6 +64,7 @@ include_directories(
${LLINVENTORY_INCLUDE_DIRS}
${LLMATH_INCLUDE_DIRS}
${LLMESSAGE_INCLUDE_DIRS}
${LLPHYSICSEXTENSIONS_INCLUDE_DIRS}
${LLPLUGIN_INCLUDE_DIRS}
${LLPRIMITIVE_INCLUDE_DIRS}
${LLRENDER_INCLUDE_DIRS}
@@ -1586,6 +1588,7 @@ target_link_libraries(${VIEWER_BINARY_NAME}
${XMLRPCEPI_LIBRARIES}
${ELFIO_LIBRARIES}
${HUNSPELL_LIBRARY}
${LLPHYSICSEXTENSIONS_LIBRARIES}
)
if (LINUX)

View File

@@ -65,6 +65,8 @@
#include "llinventorymodel.h"
#include "llfoldertype.h"
#include "llviewerparcelmgr.h"
#include "llassetuploadresponders.h"
#include "lluploadfloaterobservers.h"
#include "aicurl.h"
#include "boost/lexical_cast.hpp"
@@ -316,7 +318,6 @@ public:
virtual AIHTTPTimeoutPolicy const& getHTTPTimeoutPolicy(void) const { return meshPhysicsShapeResponder_timeout; }
};
#if MESH_IMPORT
void log_upload_error(S32 status, const LLSD& content, std::string stage, std::string model_name)
{
// Add notification popup.
@@ -377,7 +378,20 @@ public:
mModelData(model_data),
mObserverHandle(observer_handle)
{
if (mThread)
{
mThread->startRequest();
}
}
~LLWholeModelFeeResponder()
{
if (mThread)
{
mThread->stopRequest();
}
}
virtual void completed(U32 status,
const std::string& reason,
const LLSD& content)
@@ -388,12 +402,11 @@ public:
cc = llsd_from_file("fake_upload_error.xml");
}
mThread->mPendingUploads--;
dump_llsd_to_file(cc,make_dump_name("whole_model_fee_response_",dump_num));
LLWholeModelFeeObserver* observer = mObserverHandle.get();
if (isGoodStatus(status) &&
if (((200 <= status) && (status < 300)) &&
cc["state"].asString() == "upload")
{
mThread->mWholeModelUploadURL = cc["uploader"].asString();
@@ -432,7 +445,20 @@ public:
mModelData(model_data),
mObserverHandle(observer_handle)
{
if (mThread)
{
mThread->startRequest();
}
}
~LLWholeModelUploadResponder()
{
if (mThread)
{
mThread->stopRequest();
}
}
virtual void completed(U32 status,
const std::string& reason,
const LLSD& content)
@@ -443,15 +469,13 @@ public:
cc = llsd_from_file("fake_upload_error.xml");
}
//assert_main_thread();
mThread->mPendingUploads--;
dump_llsd_to_file(cc,make_dump_name("whole_model_upload_response_",dump_num));
LLWholeModelUploadObserver* observer = mObserverHandle.get();
// requested "mesh" asset type isn't actually the type
// of the resultant object, fix it up here.
if (isGoodStatus(status) &&
if (((200 <= status) && (status < 300)) &&
cc["state"].asString() == "complete")
{
mModelData["asset_type"] = "object";
@@ -477,7 +501,6 @@ public:
virtual AIHTTPTimeoutPolicy const& getHTTPTimeoutPolicy(void) const { return wholeModelUploadResponder_timeout; }
};
#endif //MESH_IMPORT
LLMeshRepoThread::LLMeshRepoThread()
: LLThread("mesh repo")
@@ -499,18 +522,15 @@ LLMeshRepoThread::~LLMeshRepoThread()
void LLMeshRepoThread::run()
{
#if MESH_IMPORT
LLCDResult res = LLConvexDecomposition::initThread();
if (res != LLCD_OK)
{
llwarns << "convex decomposition unable to be loaded" << llendl;
}
#endif //MESH_IMPORT
mSignal->lock();
while (!LLApp::isQuitting())
{
// Left braces in order not to change the indentation.
{
static U32 count = 0;
@@ -646,13 +666,12 @@ void LLMeshRepoThread::run()
}
mSignal->unlock();
#if MESH_IMPORT
res = LLConvexDecomposition::quitThread();
if (res != LLCD_OK)
{
llwarns << "convex decomposition unable to be quit" << llendl;
}
#endif //MESH_IMPORT
}
void LLMeshRepoThread::loadMeshSkinInfo(const LLUUID& mesh_id)
@@ -1111,13 +1130,12 @@ bool LLMeshRepoThread::headerReceived(const LLVolumeParams& mesh_params, U8* dat
}
LLMutexLock lock(mMutex); // <FS:ND/> FIRE-7182, make sure only one thread access mPendingLOD at the same time.
LLMutexLock lock(mMutex); // make sure only one thread access mPendingLOD at the same time.
//check for pending requests
pending_lod_map::iterator iter = mPendingLOD.find(mesh_params);
if (iter != mPendingLOD.end())
{
// LLMutexLock lock(mMutex); <FS:ND/> FIRE-7182, lock was moved up, before calling mPendingLOD.find
for (U32 i = 0; i < iter->second.size(); ++i)
{
LODRequest req(mesh_params, iter->second[i]);
@@ -1266,7 +1284,6 @@ bool LLMeshRepoThread::physicsShapeReceived(const LLUUID& mesh_id, U8* data, S32
return true;
}
#if MESH_IMPORT
LLMeshUploadThread::LLMeshUploadThread(LLMeshUploadThread::instance_list& data, LLVector3& scale, bool upload_textures,
bool upload_skin, bool upload_joints, std::string upload_url, bool do_upload,
LLHandle<LLWholeModelFeeObserver> fee_observer, LLHandle<LLWholeModelUploadObserver> upload_observer)
@@ -1358,7 +1375,6 @@ void LLMeshUploadThread::run()
requestWholeModelFee();
}
}
#endif //MESH_IMPORT
void dump_llsd_to_file(const LLSD& content, std::string filename)
{
@@ -1377,7 +1393,6 @@ LLSD llsd_from_file(std::string filename)
return result;
}
#if MESH_IMPORT
void LLMeshUploadThread::wholeModelToLLSD(LLSD& dest, bool include_textures)
{
LLSD result;
@@ -1433,22 +1448,22 @@ void LLMeshUploadThread::wholeModelToLLSD(LLSD& dest, bool include_textures)
std::stringstream ostr;
LLModel::Decomposition& decomp =
data.mModel[LLModel::LOD_PHYSICS].notNull() ?
data.mModel[LLModel::LOD_PHYSICS]->mPhysics :
data.mBaseModel->mPhysics;
data.mModel[LLModel::LOD_PHYSICS].notNull() ?
data.mModel[LLModel::LOD_PHYSICS]->mPhysics :
data.mBaseModel->mPhysics;
decomp.mBaseHull = mHullMap[data.mBaseModel];
decomp.mBaseHull = mHullMap[data.mBaseModel];
LLSD mesh_header = LLModel::writeModel(
ostr,
data.mModel[LLModel::LOD_PHYSICS],
data.mModel[LLModel::LOD_HIGH],
data.mModel[LLModel::LOD_MEDIUM],
data.mModel[LLModel::LOD_LOW],
data.mModel[LLModel::LOD_IMPOSTOR],
decomp,
mUploadSkin,
mUploadJoints);
LLSD mesh_header = LLModel::writeModel(
ostr,
data.mModel[LLModel::LOD_PHYSICS],
data.mModel[LLModel::LOD_HIGH],
data.mModel[LLModel::LOD_MEDIUM],
data.mModel[LLModel::LOD_LOW],
data.mModel[LLModel::LOD_IMPOSTOR],
decomp,
mUploadSkin,
mUploadJoints);
data.mAssetData = ostr.str();
std::string str = ostr.str();
@@ -1588,7 +1603,7 @@ void LLMeshUploadThread::generateHulls()
}
llassert(physics != NULL);
DecompRequest* request = new DecompRequest(physics, data.mBaseModel, this);
if(request->isValid())
{
@@ -1635,12 +1650,10 @@ void LLMeshUploadThread::requestWholeModelFee()
wholeModelToLLSD(model_data,false);
dump_llsd_to_file(model_data,make_dump_name("whole_model_fee_request_",dump_num));
mPendingUploads++;
// This might throw AICurlNoEasyHandle.
LLHTTPClient::post(mWholeModelFeeCapability, model_data,
new LLWholeModelFeeResponder(this, model_data, mFeeObserverHandle));
}
#endif //MESH_IMPORT
void LLMeshRepoThread::notifyLoadedMeshes()
{//called via gMeshRepo.notifyLoadedMeshes(). mMutex already locked
@@ -1658,7 +1671,7 @@ void LLMeshRepoThread::notifyLoadedMeshes()
else
{
gMeshRepo.notifyMeshUnavailable(mesh.mMeshParams,
LLVolumeLODGroup::getVolumeDetailFromScale(mesh.mVolume->getDetail()));
LLVolumeLODGroup::getVolumeDetailFromScale(mesh.mVolume->getDetail()));
}
}
@@ -1740,7 +1753,6 @@ S32 LLMeshRepository::getActualMeshLOD(LLSD& header, S32 lod)
return -1;
}
#if MESH_IMPORT
void LLMeshRepository::cacheOutgoingMesh(LLMeshUploadData& data, LLSD& header)
{
mThread->mMeshHeader[data.mUUID] = header;
@@ -1761,7 +1773,6 @@ void LLMeshRepository::cacheOutgoingMesh(LLMeshUploadData& data, LLSD& header)
}
}
#endif //MESH_IMPORT
void LLMeshLODResponder::completedRaw(U32 status, const std::string& reason,
const LLChannelDescriptors& channels,
@@ -2099,9 +2110,7 @@ void LLMeshRepository::init()
{
mMeshMutex = new LLMutex();
#if MESH_IMPORT
LLConvexDecomposition::getInstance()->initSystem();
#endif //MESH_IMPORT
mDecompThread = new LLPhysicsDecomp();
mDecompThread->start();
@@ -2121,13 +2130,11 @@ void LLMeshRepository::shutdown()
{
llinfos << "Shutting down mesh repository." << llendl;
#if MESH_IMPORT
for (U32 i = 0; i < mUploads.size(); ++i)
{
llinfos << "Discard the pending mesh uploads " << llendl;
mUploads[i]->discard() ; //discard the uploading requests.
}
#endif //MESH_IMPORT
mThread->mSignal->signal();
@@ -2138,7 +2145,6 @@ void LLMeshRepository::shutdown()
delete mThread;
mThread = NULL;
#if MESH_IMPORT
for (U32 i = 0; i < mUploads.size(); ++i)
{
llinfos << "Waiting for pending mesh upload " << i << "/" << mUploads.size() << llendl;
@@ -2150,7 +2156,6 @@ void LLMeshRepository::shutdown()
}
mUploads.clear();
#endif //MESH_IMPORT
delete mMeshMutex;
mMeshMutex = NULL;
@@ -2164,16 +2169,13 @@ void LLMeshRepository::shutdown()
mDecompThread = NULL;
}
#if MESH_IMPORT
LLConvexDecomposition::quitSystem();
#endif //MESH_IMPORT
}
//called in the main thread.
S32 LLMeshRepository::update()
{
S32 size = 0;
#if MESH_IMPORT
if(mUploadWaitList.empty())
{
return 0 ;
@@ -2187,7 +2189,7 @@ S32 LLMeshRepository::update()
mUploadWaitList[i]->start() ;
}
mUploadWaitList.clear() ;
#endif //MESH_IMPORT
return size ;
}
@@ -2274,13 +2276,12 @@ void LLMeshRepository::notifyLoadedMeshes()
static const LLCachedControl<U32> max_concurrent_requests("MeshMaxConcurrentRequests");
LLMeshRepoThread::sMaxConcurrentRequests = max_concurrent_requests;
#if MESH_IMPORT
//clean up completed upload threads
for (std::vector<LLMeshUploadThread*>::iterator iter = mUploads.begin(); iter != mUploads.end(); )
{
LLMeshUploadThread* thread = *iter;
if (thread->isStopped() && thread->finished())
if (thread->isStopped())
{
iter = mUploads.erase(iter);
delete thread;
@@ -2347,7 +2348,7 @@ void LLMeshRepository::notifyLoadedMeshes()
mInventoryQ.pop();
}
#endif //MESH_IMPORT
}
//call completed callbacks on finished decompositions
mDecompThread->notifyCompleted();
@@ -2710,7 +2711,7 @@ LLSD& LLMeshRepoThread::getMeshHeader(const LLUUID& mesh_id)
return dummy_ret;
}
#if MESH_IMPORT
void LLMeshRepository::uploadModel(std::vector<LLModelInstance>& data, LLVector3& scale, bool upload_textures,
bool upload_skin, bool upload_joints, std::string upload_url, bool do_upload,
LLHandle<LLWholeModelFeeObserver> fee_observer, LLHandle<LLWholeModelUploadObserver> upload_observer)
@@ -2719,7 +2720,6 @@ void LLMeshRepository::uploadModel(std::vector<LLModelInstance>& data, LLVector3
do_upload, fee_observer, upload_observer);
mUploadWaitList.push_back(thread);
}
#endif //MESH_IMPORT
S32 LLMeshRepository::getMeshSize(const LLUUID& mesh_id, S32 lod)
{
@@ -2745,8 +2745,6 @@ S32 LLMeshRepository::getMeshSize(const LLUUID& mesh_id, S32 lod)
}
#if MESH_IMPORT
void LLMeshUploadThread::decomposeMeshMatrix(LLMatrix4& transformation,
LLVector3& result_pos,
LLQuaternion& result_rot,
@@ -2787,8 +2785,6 @@ void LLMeshUploadThread::decomposeMeshMatrix(LLMatrix4& transformation,
result_rot = quat_rotation;
}
#endif //MESH_IMPORT
bool LLImportMaterial::operator<(const LLImportMaterial &rhs) const
{
if (mDiffuseMap != rhs.mDiffuseMap)
@@ -2991,8 +2987,41 @@ S32 LLPhysicsDecomp::llcdCallback(const char* status, S32 p1, S32 p2)
return 1;
}
bool needTriangles( LLConvexDecomposition *aDC )
{
if( !aDC )
return false;
LLCDParam const *pParams(0);
int nParams = aDC->getParameters( &pParams );
if( nParams <= 0 )
return false;
for( int i = 0; i < nParams; ++i )
{
if( pParams[i].mName && strcmp( "nd_AlwaysNeedTriangles", pParams[i].mName ) == 0 )
{
if( LLCDParam::LLCD_BOOLEAN == pParams[i].mType && pParams[i].mDefault.mBool )
return true;
else
return false;
}
}
return false;
}
void LLPhysicsDecomp::setMeshData(LLCDMeshData& mesh, bool vertex_based)
{
LLConvexDecomposition *pDeComp = LLConvexDecomposition::getInstance();
if( !pDeComp )
return;
if( vertex_based )
vertex_based = !needTriangles( pDeComp );
mesh.mVertexBase = mCurRequest->mPositions[0].mV;
mesh.mVertexStrideBytes = 12;
mesh.mNumVertices = mCurRequest->mPositions.size();
@@ -3006,26 +3035,20 @@ void LLPhysicsDecomp::setMeshData(LLCDMeshData& mesh, bool vertex_based)
mesh.mNumTriangles = mCurRequest->mIndices.size()/3;
}
#if MESH_IMPORT
if ((vertex_based || mesh.mNumTriangles > 0) && mesh.mNumVertices > 2)
{
LLCDResult ret = LLCD_OK;
if (LLConvexDecomposition::getInstance() != NULL)
{
ret = LLConvexDecomposition::getInstance()->setMeshData(&mesh, vertex_based);
}
ret = LLConvexDecomposition::getInstance()->setMeshData(&mesh, vertex_based);
if (ret)
{
llerrs << "Convex Decomposition thread valid but could not set mesh data" << llendl;
}
}
#endif //MESH_IMPORT
}
void LLPhysicsDecomp::doDecomposition()
{
#if MESH_IMPORT
LLCDMeshData mesh;
S32 stage = mStageID[mCurRequest->mStage];
@@ -3160,7 +3183,6 @@ void LLPhysicsDecomp::doDecomposition()
completeCurrent();
}
}
#endif //MESH_IMPORT
}
void LLPhysicsDecomp::completeCurrent()
@@ -3214,10 +3236,6 @@ void make_box(LLPhysicsDecomp::Request * request)
void LLPhysicsDecomp::doDecompositionSingleHull()
{
#if !MESH_IMPORT
return;
#endif //!MESH_IMPORT
#if MESH_IMPORT
LLConvexDecomposition* decomp = LLConvexDecomposition::getInstance();
if (decomp == NULL)
@@ -3238,11 +3256,12 @@ void LLPhysicsDecomp::doDecompositionSingleHull()
}
else
{
mMutex->lock();
mCurRequest->mHull.clear();
mCurRequest->mHull.resize(1);
mCurRequest->mHullMesh.clear();
mMutex->unlock();
{
LLMutexLock lock(mMutex);
mCurRequest->mHull.clear();
mCurRequest->mHull.resize(1);
mCurRequest->mHullMesh.clear();
}
std::vector<LLVector3> p;
LLCDHull hull;
@@ -3258,26 +3277,73 @@ void LLPhysicsDecomp::doDecompositionSingleHull()
p.push_back(vert);
v = (F32*) (((U8*) v) + hull.mVertexStrideBytes);
}
mMutex->lock();
mCurRequest->mHull[0] = p;
mMutex->unlock();
{
LLMutexLock lock(mMutex);
mCurRequest->mHull[0] = p;
}
}
{
completeCurrent();
}
#endif //MESH_IMPORT
}
#ifdef ND_HASCONVEXDECOMP_TRACER
class ndDecompTracer: public ndConvexDecompositionTracer
{
int mRefCount;
public:
ndDecompTracer()
: mRefCount(0)
{
}
virtual void trace( char const *a_strMsg )
{
llinfos << a_strMsg << llendl;
}
virtual void startTraceData( char const *a_strWhat)
{
llinfos << a_strWhat << llendl;
}
virtual void traceData( char const *a_strData )
{
llinfos << a_strData << llendl;
}
virtual void endTraceData()
{
}
virtual int getLevel()
{
return eTraceFunctions;// | eTraceData;
}
virtual void addref()
{
++mRefCount;
}
virtual void release()
{
--mRefCount;
if( mRefCount == 0 )
delete this;
}
};
#endif
void LLPhysicsDecomp::run()
{
#if !MESH_IMPORT
mInited = true;
#endif //!MESH_IMPORT
#if MESH_IMPORT
LLConvexDecomposition* decomp = LLConvexDecomposition::getInstance();
if (decomp == NULL)
{
@@ -3287,6 +3353,13 @@ void LLPhysicsDecomp::run()
return;
}
#ifdef ND_HASCONVEXDECOMP_TRACER
ndConvexDecompositionTracable *pTraceable = dynamic_cast< ndConvexDecompositionTracable* >( decomp );
if( pTraceable )
pTraceable->setTracer( new ndDecompTracer() );
#endif
decomp->initThread();
mInited = true;
@@ -3304,6 +3377,7 @@ void LLPhysicsDecomp::run()
}
mSignal->lock();
while (!mQuitting)
{
mSignal->wait();
@@ -3332,14 +3406,14 @@ void LLPhysicsDecomp::run()
}
}
}
mSignal->unlock();
decomp->quitThread();
mDone = true;
#endif //MESH_IMPORT
}
mDone = true;
}
void LLPhysicsDecomp::Request::assignData(LLModel* mdl)
{
@@ -3486,7 +3560,6 @@ void LLMeshRepository::buildPhysicsMesh(LLModel::Decomposition& decomp)
hull.mVertexBase = decomp.mHull[i][0].mV;
hull.mVertexStrideBytes = 12;
#if MESH_IMPORT
LLCDMeshData mesh;
LLCDResult res = LLCD_OK;
if (LLConvexDecomposition::getInstance() != NULL)
@@ -3497,7 +3570,6 @@ void LLMeshRepository::buildPhysicsMesh(LLModel::Decomposition& decomp)
{
get_vertex_buffer_from_mesh(mesh, decomp.mMesh[i]);
}
#endif //MESH_IMPORT
}
if (!decomp.mBaseHull.empty() && decomp.mBaseHullMesh.empty())
@@ -3507,7 +3579,6 @@ void LLMeshRepository::buildPhysicsMesh(LLModel::Decomposition& decomp)
hull.mVertexBase = decomp.mBaseHull[0].mV;
hull.mVertexStrideBytes = 12;
#if MESH_IMPORT
LLCDMeshData mesh;
LLCDResult res = LLCD_OK;
if (LLConvexDecomposition::getInstance() != NULL)
@@ -3518,7 +3589,6 @@ void LLMeshRepository::buildPhysicsMesh(LLModel::Decomposition& decomp)
{
get_vertex_buffer_from_mesh(mesh, decomp.mBaseHullMesh);
}
#endif //MESH_IMPORT
}
}

View File

@@ -33,37 +33,10 @@
#include "llviewertexture.h"
#include "llvolume.h"
#if MESH_IMPORT
#define LLCONVEXDECOMPINTER_STATIC 1
#include "llconvexdecomposition.h"
#endif //MESH_IMPORT
#if !MESH_IMPORT
//Placeholder structs from LLConvexDecomposition.h:
struct LLCDMeshData
{
enum IndexType
{
INT_16,
INT_32
};
const float* mVertexBase;
int mVertexStrideBytes;
int mNumVertices;
const void* mIndexBase;
IndexType mIndexType;
int mIndexStrideBytes;
int mNumTriangles;
};
struct LLCDHull
{
const float* mVertexBase;
int mVertexStrideBytes;
int mNumVertices;
};
#endif //!MESH_IMPORT
#include "lluploadfloaterobservers.h"
class LLVOVolume;
class LLMeshResponder;
@@ -245,8 +218,8 @@ public:
static S32 sActiveLODRequests;
static U32 sMaxConcurrentRequests;
LLMutex* mMutex;
LLMutex* mHeaderMutex;
LLMutex* mMutex;
LLMutex* mHeaderMutex;
LLCondition* mSignal;
//map of known mesh headers
@@ -377,7 +350,6 @@ public:
};
#if MESH_IMPORT
class LLMeshUploadThread : public LLThread
{
private:
@@ -427,6 +399,9 @@ public:
LLHandle<LLWholeModelFeeObserver> fee_observer= (LLHandle<LLWholeModelFeeObserver>()), LLHandle<LLWholeModelUploadObserver> upload_observer = (LLHandle<LLWholeModelUploadObserver>()));
~LLMeshUploadThread();
void startRequest() { ++mPendingUploads; }
void stopRequest() { --mPendingUploads; }
virtual void run();
void preStart();
void discard() ;
@@ -453,7 +428,6 @@ private:
bool mDoUpload; // if FALSE only model data will be requested, otherwise the model will be uploaded
};
#endif //MESH_IMPORT
class LLMeshRepository
{
@@ -502,11 +476,9 @@ public:
LLSD& getMeshHeader(const LLUUID& mesh_id);
#if MESH_IMPORT
void uploadModel(std::vector<LLModelInstance>& data, LLVector3& scale, bool upload_textures,
bool upload_skin, bool upload_joints, std::string upload_url, bool do_upload = true,
LLHandle<LLWholeModelFeeObserver> fee_observer= (LLHandle<LLWholeModelFeeObserver>()), LLHandle<LLWholeModelUploadObserver> upload_observer = (LLHandle<LLWholeModelUploadObserver>()));
#endif //MESH_IMPORT
S32 getMeshSize(const LLUUID& mesh_id, S32 lod);
@@ -544,15 +516,11 @@ public:
U32 mMeshThreadCount;
#if MESH_IMPORT
void cacheOutgoingMesh(LLMeshUploadData& data, LLSD& header);
#endif //MESH_IMPORT
LLMeshRepoThread* mThread;
#if MESH_IMPORT
std::vector<LLMeshUploadThread*> mUploads;
std::vector<LLMeshUploadThread*> mUploadWaitList;
#endif //MESH_IMPORT
LLPhysicsDecomp* mDecompThread;

View File

@@ -802,11 +802,14 @@ class Linux_i686Manifest(LinuxManifest):
self.path("libSDL-1.2.so*")
self.path("libapr-1.so*")
self.path("libaprutil-1.so*")
self.path("libcollada14dom.so")
self.path("libcrypto.so*")
self.path("libdb*.so")
self.path("libdirect-1.*.so*")
self.path("libdirectfb-1.*.so*")
self.path("libfusion-1.*.so*")
self.path("libglod.so")
self.path("libminizip.so")
self.path("libexpat.so*")
self.path("libhunspell-*.so.*")
self.path("libssl.so*")

View File

@@ -932,6 +932,23 @@
</map>
</map>
</map>
<key>ndPhysicsStub</key>
<map>
<key>description</key>
<string>llphysicsextension_stub modified with hacd by NickyD</string>
<key>license</key>
<string>lgpl</string>
<key>packages</key>
<map>
<key>linux</key>
<map>
<key>md5sum</key>
<string>017e37250d49686a11db0b88d6633404</string>
<key>url</key>
<uri>https://bitbucket.org/LightDrake/singularitylibraries/downloads/ndPhysicsStub-r65-linux32-singu.tar.bz2</uri>
</map>
</map>
</map>
<key>ogg-vorbis</key>
<map>
<key>copyright</key>