Today’s guest blog post is from Morris Ford, one of the most active members of the OWL developer community. In addition to working on integrating scripting with OWL, Morris has just published a new module that I think everyone will like. We’ll be demo’ing Morris’ work along with quite a few other new modules in this week’s Wonderland Wednesday session.
By Morris Ford
I recently added a Sitting Capability to the Wonderland Module Warehouse and to the module source repository that will allow your avatar to sit on a “chair.” To sit, you choose an object that has been enabled for sitting and, using either the context menu or a mouse click, your avatar automatically navigates to the object and sits on it.
Enabling an object for sitting
To enable an object for sitting involves adding the Sittable capability to that object.
After enabling sitting, the sitting position can be adjusted using the property sheet for the Sittable capability.
There are two sitting adjustments, Heading and Sit Offset. The Heading adjustment is for setting the rotation of the avatar in relation to the chair. The heading value is in degrees and is in relation to the sittable object. This means it will remain consistent even if you rotate the chair. The Sit Offset is an amount the avatar sits forward or backward in relation to the sittable object. This value is in meters and is relative to the center of the object. It is a value along the heading line and will remain consistent when the object is rotated. I have found that a setting of about 0.5 is appropriate for most chairs, although the chair in this example is rather deep, so a setting of 1 works best.
Note: In this version of the capability, you need to turn off collision on the chair object before sitting will work properly. To do this, select the “Model Component” capability and uncheck “Collision Enabled.”
Making the avatar sit on the object
There are two possible ways to make the avatar sit. One is through the object’s context menu and the other is by mouse click. The context menu is displayed by clicking on the object with the right mouse button. After sitting has been enabled on an object, you will see a “Sit Here” command appear in the context menu.
The other way to have the avatar sit is by using a mouse click. Click the “Enable Mouse” button in the Sittable property sheet.
Next, select which mouse command you wish to map to sitting. If you select “Middle Mouse,” for example, clicking on the chair with the middle mouse button will cause your avatar to navigate to the chair and sit.
For fun, walk a short distance away from your chair and select the “Chase Camera” from the View menu before you sit. There’s no special path following implemented yet, so be sure there are no obstacles in your avatar’s way before issuing a sit command.
- Morris Ford