|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectcom.vwp.vuapi.VUInterface
public abstract class VUInterface
The class VUConnection is the interface from an Java application to the Virtual Universe, it is the main entry point for the API. To access the functionality of the VU API the only class that is allowed to inherit from this one has to be used: VUConnection. It is available within the MainWin.jar archive that is required and has to be added to the classpath to access the API.
| Field Summary | |
|---|---|
String |
IP
|
int |
Mode
|
int |
Port
|
static int |
VU_API_MODE_3D_VIEW
Mode flags for the API: open a 3D view |
static int |
VU_API_MODE_DAEMON
Mode flags for the API: run completely in background |
static int |
VU_ERROR_CLIENT_VERSION
The clients version number and the one that is required by the server don't fit together, it should be updated to the latest MainWin.jar |
static int |
VU_ERROR_IO_ERROR
Return code: IO operation failed |
static int |
VU_ERROR_NO_GALAXY_AUTH
Return code: login-error; the user has no privilege to enter that galaxy |
static int |
VU_ERROR_NO_PLANET_AUTH
Return code: login-error; the user has no privilege to enter that planet |
static int |
VU_ERROR_NO_PRIVILEGE_FOR_OPERATION
The user doesn't has enough privileges for the operation |
static int |
VU_ERROR_NO_SOL_AUTH
Return code: login-error; the user has no privilege to enter that solar system |
static int |
VU_ERROR_NO_UNI_AUTH
Return code: login-error; the user has no privilege to enter that universe |
static int |
VU_ERROR_PASSWORD
Return code: login-error; the given password is wrong |
static int |
VU_ERROR_PROTOCOL_IO_ERROR
Return code: IO operation failure in protocol stack |
static int |
VU_ERROR_UNKNOWNHOST
Return code: socket-error, the specified hos is not known |
static int |
VU_ERROR_USER_BANNED
Return code: login-error; the user is banned |
static int |
VU_ERROR_USERNAME
Return code: the username doesn't exists or the user is already logged in |
static int |
VU_ERROR_WORLD_ID
Return code: login-error; the world doesn't exists |
static int |
VU_ERROR_WORLD_NA
Return code: login-error; the world is not available |
static int |
VU_ERROR_WORLD_RESTRICTED
Return code: the user has no privilege to enter the restrcted world |
static int |
VU_OK
Return code: everything is OK, operation performed successfully |
static int |
VU_USER_VISIBILITY_BRB
User visibility flag: user is currently away |
static int |
VU_USER_VISIBILITY_INVISIBLE
User visibility flag: user is invisible |
static int |
VU_USER_VISIBILITY_IRC
User visibility flag: user is connected from IRC |
| Constructor Summary | |
|---|---|
VUInterface(String IP,
int Port,
int Mode)
The main constructor for the VU API interface; although if IP and port number are required as parameter here it doesn't opens the connection to a server, that has be done with an explicit call to connect() |
|
| Method Summary | |
|---|---|
abstract void |
addCommunicationListener(VUCommunicationListener cListener)
Adds a listener to watch the communication of users within a world |
abstract void |
addObjectListener(VUObjectListener oListener)
Adds a listener to watch changes in the list of objects |
abstract void |
addPositionListener(VUPositionListener pListener)
Adds a listener to watch the changes in the positions of users within a world |
abstract void |
addUserListener(VUUserListener uListener)
Adds a listener to watch changes in the list of users within a world |
abstract void |
addWorldListener(VUWorldListener wListener)
Adds a listener to watch changes in the list of available worlds |
abstract int |
buildObject(VUObjectInfo obj)
This method has to be called to build a new object or to change a existing one. |
abstract void |
close()
Closes the connection to the Virtual Universe server and deinitializes everything |
abstract int |
connect(String UserName,
String Password)
Connects with the server that was specified using the IP and port number given during construction of this object. |
abstract int |
enterWorld(String Name)
Tries to log into a world after a successful connect() to a server. |
abstract String |
getAPIVersion()
Get the APIs version number |
abstract String |
getClientVersion()
Retrieve the client version number |
abstract void |
getPosition(javax.vecmath.Vector3d pos,
javax.vecmath.Point3f rot)
This version returns the current position and orientation of the robot using the both object handed over as parameter. |
abstract void |
modifyAudiotrack(NonSpatialSound audiotrack)
This method modifies an existing and already replaying non-spatial sound conform to the values that are handed over with the parameter. |
abstract javax.media.j3d.Canvas3D |
open3DView()
If the opject was created in mode VU_API_MODE_3D_VIEW, this method can be used to create and open the 3D View. |
abstract void |
queryObjects(double x,
double y,
double z,
double areaWidth)
Query for the objects that are available within a specific area. |
abstract void |
sendChatText(String text)
Sends a public chat text to te world currently logged in |
abstract void |
setPosition(javax.vecmath.Vector3d pos,
float angleY,
float eyeHeight,
String avatarURL)
Change the position of a robot that was connected to a server and logged into a world succesfully. |
abstract NonSpatialSound |
startAudiotrack(String FileURL,
double x,
double y,
double z,
double radius,
int volume)
The replaying of a non-spatial sound is started when the application has build-privileges. |
abstract void |
stopAudiotrack(NonSpatialSound audiotrack)
This method stops an existing and possibly replaying non-spatial sound. |
abstract boolean |
walkToPosition(javax.vecmath.Vector3d pos)
Tries to change the position of a robot that was connected to a server and logged into a world succesfully. |
| Methods inherited from class java.lang.Object |
|---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
public static final int VU_OK
public static final int VU_ERROR_UNKNOWNHOST
public static final int VU_ERROR_IO_ERROR
public static final int VU_ERROR_PROTOCOL_IO_ERROR
public static final int VU_ERROR_USERNAME
public static final int VU_ERROR_PASSWORD
public static final int VU_ERROR_USER_BANNED
public static final int VU_ERROR_WORLD_ID
public static final int VU_ERROR_NO_UNI_AUTH
public static final int VU_ERROR_NO_GALAXY_AUTH
public static final int VU_ERROR_NO_SOL_AUTH
public static final int VU_ERROR_NO_PLANET_AUTH
public static final int VU_ERROR_WORLD_RESTRICTED
public static final int VU_ERROR_WORLD_NA
public static final int VU_ERROR_CLIENT_VERSION
public static final int VU_ERROR_NO_PRIVILEGE_FOR_OPERATION
public static final int VU_API_MODE_DAEMON
public static final int VU_API_MODE_3D_VIEW
public static final int VU_USER_VISIBILITY_BRB
public static final int VU_USER_VISIBILITY_INVISIBLE
public static final int VU_USER_VISIBILITY_IRC
public String IP
public int Port
public int Mode
| Constructor Detail |
|---|
public VUInterface(String IP,
int Port,
int Mode)
IP - the IP of the server to connect withPort - the port number of the serverMode - VU_API_MODE_xxx flags that specify how the
application has to be executed| Method Detail |
|---|
public abstract void close()
public abstract javax.media.j3d.Canvas3D open3DView()
public abstract int connect(String UserName,
String Password)
UserName - the registerd username the robot has to usePassword - the password for that user
public abstract int enterWorld(String Name)
Name - the name of the world that has to be entered
public abstract void setPosition(javax.vecmath.Vector3d pos,
float angleY,
float eyeHeight,
String avatarURL)
pos - the position of the robot in unit mangleY - the orientation robot in unit degreeseyeHeight - the height of the robots view point (ist eyes) from
the groundavatarURL - the url of the avatars 3D-model that has to
be shown as the robots appearance. If null is handed
over here for every call of setPosition() the robot
will be invisible. If a avatar-model has to be specified
to make the robot visible as some kind of person, that
has to be done only once after logging into a world.
Otherwise the avatar-URL infomation is sent for every
call of setPosition() what causes high traffic and
slow movements of the robot.public abstract boolean walkToPosition(javax.vecmath.Vector3d pos)
pos - the position the robot has to walk to (in unit m)
public abstract void getPosition(javax.vecmath.Vector3d pos,
javax.vecmath.Point3f rot)
pos - the current poisiton is returned using this objectrot - with this object the robots oritenation is givenpublic abstract int buildObject(VUObjectInfo obj)
obj - the object that has to be build
public abstract String getClientVersion()
public abstract String getAPIVersion()
public abstract void sendChatText(String text)
text - the text that has to be send
public abstract void queryObjects(double x,
double y,
double z,
double areaWidth)
x - east-west coordinate of the center of the square that has to be queriedy - height coordinate of the center of the square that has to be queriedz - north-south coordinate of the center of the square that has to be
queried for objectsareaWidth - the length of the squares edge that has to be queried
IllegalArgumentException - when this method is called and no
VUObjectListener is specified to receive the results
public abstract NonSpatialSound startAudiotrack(String FileURL,
double x,
double y,
double z,
double radius,
int volume)
FileURL - the URL of the soundfile that has to be downloaded, please
refer to the documentation about the "audiotrack" object command for
a list of supported audio formatsx - the x position of the sound sourcey - the y position of the sound sourcez - the z position of the sound sourceradius - the radius of the area in meters that is influenced by this sound, the
volume of the sound output decreases with an increasing distance to its
center coordinates and is 0 at a distance of "radius" from the sound
sources coordinates; allowed values are in range of 1..100 mvolume - the volume of the sound at the center coordinates in percent,
here a range of 0..100% is allowed
IllegalArgumentException - if parameters with illegal values have been
handed overpublic abstract void modifyAudiotrack(NonSpatialSound audiotrack)
audiotrack - a NonSpatialSound object that contains the new parameters
of a sound; here the members x, y, z, radius and volume can be modified
before calling this method, all other values are ignoredpublic abstract void stopAudiotrack(NonSpatialSound audiotrack)
audiotrack - a NonSpatialSound object that identifies the sound that
has to be stoppedpublic abstract void addObjectListener(VUObjectListener oListener)
oListener - a VUObjectListener object used to watch the
world object changespublic abstract void addWorldListener(VUWorldListener wListener)
wListener - a VUWorldListener object used to watch the
world changespublic abstract void addUserListener(VUUserListener uListener)
uListener - a VUUserListener object used to watch the
user changespublic abstract void addCommunicationListener(VUCommunicationListener cListener)
cListener - a VUCommunicationListener object used to
watch the communicationpublic abstract void addPositionListener(VUPositionListener pListener)
pListener - a VUPositionListener object used to
watch the position changes
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||