CAVERN support template base avatar manager class
![]() | applyToAllAvatars (int (*userFunc)(long avatarID, CAVERNst_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 |
![]() | CAVERNst_baseAvatarManager_c () Constructor. |
![]() | init (char* applicationName, CAVERN_irb_c *theIrb, CAVERN_irbId_c *avatarIrbServer, int trackerDataSize, int helloDataSize, int auxDataSize) Initialize Avatar Manager |
![]() | sendAux () Sending the aux data. |
![]() | sendBye () Send bye message to all clients. |
![]() | sendHello () Sending the hello data. |
![]() | sendTracker () Sending the tracker data. |
![]() | setAuxData (char *aux) Set the aux data that you wish to send out. Use sendHello() to dispatch the data. |
![]() | setAvatarAuxCallback (void (*cb)(CAVERNst_baseAvatar_c *)) When avatar auxiliary data has arrived your callback. |
![]() | setAvatarExitCallback (void (*cb)(CAVERNst_baseAvatar_c *)) If an avatar has left call your callback. |
![]() | setAvatarHelloChangeCallback (void (*cb)(CAVERNst_baseAvatar_c *)) When avatar hello data has changed call your callback. |
![]() | setAvatarTrackerCallback (void (*cb)(CAVERNst_baseAvatar_c *)) 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. |
![]() | setNewAvatarCallback (void (*cb)(CAVERNst_baseAvatar_c *)) When a new avatar arrives call your callback. |
![]() | setTrackerData (char *tracker) Set the tracker data that you wish to send out. Use sendTracker() to dispatch the data. |
![]() | setTrackerUpdateDelay (double delay) Set how often tracker data is sent |
![]() | ~CAVERNst_baseAvatarManager_c () Delete the avatar manager and also tell other clients that you have left |
CAVERN support template base avatar manager class. 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, IRB addresses 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.
The user function should be of the form:
int userFunc(long avatarID, CAVERNst_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.
void applyToAllAvatars(int (*userFunc)(long avatarID, CAVERNst_baseAvatar_c *, void *inParam1, void *inParam2, void *inParam3, void *& retParam), void *inParam1, void *inParam2, void *inParam3, void *& inOutParam)
void setTrackerUpdateDelay(double delay)
this page has been generated automatically by doc++
(c)opyright by Malte Zöckler, Roland Wunderling
contact: doc++@zib.de