Aw object select
Minimum requirements | ||
---|---|---|
Added in version 2.2 | ||
SDK | build 14 | |
World | build 21 | |
Browser | build 296 |
int aw_object_select (void)
Description
Simulates selecting an object.
Callback
None (returns immediately)
Notes
This method triggers AW_EVENT_OBJECT_SELECT in all the neighbor SDK applications that have subscribed to the event. It is intended for use by the Active Worlds Browser to indicate when a user selects an object (by right-clicking on it with the mouse). However it is also available for use by SDK applications which may wish to simulate user mouse actions for the purposes of testing, etc.
The object to be selected can be specified in two ways. This is the old method for doing it:
- AW_OBJECT_X is set to x coordinate of object (in cm's).
- AW_OBJECT_Z is set to z coordinate of object (in cm's).
- AW_OBJECT_NUMBER is set to object number (which is only unique to all objects within the same cell).
- AW_OBJECT_ID is set to 0.
There is also new method which was introduced in version 4.1:
- AW_OBJECT_X is not used.
- AW_OBJECT_Z is not used.
- AW_OBJECT_NUMBER is set to 0.
- AW_OBJECT_ID is set to the object id (which is unique to all objects within the world).
Arguments
None
Argument attributes
Return values
- RC_SUCCESS
- RC_NOT_INITIALIZED
- RC_NO_INSTANCE
- RC_NO_CONNECTION
- The connection to the world is down.
Returned attributes
None
Usage
Simulate a right-click on an object.
void select_object (int x, int z, int number) { int rc; aw_int_set (AW_OBJECT_ID, 0); aw_int_set (AW_OBJECT_NUMBER, number); aw_int_set (AW_OBJECT_X, x); aw_int_set (AW_OBJECT_Z, z); rc = aw_object_select (); if (rc != RC_SUCCESS) printf ("Object select failed (reason %d)\n", rc); }