2.5. The Object Node

The object node acts as the root for data storage in Verse's data model. Its purpose is to represent "objects" in a virtual world. All data in nodes of other types goes unused unless it is connected to a tree rooted in an object node. The object node itself does not hold much actual data, but it provides a transform and various other features.

2.5.1. Links

The object node has the ability to link to other nodes, specifying different properties (geometry, materials, associated scripts and so son) of the represented object. Multiple object nodes may all link to the same geometry node, to share the data and thus create several identical copies of an object.

Links are unidirectional, going from an object node and to the link target which can be a node of any type. Links have textual labels, which are used to denote the purpose of the link (for instance, the main geometry link from an object node to a geometry node is labelled "geometry"). Link labels need not be unique; there can be several links sharing a single label. There is also an integer field in the link definition, called target. This field is used to refer to some part of the source or destination node.

These are the currently defined standard link labels, with their use:

child

Links to a child object, that resides in the parent node's coordinate space. This is used to define hierarchical transform graphs. The target should be set to the numerical ID of the bone to which the child is to be attached, or the special value ~0 (4,294,967,295) to indicate that the child resides at the root of the parent's transform. It is valid to link to the same object from several different parent objects. Transform hierarchies, however, cannot include circular links (a node cannot be its own child, at any level). It is not guaranteed that a Verse host will not send out circular links, however. Clients need to be careful when parsing the child link data.

geometry

The object's geometry. The referenced node, which should really be a geometry node, defines the object's geometry in the world. The geometry will be translated to the object's position, rotated, scaled, and also given any defined material. This link type does not use the target field.

light

This specifies how light is emitted by the object. The referenced node should be a geometry node, and it defines the shape of the light source. Each polygon of the geometry is taken to be an area light. At the time of writing, no known renderer supports light links.

material

The object's material. The referenced node, which should really be a material node, defines the material to apply to the surface of the object during rendering. There can be more than one such link, for objects that need more than one material. They are then all given the label material, and assigned unique target values. A face integer layer named material is then added to the geometry, and populated with integers from the set of target values to pick one of the available materials for each of the faces.

2.5.2. Transform

The object node holds a full 3D transform, with translation, rotation and scaling components that are used to orient the object in the world. The first two of these properties are modeled not only with absolute values, but also with time derivatives i.e. speed and acceleration. There is also support for expressing drag, allowing basic friction to be modeled.

For each of these properties, the value is calculated by a 3D vector equation like the following:

Here, the symbol p is used to represent the transform property of interest, p0 is the last known absolute position, v0 the set initial speed, a the acceleration, and drag a friction term. The position is a function of the time, t, and thus it is possible to extrapolate into the future from the last known values of the various parameters. The equation is the same for both position and rotation of an object. Verse does not currently provide support for extrapolating the scale part of an object's transform.

Hosts will maintain values of an object's transform using fairly high numerical precision, but it is possible for a client to request a lower precision to conserve bandwidth.

The object node is the only node to provide a transform. Other types of data that need to be associated to a point in space need to do so by being linked from an object node at the required position.

2.5.3. Light Sources

Every object node has the ability to become a light source and light the world. A light source on an object is simply defined by giving it three floating point values that determine how much light is emitted in each of the primary colors red, green and blue. These values are interpreted so that a perpendicular surface at a distance of 1.0 unit from a light source whose intensity (in any color) is 1.0 gets a light level of 1.0 (as "seen" by a material node's light fragment, that is).

By default, the light intensity is set to 0.0 for all three colors. This means that no light is emitted.

The light described here is a simple "point light", with an equal amount of light being emitted in each direction spherically, centered on the object's position. To create a more sophisticated light, create a link to a geometry node and label it "light". This has the semantics of defining an area light, which only emits light from the faces of the geometry.

2.5.4. Methods

The object node has the ability to hold custom entry points, known as methods. Methods are like procedures in a programming language, they are a representation of the abstract concept of a named action that takes a set of parameters and can be executed (called) at will. Methods are arranged in the node into a number of named groups. They do not have return values, and are thus asynchronous in nature.

Once created, method calls can be emitted by any client and any client is free to respond to a method being called. This mechanism allows clients to create representations of their interfaces inside the world held on the host.

2.5.5. Animation

Object nodes can be animated. Animation is expressed in the data model by creating bones in the object's geometry node, and also one or more curve nodes. Once the data is in place, you can instruct the object node to run the animation.

2.5.6. Hiding

Object nodes can be selectively hidden. Hiding an object makes it invisible in the 3D world. This is useful to cut down on latency and round-trips, by pre-defining content which can then be rapidly made visible by just un-hiding the root object node.