aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/linden/indra/newview/llviewerobject.h
diff options
context:
space:
mode:
authorJacek Antonelli2008-09-06 18:24:57 -0500
committerJacek Antonelli2008-09-06 18:25:07 -0500
commit798d367d54a6c6379ad355bd8345fa40e31e7fe9 (patch)
tree1921f1708cd0240648c97bc02df2c2ab5f2fc41e /linden/indra/newview/llviewerobject.h
parentSecond Life viewer sources 1.20.15 (diff)
downloadmeta-impy-798d367d54a6c6379ad355bd8345fa40e31e7fe9.zip
meta-impy-798d367d54a6c6379ad355bd8345fa40e31e7fe9.tar.gz
meta-impy-798d367d54a6c6379ad355bd8345fa40e31e7fe9.tar.bz2
meta-impy-798d367d54a6c6379ad355bd8345fa40e31e7fe9.tar.xz
Second Life viewer sources 1.21.0-RC
Diffstat (limited to '')
-rw-r--r--linden/indra/newview/llviewerobject.h51
1 files changed, 36 insertions, 15 deletions
diff --git a/linden/indra/newview/llviewerobject.h b/linden/indra/newview/llviewerobject.h
index 88e2a15..06d385c 100644
--- a/linden/indra/newview/llviewerobject.h
+++ b/linden/indra/newview/llviewerobject.h
@@ -129,7 +129,8 @@ protected:
129 std::map<U16, ExtraParameter*> mExtraParameterList; 129 std::map<U16, ExtraParameter*> mExtraParameterList;
130 130
131public: 131public:
132 typedef std::vector<LLPointer<LLViewerObject> > child_list_t; 132 typedef std::list<LLPointer<LLViewerObject> > child_list_t;
133 typedef const child_list_t const_child_list_t;
133 134
134 LLViewerObject(const LLUUID &id, const LLPCode type, LLViewerRegion *regionp); 135 LLViewerObject(const LLUUID &id, const LLPCode type, LLViewerRegion *regionp);
135 MEM_TYPE_NEW(LLMemType::MTYPE_OBJECT); 136 MEM_TYPE_NEW(LLMemType::MTYPE_OBJECT);
@@ -143,8 +144,8 @@ public:
143 static void cleanupVOClasses(); 144 static void cleanupVOClasses();
144 145
145 void addNVPair(const std::string& data); 146 void addNVPair(const std::string& data);
146 BOOL removeNVPair(const char *name); 147 BOOL removeNVPair(const std::string& name);
147 LLNameValue *getNVPair(const char *name) const; // null if no name value pair by that name 148 LLNameValue* getNVPair(const std::string& name) const; // null if no name value pair by that name
148 149
149 // Object create and update functions 150 // Object create and update functions
150 virtual BOOL idleUpdate(LLAgent &agent, LLWorld &world, const F64 &time); 151 virtual BOOL idleUpdate(LLAgent &agent, LLWorld &world, const F64 &time);
@@ -153,7 +154,7 @@ public:
153 enum { MEDIA_TYPE_NONE = 0, MEDIA_TYPE_WEB_PAGE = 1 }; 154 enum { MEDIA_TYPE_NONE = 0, MEDIA_TYPE_WEB_PAGE = 1 };
154 155
155 // Return codes for processUpdateMessage 156 // Return codes for processUpdateMessage
156 enum { MEDIA_URL_REMOVED = 0x1, MEDIA_URL_ADDED = 0x2, MEDIA_URL_UPDATED = 0x4 }; 157 enum { MEDIA_URL_REMOVED = 0x1, MEDIA_URL_ADDED = 0x2, MEDIA_URL_UPDATED = 0x4, INVALID_UPDATE = 0x80000000 };
157 158
158 virtual U32 processUpdateMessage(LLMessageSystem *mesgsys, 159 virtual U32 processUpdateMessage(LLMessageSystem *mesgsys,
159 void **user_data, 160 void **user_data,
@@ -212,7 +213,8 @@ public:
212 U32 getLocalID() const { return mLocalID; } 213 U32 getLocalID() const { return mLocalID; }
213 U32 getCRC() const { return mTotalCRC; } 214 U32 getCRC() const { return mTotalCRC; }
214 215
215 virtual BOOL isFlexible() const { return false; } 216 virtual BOOL isFlexible() const { return FALSE; }
217 virtual BOOL isSculpted() const { return FALSE; }
216 218
217 // This method returns true if the object is over land owned by 219 // This method returns true if the object is over land owned by
218 // the agent. 220 // the agent.
@@ -234,7 +236,8 @@ public:
234 virtual void setParent(LLViewerObject* parent); 236 virtual void setParent(LLViewerObject* parent);
235 virtual void addChild(LLViewerObject *childp); 237 virtual void addChild(LLViewerObject *childp);
236 virtual void removeChild(LLViewerObject *childp); 238 virtual void removeChild(LLViewerObject *childp);
237 child_list_t& getChildren(); 239 const_child_list_t& getChildren() const { return mChildList; }
240 S32 numChildren() const { return mChildList.size(); }
238 void addThisAndAllChildren(LLDynamicArray<LLViewerObject*>& objects); 241 void addThisAndAllChildren(LLDynamicArray<LLViewerObject*>& objects);
239 void addThisAndNonJointChildren(LLDynamicArray<LLViewerObject*>& objects); 242 void addThisAndNonJointChildren(LLDynamicArray<LLViewerObject*>& objects);
240 BOOL isChild(LLViewerObject *childp) const; 243 BOOL isChild(LLViewerObject *childp) const;
@@ -242,9 +245,15 @@ public:
242 245
243 246
244 //detect if given line segment (in agent space) intersects with this viewer object. 247 //detect if given line segment (in agent space) intersects with this viewer object.
245 //returns TRUE if intersection detected and moves end to the point of intersection 248 //returns TRUE if intersection detected and returns information about intersection
246 //closest to start. 249 virtual BOOL lineSegmentIntersect(const LLVector3& start, const LLVector3& end,
247 virtual BOOL lineSegmentIntersect(const LLVector3& start, LLVector3& end) const; 250 S32 face = -1, // which face to check, -1 = ALL_SIDES
251 S32* face_hit = NULL, // which face was hit
252 LLVector3* intersection = NULL, // return the intersection point
253 LLVector2* tex_coord = NULL, // return the texture coordinates of the intersection point
254 LLVector3* normal = NULL, // return the surface normal at the intersection point
255 LLVector3* bi_normal = NULL // return the surface bi-normal at the intersection point
256 );
248 257
249 virtual const LLVector3d getPositionGlobal() const; 258 virtual const LLVector3d getPositionGlobal() const;
250 virtual const LLVector3 &getPositionRegion() const; 259 virtual const LLVector3 &getPositionRegion() const;
@@ -326,8 +335,8 @@ public:
326 U8 getMediaType() const; 335 U8 getMediaType() const;
327 void setMediaType(U8 media_type); 336 void setMediaType(U8 media_type);
328 337
329 const LLString& getMediaURL() const; 338 std::string getMediaURL() const;
330 void setMediaURL(const LLString& media_url); 339 void setMediaURL(const std::string& media_url);
331 340
332 BOOL getMediaPassedWhitelist() const; 341 BOOL getMediaPassedWhitelist() const;
333 void setMediaPassedWhitelist(BOOL passed); 342 void setMediaPassedWhitelist(BOOL passed);
@@ -378,6 +387,7 @@ public:
378 // manager, so do no call updateInventory() from the selection 387 // manager, so do no call updateInventory() from the selection
379 // manager until we have better iterators. 388 // manager until we have better iterators.
380 void updateInventory(LLViewerInventoryItem* item, U8 key, bool is_new); 389 void updateInventory(LLViewerInventoryItem* item, U8 key, bool is_new);
390 void updateInventoryLocal(LLInventoryItem* item, U8 key); // Update without messaging.
381 LLInventoryObject* getInventoryObject(const LLUUID& item_id); 391 LLInventoryObject* getInventoryObject(const LLUUID& item_id);
382 void getInventoryContents(InventoryObjectList& objects); 392 void getInventoryContents(InventoryObjectList& objects);
383 LLInventoryObject* getInventoryRoot(); 393 LLInventoryObject* getInventoryRoot();
@@ -465,6 +475,16 @@ public:
465 friend class LLViewerObjectList; 475 friend class LLViewerObjectList;
466 friend class LLViewerMediaList; 476 friend class LLViewerMediaList;
467 477
478public:
479 //counter-translation
480 void resetChildrenPosition(const LLVector3& offset, BOOL simplified = FALSE) ;
481 //counter-rotation
482 void resetChildrenRotationAndPosition(const std::vector<LLQuaternion>& rotations,
483 const std::vector<LLVector3>& positions) ;
484 void saveUnselectedChildrenRotation(std::vector<LLQuaternion>& rotations) ;
485 void saveUnselectedChildrenPosition(std::vector<LLVector3>& positions) ;
486 std::vector<LLVector3> mUnselectedChildrenPositions ;
487
468private: 488private:
469 ExtraParameter* createNewParameterEntry(U16 param_type); 489 ExtraParameter* createNewParameterEntry(U16 param_type);
470 ExtraParameter* getExtraParameterEntry(U16 param_type) const; 490 ExtraParameter* getExtraParameterEntry(U16 param_type) const;
@@ -489,7 +509,6 @@ public:
489 LL_VO_WL_SKY = LL_PCODE_APP | 0xb0, // should this be moved to 0x40? 509 LL_VO_WL_SKY = LL_PCODE_APP | 0xb0, // should this be moved to 0x40?
490 } EVOType; 510 } EVOType;
491 511
492 child_list_t mChildList;
493 LLUUID mID; 512 LLUUID mID;
494 513
495 // unique within region, not unique across regions 514 // unique within region, not unique across regions
@@ -534,7 +553,7 @@ protected:
534 553
535 // do the update/caching logic. called by saveScript and 554 // do the update/caching logic. called by saveScript and
536 // updateInventory. 555 // updateInventory.
537 void doUpdateInventory(LLViewerInventoryItem* item, U8 key, bool is_new); 556 void doUpdateInventory(LLPointer<LLViewerInventoryItem>& item, U8 key, bool is_new);
538 557
539 558
540 static LLViewerObject *createObject(const LLUUID &id, LLPCode pcode, LLViewerRegion *regionp); 559 static LLViewerObject *createObject(const LLUUID &id, LLPCode pcode, LLViewerRegion *regionp);
@@ -550,7 +569,7 @@ protected:
550 // 569 //
551 570
552 static void processTaskInvFile(void** user_data, S32 error_code, LLExtStat ext_status); 571 static void processTaskInvFile(void** user_data, S32 error_code, LLExtStat ext_status);
553 void loadTaskInvFile(const char* filename); 572 void loadTaskInvFile(const std::string& filename);
554 void doInventoryCallback(); 573 void doInventoryCallback();
555 574
556 BOOL isOnMap(); 575 BOOL isOnMap();
@@ -568,6 +587,8 @@ protected:
568 typedef std::map<char *, LLNameValue *> name_value_map_t; 587 typedef std::map<char *, LLNameValue *> name_value_map_t;
569 name_value_map_t mNameValuePairs; // Any name-value pairs stored by script 588 name_value_map_t mNameValuePairs; // Any name-value pairs stored by script
570 589
590 child_list_t mChildList;
591
571 F64 mLastInterpUpdateSecs; // Last update for purposes of interpolation 592 F64 mLastInterpUpdateSecs; // Last update for purposes of interpolation
572 F64 mLastMessageUpdateSecs; // Last update from a message from the simulator 593 F64 mLastMessageUpdateSecs; // Last update from a message from the simulator
573 TPACKETID mLatestRecvPacketID; // Latest time stamp on message from simulator 594 TPACKETID mLatestRecvPacketID; // Latest time stamp on message from simulator
@@ -657,7 +678,7 @@ class LLViewerObjectMedia
657public: 678public:
658 LLViewerObjectMedia() : mMediaURL(), mPassedWhitelist(FALSE), mMediaType(0) { } 679 LLViewerObjectMedia() : mMediaURL(), mPassedWhitelist(FALSE), mMediaType(0) { }
659 680
660 LLString mMediaURL; // for web pages on surfaces, one per prim 681 std::string mMediaURL; // for web pages on surfaces, one per prim
661 BOOL mPassedWhitelist; // user has OK'd display 682 BOOL mPassedWhitelist; // user has OK'd display
662 U8 mMediaType; // see LLTextureEntry::WEB_PAGE, etc. 683 U8 mMediaType; // see LLTextureEntry::WEB_PAGE, etc.
663}; 684};