Difference between revisions of "DOMObjectExtended"

From Virtual World Web Wiki
Jump to: navigation, search
(Documentation for the DOMObjectExtended class)
(Documentation for the DOMObjectExtended class)
Line 21: Line 21:
 
::
 
::
 
::When True the effects of this object and its children should be honored in a client, for example a DOMLight should shine, a DOMRenderable should display, etc. Conversely when False, this object should be treated as though it were hidden and it's effects ignored.
 
::When True the effects of this object and its children should be honored in a client, for example a DOMLight should shine, a DOMRenderable should display, etc. Conversely when False, this object should be treated as though it were hidden and it's effects ignored.
 +
 +
:{{CSharp|bool HighLoadPriority {get; set;} // Via attribution on DOMObject }}
 +
::
 +
::High Load Priority nodes will be included in the list of things that need to be loaded before the scene will be ready to display.
  
 
:{{CSharp|long ID {get; set;} // Via attribution on DOMObject }}
 
:{{CSharp|long ID {get; set;} // Via attribution on DOMObject }}

Revision as of 13:29, 15 August 2018

Represents a DOMObject in JavaScript

  • This is a JavaScript visible object

Remarks [edit]

Properties

string Class {get; set;} // Via attribution on DOMObject
Much like the HTML concept of class, a space-separated list of class names which can be used by CSS Selectors to select this node
DOMObjectExtended Document {get;}
Gets a reference to the DOMDocument in which this DOMObject resides.
string DocumentTitle {get;}
A shortcut equivilant to DOMObject.Document.Title.
bool Enabled {get; set;} // Via attribution on DOMObject
When True the effects of this object and its children should be honored in a client, for example a DOMLight should shine, a DOMRenderable should display, etc. Conversely when False, this object should be treated as though it were hidden and it's effects ignored.
bool HighLoadPriority {get; set;} // Via attribution on DOMObject
High Load Priority nodes will be included in the list of things that need to be loaded before the scene will be ready to display.
long ID {get; set;} // Via attribution on DOMObject
The unique ID of this object in the view. DOM node IDs can change if a node is moved between view documents or removed from a document in which case this property will return zero. DOM node IDs are allocated by the RootDocument in a view
Guid? InstanceTypeID {get; set;} // Via attribution on DOMObject
The type ID of the next Object Type up the hierarchy in a derived Object Type Reference chain
bool IsInstanceRoot {get;} // Via attribution on DOMObject
True if this node is the root node in an Object Type Reference
bool IsTemplateRoot {get;} // Via attribution on DOMObject
True if this node represents the root node of an instance of an Object Template
bool IsTypeRoot {get; set;} // Via attribution on DOMObject
True if this node represents the root node of an Object Type
DOMPropertiesExtended LocalProperties {get;}
Gets a DOMProperties object representing the properties of this object which are NOT send over the network.
Guid MergeID {get; set;} // Via attribution on DOMObject
An ID that makes this object unique within it's container (parent). The MergeID changes whenever the object is re-parented.
Guid NodeID {get; set;} // Via attribution on DOMObject
Unique ID set on first creation (not sure how this is different than RecordID)
Guid? ObjectTypeID {get;} // Via attribution on DOMObject
The authoritive "Real" object type ID that this node is a part of
Guid? OriginalInstanceID {get; set;} // Via attribution on DOMObject
When this node is an embedded reference, this is a recording of our original instance ID, and will be restored if we are removed (un-embedded) from our parent referebce.
DOMObjectExtended Parent {get;}
Gets a reference to the DOMObject directly parenting this one.
Guid? ParentInstanceID {get; set;} // Via attribution on DOMObject
When this node is an embedded reference, this is the instance ID of the next parent reference up the chain
DOMPropertiesExtended Properties {get;}
Gets a DOMProperties object representing the properties of this object visible to all viewers of the DOM. Changes to these properties ARE sent over the network.
DOMProtectionFlags ProtectionFlags {get; set;} // Via attribution on DOMObject
A set of flags representing protections enforced by the server. Delete object (1), Move object (2), Add child (4), Remove child (8), Change object (16) are some of the possible flags. This property can only be set on the server and is used to protect certain objects from accidental operations that could be harmful to the basic DOM structure, like deleting the root instance document for example.
Guid TemplateID {get; set;} // Via attribution on DOMObject
If this node is part of an instaniated Object Template this property will contain the ID of the template
bool Temporary {get; set;} // Via attribution on DOMObject
A node marked as Temporary will not be serialized for storage and will not be disturbed during a publish merge. They are considered "runtime nodes" not part of the saved layout or type.
string Title {get; set;} // Via attribution on DOMObject
The title of the object, usually used only for display in a server inspector, but sometimes has special meaning (eg. in DOMTitle, DOMHookPoint, and DOMCurveValue nodes
bool Transient {get; set;} // Via attribution on DOMObject
A transient node is meant to be removed from the DOM immediately after it is received. On the server side, when a node marked Transient is added to the DOM a ChildAdd packet is sent to the client, but the node is never added to the Children collection of the target parent.
string Type {get;}
A string version of this object’s type’s name, for derived objects, this will return the name of the derived object, so DOMRenderable.Type returns "DOMRenderable"
Guid TypeID {get; set;} // Via attribution on DOMObject
The ID of the Object Type (stored DOM snippet) that this node is a part of. If the Object Type is a derived reference or this node is part of a reference inside an Object Type this will indicate the first type in which this node was introduced
int TypeNodeID {get; set;} // Via attribution on DOMObject
When part of an Object Type this integer ID uniquely identifies the node within the type. Note that if an Object Type contains references those nodes could have conflicting TypeNodeIDs but their TypeID would appear different.
bool TypeReference {get; set;} // Via attribution on DOMObject
True if this node is the root of a type reference (as in, not locally defined, but here as the result of a DOMReference expansion, and will be serialized as a DOMReference)
Guid? UnboundReferenceID {get; set;} // Via attribution on DOMObject
When this node was a reference and was UnBound, or if it was instantiated directly from a type (rather than as a reference to a type), this value will be set with the ID of the original Object Type
bool Validated {get; set;} // Via attribution on DOMObject
True if this object has a template ID and that Object Template was found in a container attached to the worldspace in which this view is running.
bool Visible {get; set;} // Via attribution on DOMObject
Marks a node as visible or not visible to connected clients. When toggled, the server sends RemoveNode / AddNode packets, so from a client perspective it's as though the node is added or removed from the DOM. It can be useful to hide nodes that will be used or cloned by scripts. It can be useful to mark a node as not visible before making many changes to it's subtree to reduce network traffic, although BeginUpdate and EndUpdate are better suited for this.

Events

OnChildAdded(DOMObjectExtended child, DOMObjectExtended source)
Parameters:
child : The child object being added
source : The parent object (this object)
Fires when a new child node is added under this node
OnDeselect(ParticipantExtended who, DOMObjectExtended source)
Parameters:
who : The participant doing the deselecting
source : The object being deselected
Fires when a user deselects an object in world. Who is Participant doing the deselecting.
OnNodeEvent(string name, string payload, DOMObjectExtended source)
Parameters:
name : The name of the event
payload : The payload of the event
source : The object firing the event (this object)
Fires when a DOM node event is fire on this object
OnSelect(ParticipantExtended who, DOMObjectExtended source)
Parameters:
who : The participant doing the selecting
source : The object being selected
Fires when a user selects an object in world. Who is the Participant doing the selecting.
OnTarget(ParticipantExtended who, DOMObjectExtended source)
Parameters:
who : The participant doing the targeting
source : The object being targeted
Fires when a user targets an object in world. Who is the Participant doing the targeting.
OnUnTarget(ParticipantExtended who, DOMObjectExtended source)
Parameters:
who : The participant doing the untargeting
source : The object being untargeted
Fires when a user un-targets an object in world. Who is the Participant doing the un-targeting.

Methods

void AddAllow(ParticipantExtended participant)
Adds a particpant to this node's allow list. Once an allow filter is established, all other participants who are not on the allow list will be unable to see this node or its children. For more information see DOM Filters.
void AddClass(string className)
Adds a class name to the space separated list of class names found on the Class property of this DOMObject.
void AddDeny(ParticipantExtended participant)
Adds a particpant to this node's deny list. This participant will be unable to see this node or its children. All other participants will be unaffected. For more information see DOM Filters.
void AudioEvent(string eventName, ParticipantExtended[] allowed = NULL, ParticipantExtended[] denied = NULL)
Sends a node event on this node named "AudioEvent" with the event name as the payload, optionally specifying an ad-hoc node filter
DOMObjectExtended Clone(DOMObjectExtended parentNode = NULL, bool forceEnable = false, bool forceVisible = false)
Clones this object and places it as a direct child of the specified parent object
DOMCurveExtended CreateCurve(string title = NULL, bool visible = true)
Creates a new DOMCurve object, optionally initially invisible, as a direct child of this object.
DOMCurveExtended CreateCurveFromJson(string json)
Creates a new DOMCurve object from the JSON Curve Definition, as a direct child of this object.
DOMTransformExtended CreateEmptyNode(bool visible = false)
Creates a simple DOMTransform object, optionally initially invisible, as a direct child of this object.
DOMObjectExtended CreateFromTemplate(Guid templateID, bool visible = true)
Creates an instance of the specified ObjectTemplate given its GUID templateID, optionally initially invisible, as a direct child of this object.
DOMObjectExtended CreateFromType(Guid typeID, bool visible = true)
Creates an instance of the specified ObjectType given its GUID object type ID, optionally initially invisible, as a direct child of this object.
DOMObjectExtended CreateHookpoint(string title, bool visible = false)
Creates a simple DOMHookPoint object, optionally initially invisible, as a direct child of this object.
DOMLightExtended CreateLight(Color32 color, float intensity = 1.0, DOMLightShadows shadowtype = DOMLightShadows.None, float shadowstrength = 1.0, JSVector3 position = NULL, JSVector3 rotation = NULL)
Creates a DOMLight object as a direct child of this object with the specified properties already set.
DOMObjectExtended CreateTitleNode(string title, int index, bool visible = false)
Creates a simple DOMTitle object, optionally initially invisible, as a direct child of this object.
DOMVolumeExtended CreateVolume(JSVector3 size)
Creates a simple DOMVolume object as a direct child of this object.
bool DeleteNode()
Removes this node from the DOM.
void EmptyAllowList()
Initializes an empty allow list, or clears an existing one. No participants will be able to see this node or it's children after this call (similar to Visible=false). For more information see DOM Filters.
DOMControllerExtended FindController()
Returns the first child DOMController object found in the document in which this object is a member, as long as that document is a persona document (essentially finds the root of an avatar starting from some other object in the avatar’s document). Not so good for finding bot controllers.
DOMObjectExtended FindNode(string name)
Find the first child node (recursive, deep search) with the specified name;
IEnumerable<DOMObjectExtended> FindNodes(string name)
Finds child nodes (recursive, deep search) with the specified name;
IEnumerable<DOMObjectExtended> FindNodesWithProperty(string propertyName)
Searches up the tree for the first DOMController. Better for finding bot controllers.
DOMControllerExtended FindParentController()
Searches up the hierarchy for a DOMController
void FireEvent(string name, string payload, ParticipantExtended[] allowed = NULL, ParticipantExtended[] denied = NULL)
Sends a named event and payload on this node, optionally specifying an ad-hoc node filter
ReturnType GetAttributeValue(string attributeName)
Looks for an attribute with the given name and returns its value. Attributes are like special properties placed on the DOM nodes and properties when they appear in an ObjectType definition. An ObjectType is a container for a small snippet of DOM which can be re-used at runtime to create instances of that same layout and inject it into a running document. Attributes placed on these object or properties can later be accessed on any instance of these objects or properties. Think of these like metadata “about” an object or property, rather than data describing the object instance itself.
IEnumerable<DOMObjectExtended> GetChildren()
Gets all direct children.
bool HasAttribute(string attributeName)
Checks to see if a given attribute exists on this object.
bool HasClass(string className)
Tests if the specified class name is found in the space separated list of class names found on the Class property of this DOMObject.
bool ListenOnChannel(int channelID, JSFlexibleFunction callback)
Starts listening for messages sent to this object from other scripts, or from client UI scripts. Callback will be called with (int channelID, string message, DOMObject source, DOMObject dest) describing the message. This is similar to System.ListenOnChannel but listens only for messages sent directly to this object.
void MakePermanent()
Dissassociates this object from your script (if it was associated) so it will not be cleaned up if your script restarts or shuts down. Also sets Temporary to false, ensuring that this object will be written to storage.
bool MatchesSelector(string selector)
Parses the specified CSS-style selector string and then tests itself (the current node) for a match.
DOMObjectExtended QuerySelector(string selector)
Parses the specified CSS-style selector string and then queries the DOM from this node down, looking for objects that match. Returns the first found object.
IEnumerable<DOMObjectExtended> QuerySelectorAll(string selector)
Parses the specified CSS-style selector string and then queries the DOM from this node down, looking for objects that match. Returns an array of found objects.
void RemoveAllow(ParticipantExtended participant)
Removes a particpant from this node's allow list. Note that even when the last person is removed from the allow list, no one will be able to see this node or its children until the allow list iself is removed. For more information see DOM Filters.
void RemoveAllowList()
Removes the entire allow list making this node and its children visible to everyone again. If you wish to have an allow list, but an empty one, call EmptyAllowList. For more information see DOM Filters.
void RemoveClass(string className)
Removes a class name from the space separated list of class names found on the Class property of this DOMObject.
void RemoveDeny(ParticipantExtended participant)
Removes a particpant from this node's deny list. This participant will be able to see this node and its children again. For more information see DOM Filters.
void RemoveDenyList()
Removes the entire deny list making this node and its children visible again to those participants who were on the list. For more information see DOM Filters.
bool SendMessage(int channel, string message, DOMObjectExtended source)
Sends a message on the specified script communication channel given another object as the source. Someone else having previously used ListenOnChannel could receive this message to their callback function.
void ToggleClass(string className)
Toggles a class name in the space separated list of class names found on the Class property of this DOMObject.

Methods (From Game Cloud)

DOMObjectExtended Instantiate(Guid objectTypeID)
Instantiates a new reference to the specified object type and adds it as a child of this DOM object