Public Member Functions | Protected Attributes | Static Protected Attributes

VIAgents.SLObject Class Reference

A Class that represents an object a bot can use in Second Life. The usage normally involves taking the object, dropping it, moving around etc. More...

List of all members.

Public Member Functions

 SLObject (String inObjectName, Vector3 inDefaultPosition, bool inPrivateObject, GridClient inClient, SLBot inAgent)
string GetName ()
uint GetLocalID ()
UUID GetInventoryID ()
Primitive GetPrimitive ()
Vector3 GetDefaultPosition ()
void SetName (string inName)
void SetLocalID (uint inLocalID)
void SetPrimitive (Primitive inPrimitive)
void SetPosition (Vector3 inPos)
void SetRotation (Quaternion inRot)
void SetInventoryID (UUID inInventoryID)
void Touch ()
void Touch (Vector3 inPos)
 Call this method to attach/wear the object.
void Say (string inMessage)
void ReturnObject ()
void ReturnObject (Vector3 inReturnPosition)
void SitAtPos (Vector3 inPos)
void SitAt ()
void PreLoad (int inObjectSearchRadius)
void PreLoad ()
bool IsFullyLoaded ()
void Reinitialize ()
void Drop ()
 Dropt the object at the current avatar position.
void Drop (Vector3 inDropPosition)
 Given object's Primitive detach it from the bot's avatar.
bool Detach ()
void CleanInventoryDuplicates ()
 Second Life tends to create duplicates of the attached objects. Every time we attach an object to the avatar it creates a new copy in the inventory, even if the object with the same name is already there. This method ensures that all the objects that are contained in the root of the Objects folder have no duplicates.

Protected Attributes

Primitive mPrimitive = null
String mName = ""
uint mLocalID = 0
UUID mInventoryID = UUID.Zero
Quaternion m_initialRotation = Quaternion.Identity
bool mIsPrivate = false

Static Protected Attributes

static int kObjectSearchRadius = 20
 the default radius in which to search for objects (in meters)
static int kInventorySearchTimeout = 3000
 maximum time to find an object in inventory

Detailed Description

A Class that represents an object a bot can use in Second Life. The usage normally involves taking the object, dropping it, moving around etc.


Constructor & Destructor Documentation

VIAgents.SLObject.SLObject ( String  inObjectName,
Vector3  inDefaultPosition,
bool  inPrivateObject,
GridClient  inClient,
SLBot  inAgent 
)

Use this constructor if localID and inventoryID should be found using unique name


Member Function Documentation

void VIAgents.SLObject.CleanInventoryDuplicates (  ) 

Second Life tends to create duplicates of the attached objects. Every time we attach an object to the avatar it creates a new copy in the inventory, even if the object with the same name is already there. This method ensures that all the objects that are contained in the root of the Objects folder have no duplicates.

bool VIAgents.SLObject.Detach (  ) 

Simply detach the object. Without creating a duplicate copy In this case the object will simply disappear Returns true on success and false otherwise

void VIAgents.SLObject.Drop (  ) 

Dropt the object at the current avatar position.

void VIAgents.SLObject.Drop ( Vector3  inDropPosition  ) 

Given object's Primitive detach it from the bot's avatar.

Vector3 VIAgents.SLObject.GetDefaultPosition (  ) 
UUID VIAgents.SLObject.GetInventoryID (  ) 
uint VIAgents.SLObject.GetLocalID (  ) 
string VIAgents.SLObject.GetName (  ) 
Primitive VIAgents.SLObject.GetPrimitive (  ) 
bool VIAgents.SLObject.IsFullyLoaded (  ) 

Check if all the values of the object were successfully assigned

void VIAgents.SLObject.PreLoad ( int  inObjectSearchRadius  ) 
void VIAgents.SLObject.PreLoad (  ) 

In order to speed up agent/object interaction this method can be called to find the localID and inventoryID for the object before usage

void VIAgents.SLObject.Reinitialize (  ) 

Reinitialize the object making sure that the next time it is used the agent has to find it in world rather than using the existing variables

void VIAgents.SLObject.ReturnObject ( Vector3  inReturnPosition  ) 

Will drop the object the avatar is currently holding at the specified position (inReturnPosition)

void VIAgents.SLObject.ReturnObject (  ) 

Will drop the object the avatar is currently holding at the current position of the avatar

void VIAgents.SLObject.Say ( string  inMessage  ) 

Send a text message to the given object To handle the message the object should have an llSay event handler in an attached script listening to the channel with the number equal to 777. The message will be in the form "ObjectName|Message"

void VIAgents.SLObject.SetInventoryID ( UUID  inInventoryID  ) 
void VIAgents.SLObject.SetLocalID ( uint  inLocalID  ) 
void VIAgents.SLObject.SetName ( string  inName  ) 
void VIAgents.SLObject.SetPosition ( Vector3  inPos  ) 
void VIAgents.SLObject.SetPrimitive ( Primitive  inPrimitive  ) 
void VIAgents.SLObject.SetRotation ( Quaternion  inRot  ) 
void VIAgents.SLObject.SitAt (  ) 
void VIAgents.SLObject.SitAtPos ( Vector3  inPos  ) 

Make the avatar sit on the object at the specified position

void VIAgents.SLObject.Touch (  ) 

Call this method to attach/wear the object Making sure the object is at the given position

void VIAgents.SLObject.Touch ( Vector3  inPos  ) 

Call this method to attach/wear the object.


Member Data Documentation

int VIAgents.SLObject.kInventorySearchTimeout = 3000 [static, protected]

maximum time to find an object in inventory

int VIAgents.SLObject.kObjectSearchRadius = 20 [static, protected]

the default radius in which to search for objects (in meters)

Quaternion VIAgents.SLObject.m_initialRotation = Quaternion.Identity [protected]
UUID VIAgents.SLObject.mInventoryID = UUID.Zero [protected]
bool VIAgents.SLObject.mIsPrivate = false [protected]
uint VIAgents.SLObject.mLocalID = 0 [protected]
String VIAgents.SLObject.mName = "" [protected]
Primitive VIAgents.SLObject.mPrimitive = null [protected]

The documentation for this class was generated from the following file: