summaryrefslogtreecommitdiff
path: root/indra/newview/llmeshrepository.h
diff options
context:
space:
mode:
authorDave Parks <davep@lindenlab.com>2010-10-05 16:49:05 -0500
committerDave Parks <davep@lindenlab.com>2010-10-05 16:49:05 -0500
commit87a9f475756d54d9d98c8cbb6395f89d6fc4606a (patch)
tree1cc74870d3f26adf2245ddef47467c05a3d11275 /indra/newview/llmeshrepository.h
parent478e0927c87338e02e75d3791f51ad2b4e7b8c74 (diff)
Rewrite LLPhysicsDecomp to have a more generic callback system.
Reviewed by prep.
Diffstat (limited to 'indra/newview/llmeshrepository.h')
-rw-r--r--indra/newview/llmeshrepository.h46
1 files changed, 31 insertions, 15 deletions
diff --git a/indra/newview/llmeshrepository.h b/indra/newview/llmeshrepository.h
index 0bc63a8469..e7270cc47d 100644
--- a/indra/newview/llmeshrepository.h
+++ b/indra/newview/llmeshrepository.h
@@ -151,37 +151,53 @@ public:
class LLPhysicsDecomp : public LLThread
{
public:
+
+ typedef std::map<std::string, LLSD> decomp_params;
+
+ class Request : public LLRefCount
+ {
+ public:
+ //input params
+ std::string mStage;
+ std::vector<LLVector3> mPositions;
+ std::vector<U16> mIndices;
+ decomp_params mParams;
+
+ //output state
+ std::string mStatusMessage;
+ std::vector<LLPointer<LLVertexBuffer> > mHullMesh;
+ LLModel::physics_shape mHull;
+
+ virtual S32 statusCallback(const char* status, S32 p1, S32 p2) = 0;
+ virtual void completed() = 0;
+ virtual void setStatusMessage(const std::string& msg);
+ };
+
LLCondition* mSignal;
LLMutex* mMutex;
- LLCDMeshData mMesh;
-
bool mInited;
bool mQuitting;
bool mDone;
-
- S32 mContinue;
- std::string mStatus;
-
- std::vector<LLVector3> mPositions;
- std::vector<U16> mIndices;
-
- S32 mStage;
-
+
LLPhysicsDecomp();
~LLPhysicsDecomp();
void shutdown();
- void setStatusMessage(std::string msg);
-
- void execute(const char* stage, LLModel* mdl);
+
+ void submitRequest(Request* request);
static S32 llcdCallback(const char*, S32, S32);
void cancel();
virtual void run();
std::map<std::string, S32> mStageID;
- LLPointer<LLModel> mModel;
+
+ typedef std::queue<LLPointer<Request> > request_queue;
+ request_queue mRequestQ;
+
+ LLPointer<Request> mCurRequest;
+
};
class LLMeshRepoThread : public LLThread