Difference between revisions of "Viewer Object System"

From Second Life Wiki
Jump to navigation Jump to search
(Start to make an attempt to improve the details on this page)
Line 1: Line 1:
Someone make this page prettier.  Please.
Someone make this page prettier.  Please.


The viewer objects are contained in the global gObjectList.  ViewerObjects are most things you see on the screen, such as prims, particles, trees, avatars, etc.
The viewer objects are contained in the global gObjectList, which is the only instance of the class LLViewerObjectList (http://doc.daleglass.net/classLLViewerObjectList.html)
 
Properties:
 
* Active: If it's liable to change itself, i.e. scripted or physical
* Orphaned:  If it's crossing a region boundary or in the process of being reparented.


ViewerObjects are most things you see on the screen, such as prims, particles, trees, avatars, etc. A number of different types of viewer object exist, when an object is created the pcode variable passed to the createObject() function determines the object type:-


PCode: Specifies what sort of object it is.
     LL_PCODE_VOLUME:  Most prims, includes attachments
     LL_PCODE_VOLUME:  Most prims, includes attachments
     LL_PCODE_LEGACY_TREE:  Actually not legacy, a normal linden tree.
     LL_PCODE_LEGACY_TREE:  Actually not legacy, a normal linden tree.
Line 26: Line 21:
     LL_PCODE_TREE_NEW:
     LL_PCODE_TREE_NEW:
     LL_PCODE_LEGACY_TEXT_BUBBLE:
     LL_PCODE_LEGACY_TEXT_BUBBLE:
Each Object is represented by an instance of the LLViewerObject class (http://doc.daleglass.net/classLLViewerObject.html) but this will be sub-classed based on the PCODE that was passed to the createObject() function, in most cases this is a LLVOVolume for a PCODE = LL_PCODE_VOLUME (http://doc.daleglass.net/classLLVOVolume.html)
ObjectUpdate messages are handled by gObjectList.processObjectUpdate() this either updates an existing object if it is contained within the object list, or creates a new LLViewerObject to represent the object the viewer has just discovered from a server message.
Properties:
* Active: If it's liable to change itself, i.e. scripted or physical
* Orphaned:  If it's crossing a region boundary or in the process of being reparented.
==Inventory==
Whist Objects in world can have inventory, LLViewerObjects do not *automatically* and it may need to be requested from the server. The process to get inventory is asynchronous and you should :-
* Register an inventory listener with LLViewerObject::registerInventoryListener(LLVOInventoryListener* listener, void* user_data)
* Call LLViewerObject::requestInventory()
The class derived from LLVOInventoryListener should implement the inventoryChanged() function which will be called when the inventory details are received or are updated.
* When you are finished, clear the inventory listener (possibly in the deconstructor of your derrived LLVOInventoryListener).

Revision as of 07:04, 21 July 2008

Someone make this page prettier. Please.

The viewer objects are contained in the global gObjectList, which is the only instance of the class LLViewerObjectList (http://doc.daleglass.net/classLLViewerObjectList.html)

ViewerObjects are most things you see on the screen, such as prims, particles, trees, avatars, etc. A number of different types of viewer object exist, when an object is created the pcode variable passed to the createObject() function determines the object type:-

   LL_PCODE_VOLUME:   Most prims, includes attachments
   LL_PCODE_LEGACY_TREE:  Actually not legacy, a normal linden tree.
   LL_PCODE_LEGACY_GRASS: Not legacy, I don't think.
   LL_VO_CLOUDS:  Clouds
   LL_VO_SURFACE_PATCH: Terrain
   LL_VO_SKY:  The old non-windlight sky.
   LL_VO_STARS: Stars
   LL_VO_WATER: Water
   LL_VO_GROUND: Not terrain, the stuff that's under the terrain.
   LL_VO_PART_GROUP: ??

Legacy stuff:

   LL_PCODE_LEGACY_AVATAR:
   LL_PCODE_LEGACY_PART_SYS:
   LL_PCODE_TREE_NEW:
   LL_PCODE_LEGACY_TEXT_BUBBLE:


Each Object is represented by an instance of the LLViewerObject class (http://doc.daleglass.net/classLLViewerObject.html) but this will be sub-classed based on the PCODE that was passed to the createObject() function, in most cases this is a LLVOVolume for a PCODE = LL_PCODE_VOLUME (http://doc.daleglass.net/classLLVOVolume.html)

ObjectUpdate messages are handled by gObjectList.processObjectUpdate() this either updates an existing object if it is contained within the object list, or creates a new LLViewerObject to represent the object the viewer has just discovered from a server message.

Properties:

  • Active: If it's liable to change itself, i.e. scripted or physical
  • Orphaned: If it's crossing a region boundary or in the process of being reparented.


Inventory

Whist Objects in world can have inventory, LLViewerObjects do not *automatically* and it may need to be requested from the server. The process to get inventory is asynchronous and you should :-

  • Register an inventory listener with LLViewerObject::registerInventoryListener(LLVOInventoryListener* listener, void* user_data)
  • Call LLViewerObject::requestInventory()

The class derived from LLVOInventoryListener should implement the inventoryChanged() function which will be called when the inventory details are received or are updated.

  • When you are finished, clear the inventory listener (possibly in the deconstructor of your derrived LLVOInventoryListener).