template <class avatarType> class CAVERN_baseAvatarManager_c CAVERN base avatar manager class
|
| CAVERN_baseAvatarManager_c () Constructor. |
| | init (char* serverIP, int hailingPort, int trackerPort, int trackerDataSize, int helloDataSize, int auxDataSize) Initialize Avatar Manager |
|
| ~CAVERN_baseAvatarManager_c () Delete the avatar manager and also tell other clients that you have left |
|
| garbageCollect () Performed by process() to purge avatars that disconnected abnormally. |
| | process () Do avatar management |
| | applyToAllAvatars (int (*userFunc)(long avatarID, CAVERN_baseAvatar_c *, void *inParam1, void *inParam2, void *inParam3, void *& retParam), void *inParam1, void *inParam2, void *inParam3, void *& inOutParam) Apply a user function to all the avatars |
| | setNewAvatarCallback (void (*cb)(CAVERN_baseAvatar_c *, void* ), void* param) When a new avatar arrives call your callback |
| | setAvatarHelloChangeCallback (void (*cb)(CAVERN_baseAvatar_c *, void*), void* param) When avatar hello data has changed call your callback |
| | setAvatarAuxCallback (void (*cb)(CAVERN_baseAvatar_c *, void*), void* param) When avatar auxiliary data has arrived your callback |
| | setAvatarExitCallback (void (*cb)(CAVERN_baseAvatar_c *, void*), void* param) If an avatar has left call your callback |
| | setAvatarTrackerCallback (void (*cb)(CAVERN_baseAvatar_c *, void*), void* param) If a new packet of tracker data arrives call your callback |
|
| setHelloData (char *hello) Set the hello data that you wish to send out. Use sendHello() to dispatch the data. |
|
| setAuxData (char *aux) Set the aux data that you wish to send out. Use sendHello() to dispatch the data. |
|
| setTrackerData (char *tracker) Set the tracker data that you wish to send out. Use sendTracker() to dispatch the data. |
|
| sendHello () Sending the hello data. |
|
| sendAux () Sending the aux data. |
| | setTrackerUpdateDelay (double delay) Set how often tracker data is sent |
|
| sendTracker () Sending the tracker data. |
|
| sendBye () Send bye message to all clients. |
| | initPerformanceMonitoring () Starts up performance monitoring |
|
| doPerformanceMonitoring () Updates performance statistics based on the time |
|
| endPerformanceMonitoring () Cleans up performance monitoring by closing the logfile. |
CAVERN base avatar manager class. This is a template class. You create a special manager for your special brand of avatar. Basically the manager handles the entry and exit of avatars. It leaves the specialized management of graphics to the callbacks in the API.This manages avatars that connect and disconnect from your client. Begin by creating a single manager and then initializing it with init(). Then set the hello data you wish to send and call sendHello(). Everytime you wish to send a tracker packet, package the tracker data you want to send, call setTrackerData() and then call sendTracker(). When you want to tell everyone you are leaving call: sendBye() or simply delete your avatar manager object. Similary to send auxiliary data call setAuxData() followed by sendAux();
Note: nothing is implied in the format of the tracker, hello, or aux data. This is done intentionally so that you can bundle whatever you want in it. Then you can build higher level avatar classes on top of this or extend this avatar class by adding things that are specific to say OpenGL or Performer.
For example, tracker data could be an array of floats containing an avatar's body position, orientation etc. Hello data could consist of information about an avatar's color, size, filenames for 3D models, database path/name information, and keys to find 3D models, etc. Aux data could be intermittent chat text messages sent between avatars.
Hello and aux data are sent via reliable channels. The tracker data are sent via unreliable channels.
Network performance can be monitored automatically by the avatar manager. This is done using the internal performance monitoring capabilities of CAVERNsoft. The methods for activating and stopped performance monitoring are called automatically by the class, and specific details are available through the use of environment variables. To disable performance monitoring, simply unset the environment variables.
AVATAR_PERFMON_DAEMON IP address to send statistics
AVATAR_PERFMON_UDP seconds to wait between logging tracking data
AVATAR_PERFMON_TCP seconds to wait between loggin hailing data
AVATAR_PERFMON_LOGFILE name of a logfile to store statistics
The user function should be of the form:
int userFunc(long avatarID, CAVERN_baseAvatar_c *eachAvatar,
void* inParam1, void* inParam2,
void* inParam3, void *& retParam) eachAvatar is a pointer to each of the avatar class object. The inParams are designed for you to pass your application data into
the function. The retParam can be used to pass in as well as return a value to your
application. E.g. within the userFunc you could set retParam = (void*) somePointer;
return 0; somePointer will then be returned back to the applyToAllAvatars()
member function in the parameter inOutParam.
AVATAR_PERFMON_DAEMON
AVATAR_PERFMON_UDP
AVATAR_PERFMON_TCP
AVATAR_PERFMON_LOGFILE
void process()
void applyToAllAvatars(int (*userFunc)(long avatarID, CAVERN_baseAvatar_c *, void *inParam1, void *inParam2, void *inParam3, void *& retParam), void *inParam1, void *inParam2, void *inParam3, void *& inOutParam)
void setNewAvatarCallback(void (*cb)(CAVERN_baseAvatar_c *, void* ), void* param)
void setAvatarHelloChangeCallback(void (*cb)(CAVERN_baseAvatar_c *, void*), void* param)
void setAvatarAuxCallback(void (*cb)(CAVERN_baseAvatar_c *, void*), void* param)
void setAvatarExitCallback(void (*cb)(CAVERN_baseAvatar_c *, void*), void* param)
void setAvatarTrackerCallback(void (*cb)(CAVERN_baseAvatar_c *, void*), void* param)
void setTrackerUpdateDelay(double delay)
void initPerformanceMonitoring()
alphabetic index hierarchy of classes
this page has been generated automatically by doc++
(c)opyright by Malte Zöckler, Roland Wunderling
contact: doc++@zib.de