diff options
Diffstat (limited to '')
-rw-r--r-- | linden/indra/llprimitive/llprimitive.h | 54 |
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; | |||
48 | class LLColor3; | 48 | class LLColor3; |
49 | class LLTextureEntry; | 49 | class LLTextureEntry; |
50 | class LLDataPacker; | 50 | class LLDataPacker; |
51 | class LLVolumeMgr; | ||
51 | 52 | ||
52 | enum LLGeomType // NOTE: same vals as GL Ids | 53 | enum LLGeomType // NOTE: same vals as GL Ids |
53 | { | 54 | { |
@@ -269,11 +270,32 @@ public: | |||
269 | class LLPrimitive : public LLXform | 270 | class LLPrimitive : public LLXform |
270 | { | 271 | { |
271 | public: | 272 | public: |
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 | ||
393 | inline BOOL LLPrimitive::isAvatar() const | 425 | inline BOOL LLPrimitive::isAvatar() const |
394 | { | 426 | { |
395 | return mPrimitiveCode == LL_PCODE_LEGACY_AVATAR; | 427 | return ( LL_PCODE_LEGACY_AVATAR == mPrimitiveCode ) ? TRUE : FALSE; |
428 | } | ||
429 | |||
430 | inline 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 | |||
437 | inline 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 |