RflySimSDK v3.05
RflySimSDK说明文档
载入中...
搜索中...
未找到
vrpn_ForceDeviceServer.h
1// vrpn_ForceDeviceServer.h: interface for the vrpn_ForceDeviceServer class.
2//
4
5#if !defined( \
6 AFX_VRPN_FORCEDEVICESERVER_H__E5B0D6FA_E426_45E5_97C7_B2169BEBF90A__INCLUDED_)
7#define AFX_VRPN_FORCEDEVICESERVER_H__E5B0D6FA_E426_45E5_97C7_B2169BEBF90A__INCLUDED_
8
9#include "vrpn_Configure.h" // for VRPN_CALLBACK, VRPN_API
10#include "vrpn_ForceDevice.h" // for vrpn_ForceDevice
11#include "vrpn_HashST.h" // for vrpn_Hash
12#include "vrpn_Types.h" // for vrpn_int32, vrpn_float32, etc
13
14class VRPN_API vrpn_Connection;
16
19 int m_ObjectType;
20 void *m_pObject;
21 void *m_pObjectMesh;
22
24
26
28public:
29 vrpn_ForceDeviceServer(const char *name, vrpn_Connection *c);
31
32protected:
33 static int VRPN_CALLBACK
34 handle_addObject_message(void *userdata, vrpn_HANDLERPARAM p);
35 static int VRPN_CALLBACK
36 handle_addObjectExScene_message(void *userdata, vrpn_HANDLERPARAM p);
37 static int VRPN_CALLBACK
38 handle_setVertex_message(void *userdata, vrpn_HANDLERPARAM p);
39 static int VRPN_CALLBACK
40 handle_setNormal_message(void *userdata, vrpn_HANDLERPARAM p);
41 static int VRPN_CALLBACK
42 handle_setTriangle_message(void *userdata, vrpn_HANDLERPARAM p);
43 static int VRPN_CALLBACK
44 handle_removeTriangle_message(void *userdata, vrpn_HANDLERPARAM p);
45 static int VRPN_CALLBACK
46 handle_updateTrimeshChanges_message(void *userdata, vrpn_HANDLERPARAM p);
47 static int VRPN_CALLBACK
48 handle_transformTrimesh_message(void *userdata, vrpn_HANDLERPARAM p);
49 static int VRPN_CALLBACK
50 handle_setTrimeshType_message(void *userdata, vrpn_HANDLERPARAM p);
51 static int VRPN_CALLBACK
52 handle_setObjectPosition_message(void *userdata, vrpn_HANDLERPARAM p);
53 static int VRPN_CALLBACK
54 handle_setObjectOrientation_message(void *userdata, vrpn_HANDLERPARAM p);
55 static int VRPN_CALLBACK
56 handle_setObjectScale_message(void *userdata, vrpn_HANDLERPARAM p);
57 static int VRPN_CALLBACK
58 handle_removeObject_message(void *userdata, vrpn_HANDLERPARAM p);
59 static int VRPN_CALLBACK
60 handle_moveToParent_message(void *userdata, vrpn_HANDLERPARAM p);
61 static int VRPN_CALLBACK
62 handle_setHapticOrigin_message(void *userdata, vrpn_HANDLERPARAM p);
63 static int VRPN_CALLBACK
64 handle_setHapticScale_message(void *userdata, vrpn_HANDLERPARAM p);
65 static int VRPN_CALLBACK
66 handle_setSceneOrigin_message(void *userdata, vrpn_HANDLERPARAM p);
67 static int VRPN_CALLBACK
68 handle_setObjectIsTouchable_message(void *userdata, vrpn_HANDLERPARAM p);
69 static int VRPN_CALLBACK
70 handle_clearTrimesh_message(void *userdata, vrpn_HANDLERPARAM p);
71 // Add an object to the haptic scene as root (parent -1 = default) or as
72 // child (ParentNum =the number of the parent)
73 virtual bool addObject(vrpn_int32 objNum, vrpn_int32 ParentNum = -1) = 0;
74 // Add an object next to the haptic scene as root
75 virtual bool addObjectExScene(vrpn_int32 objNum) = 0;
76 // vertNum normNum and triNum start at 0
77 virtual bool setVertex(vrpn_int32 objNum, vrpn_int32 vertNum,
78 vrpn_float32 x, vrpn_float32 y, vrpn_float32 z) = 0;
79 // NOTE: ghost doesn't take normals,
80 // and normals still aren't implemented for Hcollide
81 virtual bool setNormal(vrpn_int32 objNum, vrpn_int32 normNum,
82 vrpn_float32 x, vrpn_float32 y, vrpn_float32 z) = 0;
83 virtual bool setTriangle(vrpn_int32 objNum, vrpn_int32 triNum,
84 vrpn_int32 vert0, vrpn_int32 vert1,
85 vrpn_int32 vert2, vrpn_int32 norm0 = -1,
86 vrpn_int32 norm1 = -1, vrpn_int32 norm2 = -1) = 0;
87 virtual bool removeTriangle(vrpn_int32 objNum, vrpn_int32 triNum) = 0;
88 // should be called to incorporate the above changes into the
89 // displayed trimesh
90 virtual bool updateTrimeshChanges(vrpn_int32 objNum, vrpn_float32 kspring,
91 vrpn_float32 kdamp, vrpn_float32 fdyn,
92 vrpn_float32 fstat) = 0;
93 // set trimesh type
94 virtual bool setTrimeshType(vrpn_int32 objNum, vrpn_int32 type) = 0;
95 // set the trimesh's homogen transform matrix (in row major order)
96 virtual bool setTrimeshTransform(vrpn_int32 objNum,
97 vrpn_float32 homMatrix[16]) = 0;
98 // set position of an object
99 virtual bool setObjectPosition(vrpn_int32 objNum, vrpn_float32 Pos[3]) = 0;
100 // set orientation of an object
101 virtual bool setObjectOrientation(vrpn_int32 objNum, vrpn_float32 axis[3],
102 vrpn_float32 angle) = 0;
103 // set Scale of an object
104 virtual bool setObjectScale(vrpn_int32 objNum, vrpn_float32 Scale[3]) = 0;
105 // remove an object from the scene
106 virtual bool removeObject(vrpn_int32 objNum) = 0;
107 virtual bool clearTrimesh(vrpn_int32 objNum) = 0;
108
111 // Change The parent of an object
112 virtual bool moveToParent(vrpn_int32 objNum, vrpn_int32 ParentNum) = 0;
113 // Set the Origin of the haptic scene
114 virtual bool setHapticOrigin(vrpn_float32 Pos[3], vrpn_float32 axis[3],
115 vrpn_float32 angle) = 0;
116 // Set the Scale factor of the haptic scene
117 virtual bool setHapticScale(vrpn_float32 Scale) = 0;
118 // Set the Origin of the haptic scene
119 virtual bool setSceneOrigin(vrpn_float32 Pos[3], vrpn_float32 axis[3],
120 vrpn_float32 angle) = 0;
121 // make an object touchable or not
122 virtual bool setObjectIsTouchable(vrpn_int32 objNum,
123 vrpn_bool IsTouchable = true) = 0;
124
125protected:
126 vrpn_DISPLAYABLEHASH m_hObjectList;
127};
128
129#endif // !defined(AFX_VRPN_FORCEDEVICESERVER_H__E5B0D6FA_E426_45E5_97C7_B2169BEBF90A__INCLUDED_)
Generic connection class not specific to the transport mechanism.
定义 vrpn_Connection.h:562
定义 vrpn_ForceDeviceServer.h:27
virtual bool moveToParent(vrpn_int32 objNum, vrpn_int32 ParentNum)=0
定义 vrpn_ForceDevice.h:39
Hash class (not thread-safe)
定义 vrpn_HashST.h:32
定义 vrpn_ForceDeviceServer.h:18
This structure is what is passed to a vrpn_Connection message callback.
定义 vrpn_Connection.h:41