45#ifndef CAlgorithmFingerProxyH
46#define CAlgorithmFingerProxyH
Implements a base class for programming collision detectors that identify intersections between segme...
Implements a base class for force rendering algorithms.
This class implements a finger-proxy force rendering algorithm.
Definition CAlgorithmFingerProxy.h:87
cAlgorithmFingerProxy()
Constructor of cAlgorithmFingerProxy.
Definition CAlgorithmFingerProxy.cpp:59
bool m_useDynamicProxy
If true the the dynamic proxy is enabled to handle moving objects.
Definition CAlgorithmFingerProxy.h:171
cVector3d m_lastGlobalForce
Last computed force (in global coordinate frame).
Definition CAlgorithmFingerProxy.h:243
double m_radius
Radius of the proxy.
Definition CAlgorithmFingerProxy.h:261
cVector3d getForce()
This method returns the last computed force in world coordinates.
Definition CAlgorithmFingerProxy.h:135
cVector3d surfaceNormal
Surface normal.
Definition CAlgorithmFingerProxy.h:341
bool computeNextProxyPositionWithContraints1(const cVector3d &a_goalGlobalPos)
This method updates the position of the proxy - constraint 1.
Definition CAlgorithmFingerProxy.cpp:579
void setEpsilonBaseValue(double a_value)
This method sets the epsilon tolerance error base value.
Definition CAlgorithmFingerProxy.cpp:184
unsigned int m_algoCounter
Value of state machine.
Definition CAlgorithmFingerProxy.h:309
bool m_slipping
If true then we are currently in a "slip friction".
Definition CAlgorithmFingerProxy.h:249
cVector3d getTangentialForce()
This method returns the most recently calculated tangential force.
Definition CAlgorithmFingerProxy.h:141
double getProxyRadius() const
This method returns the radius of the proxy.
Definition CAlgorithmFingerProxy.h:123
virtual cVector3d computeForces(const cVector3d &a_toolPos, const cVector3d &a_toolVel)
This method calculates the interaction forces.
Definition CAlgorithmFingerProxy.cpp:204
cVector3d m_contactPointLocalPos0
Local position of contact point first object.
Definition CAlgorithmFingerProxy.h:280
int getNumCollisionEvents()
This method return the number of collision events (0, 1, 2 or 3):
Definition CAlgorithmFingerProxy.h:151
cVector3d m_proxyGlobalPos
Global position of the proxy.
Definition CAlgorithmFingerProxy.h:237
double getEpsilonBaseValue()
This method returns the current epsilon tolerance error base value.
Definition CAlgorithmFingerProxy.h:198
cCollisionEvent * m_collisionEvents[3]
Table of collision events (0-3). Call getNumCollisionEvents() to see how many are actually valid.
Definition CAlgorithmFingerProxy.h:161
bool computeNextProxyPositionWithContraints0(const cVector3d &a_goalGlobalPos)
This method updates the position of the proxy - constraint 0.
Definition CAlgorithmFingerProxy.cpp:408
virtual void testFrictionAndMoveProxy(const cVector3d &a_goal, const cVector3d &a_proxy, cVector3d &a_normal, cGenericObject *a_parent)
This method attempts to move the proxy, subject to friction constraints.
Definition CAlgorithmFingerProxy.cpp:945
cCollisionSettings m_collisionSettings
Collision settings.
Definition CAlgorithmFingerProxy.h:185
cVector3d m_normalForce
Normal force.
Definition CAlgorithmFingerProxy.h:252
cVector3d m_contactPointLocalPos2
Local position of contact point first object.
Definition CAlgorithmFingerProxy.h:286
void setProxyRadius(const double &a_radius)
This method sets the radius of the proxy.
Definition CAlgorithmFingerProxy.h:120
cCollisionRecorder m_collisionRecorderConstraint2
Collision detection recorder for searching third constraint.
Definition CAlgorithmFingerProxy.h:277
bool computeNextProxyPositionWithContraints2(const cVector3d &a_goalGlobalPos)
This method updates the position of the proxy - constraint 2.
Definition CAlgorithmFingerProxy.cpp:754
cVector3d getDeviceGlobalPosition() const
This method returns the last specified position of the device in world coordinates.
Definition CAlgorithmFingerProxy.h:132
cVector3d getNormalForce()
This method returns the most recently calculated normal force.
Definition CAlgorithmFingerProxy.h:138
cVector3d m_deviceGlobalPos
Global position of device.
Definition CAlgorithmFingerProxy.h:240
void reset()
This method reset the algorithm and sets the proxy position to the device position.
Definition CAlgorithmFingerProxy.cpp:159
cVector3d getProxyGlobalPosition() const
This method returns the last computed position of the proxy in world coordinates.
Definition CAlgorithmFingerProxy.h:126
double m_frictionDynHysteresisMultiplier
Definition CAlgorithmFingerProxy.h:179
double m_forceShadingAngleThreshold
Maximum force shading angle (radians) threshold between normals of triangle.
Definition CAlgorithmFingerProxy.h:182
double m_epsilonCollisionDetection
Epsilon value - used for handling numerical limits.
Definition CAlgorithmFingerProxy.h:300
double m_epsilonMinimalValue
Epsilon value - used for handling numerical limits.
Definition CAlgorithmFingerProxy.h:306
double m_epsilonInitialValue
Epsilon value - used for handling numerical limits.
Definition CAlgorithmFingerProxy.h:294
cCollisionRecorder m_collisionRecorderConstraint0
Collision detection recorder for searching first constraint.
Definition CAlgorithmFingerProxy.h:271
virtual void computeNextBestProxyPosition(const cVector3d &a_goal)
This method computes the next goal position of the proxy.
Definition CAlgorithmFingerProxy.cpp:248
void initialize(cWorld *a_world, const cVector3d &a_initialGlobalPosition)
This method initialize the algorithm.
Definition CAlgorithmFingerProxy.cpp:130
cCollisionRecorder m_collisionRecorderConstraint1
Collision detection recorder for searching second constraint.
Definition CAlgorithmFingerProxy.h:274
virtual void render(cRenderOptions &a_options)
This method renders the force algorithms graphically in OpenGL. (For debug purposes)
Definition CAlgorithmFingerProxy.cpp:1450
cVector3d m_nextBestProxyGlobalPos
Next best position for the proxy (in global coordinate frame).
Definition CAlgorithmFingerProxy.h:246
double m_epsilon
Epsilon value - used for handling numerical limits.
Definition CAlgorithmFingerProxy.h:297
cVector3d m_tangentialForce
Tangential force.
Definition CAlgorithmFingerProxy.h:255
double m_epsilonBaseValue
Epsilon value - used for handling numerical limits.
Definition CAlgorithmFingerProxy.h:303
virtual bool goalAchieved(const cVector3d &a_proxy, const cVector3d &a_goal) const
This method tests whether the proxy has reached the goal point.
Definition CAlgorithmFingerProxy.cpp:927
cVector3d m_contactPointLocalPos1
Local position of contact point first object.
Definition CAlgorithmFingerProxy.h:283
void setProxyGlobalPosition(const cVector3d &a_position)
This method sets the position of the proxy in world coordinates.
Definition CAlgorithmFingerProxy.h:129
void adjustDynamicProxy(const cVector3d &a_goal)
This method ajust the position of proxy by taking into account motion of objects in the world.
Definition CAlgorithmFingerProxy.cpp:329
virtual void updateForce()
This method computes the resulting force which will be sent to the haptic device.
Definition CAlgorithmFingerProxy.cpp:1073
unsigned int m_numCollisionEvents
Number of collision events between proxy and triangles (0, 1, 2 or 3).
Definition CAlgorithmFingerProxy.h:258
virtual ~cAlgorithmFingerProxy()
Destructor of cAlgorithmFingerProxy.
Definition CAlgorithmFingerProxy.h:98
cVector3d computeShadedSurfaceNormal(cCollisionEvent *a_contactPoint)
This method computes the local surface normal from interpolated vertex normals.
Definition CAlgorithmFingerProxy.cpp:1345
This class implements a collision detection recorder that stores all collision events that are report...
Definition CCollisionBasics.h:186
This class implements a base class for modeling force rendering algorithms.
Definition CGenericForceAlgorithm.h:85
This class implements a base class for all 2D or 3D objects in CHAI3D.
Definition CGenericObject.h:113
This class implements a virtual world.
Definition CWorld.h:93
Definition CAudioBuffer.cpp:57
This structure stores the data related to a collision event.
Definition CCollisionBasics.h:92
This structure stores the collision settings that are passed to a collision detector when querying fo...
Definition CCollisionBasics.h:243
double m_collisionRadius
Collision radius. This value typically corresponds to the radius of the virtual tool or cursor.
Definition CCollisionBasics.h:275
This structures provide a containers for storing rendering options that are passed through the sceneg...
Definition CRenderOptions.h:83
This class implements a 3D vector.
Definition CVector3d.h:89