Initial work.
This commit is contained in:
@@ -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
|
||||
|
||||
@@ -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)
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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;
|
||||
};
|
||||
|
||||
|
||||
Reference in New Issue
Block a user