aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/linden/indra/llprimitive/llprimitive.h
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--linden/indra/llprimitive/llprimitive.h54
1 files changed, 50 insertions, 4 deletions
diff --git a/linden/indra/llprimitive/llprimitive.h b/linden/indra/llprimitive/llprimitive.h
index 3b43e8f..e698a31 100644
--- a/linden/indra/llprimitive/llprimitive.h
+++ b/linden/indra/llprimitive/llprimitive.h
@@ -48,6 +48,7 @@ class LLColor4;
48class LLColor3; 48class LLColor3;
49class LLTextureEntry; 49class LLTextureEntry;
50class LLDataPacker; 50class LLDataPacker;
51class LLVolumeMgr;
51 52
52enum LLGeomType // NOTE: same vals as GL Ids 53enum LLGeomType // NOTE: same vals as GL Ids
53{ 54{
@@ -269,11 +270,32 @@ public:
269class LLPrimitive : public LLXform 270class LLPrimitive : public LLXform
270{ 271{
271public: 272public:
273
274 // HACK for removing LLPrimitive's dependency on gVolumeMgr global.
275 // If a different LLVolumeManager is instantiated and set early enough
276 // then the LLPrimitive class will use it instead of gVolumeMgr.
277 static LLVolumeMgr* getVolumeManager() { return sVolumeManager; }
278 static void setVolumeManager( LLVolumeMgr* volume_manager);
279 static bool cleanupVolumeManager();
280
281 // these flags influence how the RigidBody representation is built
282 static const U32 PRIM_FLAG_PHANTOM = 0x1 << 0;
283 static const U32 PRIM_FLAG_VOLUME_DETECT = 0x1 << 1;
284 static const U32 PRIM_FLAG_DYNAMIC = 0x1 << 2;
285 static const U32 PRIM_FLAG_AVATAR = 0x1 << 3;
286 static const U32 PRIM_FLAG_SCULPT = 0x1 << 4;
287 // not used yet, but soon
288 static const U32 PRIM_FLAG_COLLISION_CALLBACK = 0x1 << 5;
289 static const U32 PRIM_FLAG_CONVEX = 0x1 << 6;
290 static const U32 PRIM_FLAG_DEFAULT_VOLUME = 0x1 << 7;
291 static const U32 PRIM_FLAG_SITTING = 0x1 << 8;
292 static const U32 PRIM_FLAG_SITTING_ON_GROUND = 0x1 << 9; // Set along with PRIM_FLAG_SITTING
293
272 LLPrimitive(); 294 LLPrimitive();
273 virtual ~LLPrimitive(); 295 virtual ~LLPrimitive();
274 296
275 static LLPrimitive *createPrimitive(LLPCode p_code); 297 static LLPrimitive *createPrimitive(LLPCode p_code);
276 void init(LLPCode p_code); 298 void init_primitive(LLPCode p_code);
277 299
278 void setPCode(const LLPCode pcode); 300 void setPCode(const LLPCode pcode);
279 const LLVolume *getVolumeConst() const { return mVolumep; } // HACK for Windoze confusion about ostream operator in LLVolume 301 const LLVolume *getVolumeConst() const { return mVolumep; } // HACK for Windoze confusion about ostream operator in LLVolume
@@ -369,8 +391,15 @@ public:
369 391
370 void setTextureList(LLTextureEntry *listp); 392 void setTextureList(LLTextureEntry *listp);
371 393
372 inline BOOL isAvatar() const; 394 inline BOOL isAvatar() const;
373 395 inline BOOL isSittingAvatar() const;
396 inline BOOL isSittingAvatarOnGround() const;
397
398 void setFlags(U32 flags) { mMiscFlags = flags; }
399 void addFlags(U32 flags) { mMiscFlags |= flags; }
400 void removeFlags(U32 flags) { mMiscFlags &= ~flags; }
401 U32 getFlags() const { return mMiscFlags; }
402
374 static const char *pCodeToString(const LLPCode pcode); 403 static const char *pCodeToString(const LLPCode pcode);
375 static LLPCode legacyToPCode(const U8 legacy); 404 static LLPCode legacyToPCode(const U8 legacy);
376 static U8 pCodeToLegacy(const LLPCode pcode); 405 static U8 pCodeToLegacy(const LLPCode pcode);
@@ -388,11 +417,28 @@ protected:
388 LLTextureEntry *mTextureList; // list of texture GUIDs, scales, offsets 417 LLTextureEntry *mTextureList; // list of texture GUIDs, scales, offsets
389 U8 mMaterial; // Material code 418 U8 mMaterial; // Material code
390 U8 mNumTEs; // # of faces on the primitve 419 U8 mNumTEs; // # of faces on the primitve
420 U32 mMiscFlags; // home for misc bools
421
422 static LLVolumeMgr* sVolumeManager;
391}; 423};
392 424
393inline BOOL LLPrimitive::isAvatar() const 425inline BOOL LLPrimitive::isAvatar() const
394{ 426{
395 return mPrimitiveCode == LL_PCODE_LEGACY_AVATAR; 427 return ( LL_PCODE_LEGACY_AVATAR == mPrimitiveCode ) ? TRUE : FALSE;
428}
429
430inline BOOL LLPrimitive::isSittingAvatar() const
431{
432 // this is only used server-side
433 return ( LL_PCODE_LEGACY_AVATAR == mPrimitiveCode
434 && ((getFlags() & (PRIM_FLAG_SITTING | PRIM_FLAG_SITTING_ON_GROUND)) != 0) ) ? TRUE : FALSE;
435}
436
437inline BOOL LLPrimitive::isSittingAvatarOnGround() const
438{
439 // this is only used server-side
440 return ( LL_PCODE_LEGACY_AVATAR == mPrimitiveCode
441 && ((getFlags() & PRIM_FLAG_SITTING_ON_GROUND) != 0) ) ? TRUE : FALSE;
396} 442}
397 443
398// static 444// static