17#define MAX_MATERIAL_NAME_LENGTH 128
18#define MAX_NUMBER_SOUNDS 1024
19#define MAX_NUMBER_MATERIALS 64
20#define MAX_NUMBER_POLYGONS 2048
21#define MAX_FILENAME_LENGTH 2048
27typedef struct _vrpn_PoseDef {
28 vrpn_float64 position[3];
29 vrpn_float64 orientation[4];
32 position[0] = position[1] = position[2] = 0.0;
33 orientation[0] = orientation[1] = orientation[2] = 0.0;
38typedef struct _vrpn_SoundDef {
40 vrpn_float64 velocity[4];
64 { velocity[0] = velocity[1] = velocity[2] = velocity[3] = 0.0; };
68typedef struct _vrpn_ListenerDef {
70 vrpn_float64 velocity[4];
73typedef struct _vrpn_MaterialDef {
81typedef struct _vrpn_QuadDef {
85 vrpn_float64 vertices[4][3];
89typedef struct _vrpn_TriDef {
93 vrpn_float64 vertices[3][3];
138 struct timeval timestamp;
149 vrpn_int32 encodeSound_local(
const char *filename,
const vrpn_SoundID id,
153 vrpn_int32 decodeSound_local(
const char *buf,
char **filename,
158 vrpn_int32 encodeSound_remote(
const char *filename,
const vrpn_SoundID id,
160 vrpn_int32 decodeSound_remote(
const char *buf,
char **filename,
163 vrpn_int32 encodeSoundID(
const vrpn_SoundID id,
char *buf);
164 vrpn_int32 decodeSoundID(
const char *buf,
vrpn_SoundID *
id);
166 const vrpn_int32 repeat,
char *buf);
167 vrpn_int32 decodeSoundDef(
const char *buf,
vrpn_SoundDef *sound,
169 vrpn_int32 encodeSoundPlay(
const vrpn_SoundID id,
const vrpn_int32 repeat,
171 vrpn_int32 decodeSoundPlay(
const char *buf,
vrpn_SoundID *
id,
173 vrpn_int32 encodeListenerVelocity(
const vrpn_float64 *velocity,
char *buf);
174 vrpn_int32 decodeListenerVelocity(
const char *buf, vrpn_float64 *velocity);
175 vrpn_int32 encodeListenerPose(
const vrpn_PoseDef pose,
char *buf);
176 vrpn_int32 decodeListenerPose(
const char *buf,
vrpn_PoseDef *pose);
180 vrpn_int32 decodeSoundPose(
const char *buf,
vrpn_PoseDef *pose,
182 vrpn_int32 encodeSoundVelocity(
const vrpn_float64 *velocity,
184 vrpn_int32 decodeSoundVelocity(
const char *buf, vrpn_float64 *velocity,
186 vrpn_int32 encodeSoundDistInfo(
const vrpn_float64 min_back,
187 const vrpn_float64 max_back,
188 const vrpn_float64 min_front,
189 const vrpn_float64 max_front,
191 vrpn_int32 decodeSoundDistInfo(
const char *buf, vrpn_float64 *min_back,
192 vrpn_float64 *max_back,
193 vrpn_float64 *min_front,
195 vrpn_int32 encodeSoundConeInfo(
const vrpn_float64 cone_inner_angle,
196 const vrpn_float64 cone_outer_angle,
197 const vrpn_float64 cone_gain,
199 vrpn_int32 decodeSoundConeInfo(
const char *buf,
200 vrpn_float64 *cone_inner_angle,
201 vrpn_float64 *cone_outer_angle,
203 vrpn_int32 encodeSoundDoplerScale(
const vrpn_float64 doplerfactor,
205 vrpn_int32 decodeSoundDoplerScale(
const char *buf,
206 vrpn_float64 *doplerfactor,
208 vrpn_int32 encodeSoundEqFactor(
const vrpn_float64 eqfactor,
210 vrpn_int32 decodeSoundEqFactor(
const char *buf, vrpn_float64 *eqfactor,
212 vrpn_int32 encodeSoundPitch(
const vrpn_float64 pitch,
const vrpn_SoundID id,
214 vrpn_int32 decodeSoundPitch(
const char *buf, vrpn_float64 *pitch,
216 vrpn_int32 encodeSoundVolume(
const vrpn_float64 volume,
218 vrpn_int32 decodeSoundVolume(
const char *buf, vrpn_float64 *volume,
221 vrpn_int32 encodeLoadModel_local(
const char *filename,
char **buf);
222 vrpn_int32 decodeLoadModel_local(
const char *buf,
char **filename,
226 vrpn_int32 encodeLoadModel_remote(
const char *filename,
char **buf);
227 vrpn_int32 decodeLoadModel_remote(
const char *buf,
char **filename,
230 vrpn_int32 encodeLoadPolyQuad(
const vrpn_QuadDef quad,
char *buf);
231 vrpn_int32 decodeLoadPolyQuad(
const char *buf,
vrpn_QuadDef *quad);
232 vrpn_int32 encodeLoadPolyTri(
const vrpn_TriDef tri,
char *buf);
233 vrpn_int32 decodeLoadPolyTri(
const char *buf,
vrpn_TriDef *tri);
234 vrpn_int32 encodeLoadMaterial(
const vrpn_int32
id,
238 vrpn_int32 encodeSetQuadVert(
const vrpn_float64 vertices[4][3],
239 const vrpn_int32 tag,
char *buf);
240 vrpn_int32 decodeSetQuadVert(
const char *buf,
241 vrpn_float64 (*vertices)[4][3],
243 vrpn_int32 encodeSetTriVert(
const vrpn_float64 vertices[3][3],
244 const vrpn_int32 tag,
char *buf);
245 vrpn_int32 decodeSetTriVert(
const char *buf, vrpn_float64 (*vertices)[3][3],
247 vrpn_int32 encodeSetPolyOF(
const vrpn_float64 openingfactor,
248 const vrpn_int32 tag,
char *buf);
249 vrpn_int32 decodeSetPolyOF(
const char *buf, vrpn_float64 *openingfactor,
251 vrpn_int32 encodeSetPolyMaterial(
const char *material,
const vrpn_int32 tag,
253 vrpn_int32 decodeSetPolyMaterial(
const char *buf,
char **material,
254 vrpn_int32 *tag,
const int payload);
265 vrpn_int32 playSound(
const vrpn_SoundID id, vrpn_int32 repeat);
275 vrpn_int32 setSoundVolume(
const vrpn_SoundID id,
const vrpn_float64 volume);
276 vrpn_int32 setSoundPose(
const vrpn_SoundID id, vrpn_float64 position[3],
277 vrpn_float64 orientation[4]);
279 const vrpn_float64 velocity[4]);
281 const vrpn_float64 max_front_dist,
282 const vrpn_float64 min_front_dist,
283 const vrpn_float64 max_back_dist,
284 const vrpn_float64 min_back_dist);
286 const vrpn_float64 inner_angle,
287 const vrpn_float64 outer_angle,
288 const vrpn_float64 gain);
290 vrpn_int32 setSoundDopScale(
const vrpn_SoundID id, vrpn_float64 dopfactor);
291 vrpn_int32 setSoundEqValue(
const vrpn_SoundID id, vrpn_float64 eq_value);
292 vrpn_int32 setSoundPitch(
const vrpn_SoundID id, vrpn_float64 pitch);
294 vrpn_int32 setListenerPose(
const vrpn_float64 position[3],
295 const vrpn_float64 orientation[4]);
296 vrpn_int32 setListenerVelocity(
const vrpn_float64 velocity[4]);
298 vrpn_int32 LoadModel_local(
const char *filename);
301 vrpn_int32 LoadModel_remote(
const char *data);
305 vrpn_int32 LoadMaterial(
const vrpn_int32
id,
310 const vrpn_float64 transmittance_gain);
312 const vrpn_float64 transmittance_hf);
314 const vrpn_float64 reflectance_gain);
316 const vrpn_float64 reflectance_hf);
318 vrpn_int32 setPolyOF(
const int id,
const vrpn_float64 OF);
319 vrpn_int32 setQuadVertices(
const int id,
const vrpn_float64 vertices[4][3]);
320 vrpn_int32 setPolyMaterialName(
const int id,
const char *materialname);
322 vrpn_int32 setTriVertices(
const int id,
const vrpn_float64 vertices[3][3]);
326 virtual void receiveTextMessage(
const char *message, vrpn_uint32 type,
327 vrpn_uint32 level,
struct timeval msg_time);
332 handle_receiveTextMessage(
void *userdata,
const vrpn_TEXTCB t);
345#ifndef VRPN_CLIENT_ONLY
369 vrpn_float64 doplerfactor) = 0;
379 const vrpn_int32
id) = 0;
381 const vrpn_int32
id) = 0;
382 virtual void setPolyOF(vrpn_float64 OF, vrpn_int32 tag) = 0;
Class from which all user-level (and other) classes that communicate with vrpn_Connections should der...
virtual void mainloop()=0
Called once through each main loop iteration to handle updates. Remote object mainloop() should call ...
virtual int register_types(void)=0
Register the types of messages this device sends/receives. Return 0 on success, -1 on fail.
Generic connection class not specific to the transport mechanism.
vrpn_int32 setMaterialReflHF(const int id, const vrpn_float64 reflectance_hf)
vrpn_int32 setMaterialTransHF(const int id, const vrpn_float64 transmittance_hf)
vrpn_int32 setMaterialName(const int id, const char *materialname)
vrpn_int32 setMaterialTransGain(const int id, const vrpn_float64 transmittance_gain)
vrpn_int32 setMaterialReflGain(const int id, const vrpn_float64 reflectance_gain)
virtual void setSoundPitch(vrpn_SoundID id, vrpn_float64 pitch)=0
virtual void loadPolyTri(vrpn_TriDef *tri)=0
virtual void loadModelLocal(const char *filename)=0
virtual void loadModelRemote()=0
virtual void setSoundDoplerFactor(vrpn_SoundID id, vrpn_float64 doplerfactor)=0
virtual void loadSoundRemote(char *file, vrpn_SoundID id, vrpn_SoundDef soundDef)=0
virtual void setPolyQuadVertices(vrpn_float64 vertices[4][3], const vrpn_int32 id)=0
virtual void setSoundEqValue(vrpn_SoundID id, vrpn_float64 eqvalue)=0
virtual void setSoundVolume(vrpn_SoundID id, vrpn_float64 volume)=0
virtual void setPolyOF(vrpn_float64 OF, vrpn_int32 tag)=0
virtual void playSound(vrpn_SoundID id, vrpn_int32 repeat, vrpn_SoundDef soundDef)=0
virtual void setListenerVelocity(vrpn_float64 *velocity)=0
virtual void setSoundVelocity(vrpn_SoundID id, vrpn_float64 *velocity)=0
virtual void setListenerPose(vrpn_PoseDef pose)=0
virtual void setSoundConeInfo(vrpn_SoundID id, vrpn_float64 *coneinfo)=0
virtual void loadMaterial(vrpn_MaterialDef *material, vrpn_int32 id)=0
virtual void setSoundPose(vrpn_SoundID id, vrpn_PoseDef pose)=0
virtual void setSoundDistInfo(vrpn_SoundID id, vrpn_float64 *distinfo)=0
virtual void unloadSound(vrpn_SoundID id)=0
virtual void changeSoundStatus(vrpn_SoundID id, vrpn_SoundDef soundDef)=0
virtual void loadPolyQuad(vrpn_QuadDef *quad)=0
virtual void setPolyTriVertices(vrpn_float64 vertices[3][3], const vrpn_int32 id)=0
virtual void setPolyMaterial(const char *material, vrpn_int32 tag)=0
virtual void stopSound(vrpn_SoundID id)=0
virtual void loadSoundLocal(char *filename, vrpn_SoundID id, vrpn_SoundDef soundDef)=0
vrpn_int32 load_model_local
vrpn_int32 set_polyquad_vertices
vrpn_int32 set_sound_coneinfo
vrpn_int32 set_listener_pose
vrpn_int32 set_sound_pitch
vrpn_int32 set_sound_distanceinfo
vrpn_int32 load_sound_remote
vrpn_int32 set_sound_velocity
vrpn_int32 set_listener_velocity
vrpn_int32 load_model_remote
vrpn_int32 set_sound_doplerfactor
vrpn_int32 set_sound_volume
vrpn_int32 set_sound_pose
vrpn_int32 load_sound_local
vrpn_int32 change_sound_status
vrpn_int32 set_sound_eqvalue
vrpn_int32 set_poly_material
vrpn_int32 receive_text_message
vrpn_int32 set_poly_openingfactor
vrpn_int32 set_polytri_vertices
Allows a user to handle text messages directly, in addition to having the.
Allows a user to send text messages from a device (usually,.
This structure is what is passed to a vrpn_Connection message callback.
vrpn_float64 reflectance_highfreq
vrpn_float64 reflectance_gain
vrpn_float64 transmittance_gain
vrpn_float64 transmittance_highfreq
vrpn_float64 openingFactor
vrpn_float64 min_front_dist
vrpn_float64 equalization_val
vrpn_float64 cone_outer_angle
vrpn_float64 max_front_dist
vrpn_float64 cone_inner_angle
vrpn_float64 max_back_dist
vrpn_float64 dopler_scale
vrpn_float64 min_back_dist
Structure passed back to user-level code from a vrpn_Text_Receiver.
vrpn_float64 openingFactor
All types of client/server/peer objects in VRPN should be derived from the vrpn_BaseClass type descri...
#define MAX_MATERIAL_NAME_LENGTH