This class implements a finger-proxy force rendering algorithm. More...
#include <CAlgorithmFingerProxy.h>
Public Member Functions | |
cAlgorithmFingerProxy () | |
Constructor of cAlgorithmFingerProxy. More... | |
virtual | ~cAlgorithmFingerProxy () |
Destructor of cAlgorithmFingerProxy. More... | |
void | initialize (cWorld *a_world, const cVector3d &a_initialGlobalPosition) |
This method initialize the algorithm. More... | |
void | reset () |
This method reset the algorithm and sets the proxy position to the device position. More... | |
virtual cVector3d | computeForces (const cVector3d &a_toolPos, const cVector3d &a_toolVel) |
This method calculates the interaction forces. More... | |
void | setProxyRadius (const double &a_radius) |
This method sets the radius of the proxy. More... | |
double | getProxyRadius () const |
This method returns the radius of the proxy. More... | |
cVector3d | getProxyGlobalPosition () const |
This method returns the last computed position of the proxy in world coordinates. More... | |
void | setProxyGlobalPosition (const cVector3d &a_position) |
This method sets the position of the proxy in world coordinates. More... | |
cVector3d | getDeviceGlobalPosition () const |
This method returns the last specified position of the device in world coordinates. More... | |
cVector3d | getForce () |
This method returns the last computed force in world coordinates. More... | |
cVector3d | getNormalForce () |
This method returns the most recently calculated normal force. More... | |
cVector3d | getTangentialForce () |
This method returns the most recently calculated tangential force. More... | |
int | getNumCollisionEvents () |
This method return the number of collision events (0, 1, 2 or 3): More... | |
void | setEpsilonBaseValue (double a_value) |
This method sets the epsilon tolerance error base value. More... | |
double | getEpsilonBaseValue () |
This method returns the current epsilon tolerance error base value. More... | |
Public Member Functions inherited from chai3d::cGenericForceAlgorithm | |
cGenericForceAlgorithm () | |
Constructor of cGenericForceAlgorithm. More... | |
virtual | ~cGenericForceAlgorithm () |
Destructor of cGenericForceAlgorithm. More... | |
cWorld * | getWorld () |
This method returns a pointer to the world in which the force algorithm is operating. More... | |
void | setShowEnabled (bool a_showEnabled) |
bool | getShowEnabled () |
Public Attributes | |
cCollisionEvent * | m_collisionEvents [3] |
Table of collision events (0-3). Call getNumCollisionEvents() to see how many are actually valid. More... | |
bool | m_useDynamicProxy |
If true the the dynamic proxy is enabled to handle moving objects. More... | |
double | m_frictionDynHysteresisMultiplier |
double | m_forceShadingAngleThreshold |
Maximum force shading angle (radians) threshold between normals of triangle. More... | |
cCollisionSettings | m_collisionSettings |
Collision settings. More... | |
Protected Member Functions | |
virtual void | render (cRenderOptions &a_options) |
This method renders the force algorithms graphically in OpenGL. (For debug purposes) More... | |
virtual bool | goalAchieved (const cVector3d &a_proxy, const cVector3d &a_goal) const |
This method tests whether the proxy has reached the goal point. More... | |
virtual void | computeNextBestProxyPosition (const cVector3d &a_goal) |
This method computes the next goal position of the proxy. More... | |
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. More... | |
virtual void | updateForce () |
This method computes the resulting force which will be sent to the haptic device. More... | |
void | adjustDynamicProxy (const cVector3d &a_goal) |
This method ajust the position of proxy by taking into account motion of objects in the world. More... | |
bool | computeNextProxyPositionWithContraints0 (const cVector3d &a_goalGlobalPos) |
This method updates the position of the proxy - constraint 0. More... | |
bool | computeNextProxyPositionWithContraints1 (const cVector3d &a_goalGlobalPos) |
This method updates the position of the proxy - constraint 1. More... | |
bool | computeNextProxyPositionWithContraints2 (const cVector3d &a_goalGlobalPos) |
This method updates the position of the proxy - constraint 2. More... | |
cVector3d | computeShadedSurfaceNormal (cCollisionEvent *a_contactPoint) |
This method computes the local surface normal from interpolated vertex normals. More... | |
Protected Attributes | |
cVector3d | m_proxyGlobalPos |
Global position of the proxy. More... | |
cVector3d | m_deviceGlobalPos |
Global position of device. More... | |
cVector3d | m_lastGlobalForce |
Last computed force (in global coordinate frame). More... | |
cVector3d | m_nextBestProxyGlobalPos |
Next best position for the proxy (in global coordinate frame). More... | |
bool | m_slipping |
If true then we are currently in a "slip friction". More... | |
cVector3d | m_normalForce |
Normal force. More... | |
cVector3d | m_tangentialForce |
Tangential force. More... | |
unsigned int | m_numCollisionEvents |
Number of collision events between proxy and triangles (0, 1, 2 or 3). More... | |
double | m_radius |
Radius of the proxy. More... | |
cCollisionRecorder | m_collisionRecorderConstraint0 |
Collision detection recorder for searching first constraint. More... | |
cCollisionRecorder | m_collisionRecorderConstraint1 |
Collision detection recorder for searching second constraint. More... | |
cCollisionRecorder | m_collisionRecorderConstraint2 |
Collision detection recorder for searching third constraint. More... | |
cVector3d | m_contactPointLocalPos0 |
Local position of contact point first object. More... | |
cVector3d | m_contactPointLocalPos1 |
Local position of contact point first object. More... | |
cVector3d | m_contactPointLocalPos2 |
Local position of contact point first object. More... | |
double | m_epsilonInitialValue |
Epsilon value - used for handling numerical limits. More... | |
double | m_epsilon |
Epsilon value - used for handling numerical limits. More... | |
double | m_epsilonCollisionDetection |
Epsilon value - used for handling numerical limits. More... | |
double | m_epsilonBaseValue |
Epsilon value - used for handling numerical limits. More... | |
double | m_epsilonMinimalValue |
Epsilon value - used for handling numerical limits. More... | |
unsigned int | m_algoCounter |
Value of state machine. More... | |
cVector3d | surfaceNormal |
Surface normal. More... | |
Protected Attributes inherited from chai3d::cGenericForceAlgorithm | |
cWorld * | m_world |
Pointer to the world in which the force algorithm operates. More... | |
bool | m_showEnabled |
If true then the graphic display mode is enabled. More... | |
This class implements a finger-proxy force rendering algorithm for polygonal objects.
chai3d::cAlgorithmFingerProxy::cAlgorithmFingerProxy | ( | ) |
Constructor of cAlgorithmFingerProxy.
|
inlinevirtual |
|
virtual |
This method Initializes the algorithm, including setting the pointer to the world in which the algorithm is to operate, and setting the initial position of the device.
a_world | Pointer to world in which force algorithm is operating. |
a_initialGlobalPosition | Initial position of the haptic device. |
Reimplemented from chai3d::cGenericForceAlgorithm.
void chai3d::cAlgorithmFingerProxy::reset | ( | ) |
This method reset the algorithm and sets the proxy position to the device position.
|
virtual |
This method computes the interaction forces that are associated with the position of the device and the proxy.
a_toolPos | New position of tool |
a_toolVel | New velocity of tool |
Reimplemented from chai3d::cGenericForceAlgorithm.
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
void chai3d::cAlgorithmFingerProxy::setEpsilonBaseValue | ( | double | a_value | ) |
This method sets the epsilon value which is used during geometry computation of the proxy model.
|
inline |
|
protectedvirtual |
This method render the force algorithm graphically using OpenGL.
a_options | Rendering options. |
Reimplemented from chai3d::cGenericForceAlgorithm.
|
protectedvirtual |
This method tests whether the proxy has reached the goal point, allowing for subclass-specific approximations.
a_goal | The location to which we'd like to move the proxy. |
a_proxy | The current position of the proxy. |
|
protectedvirtual |
Given the new position of the device and considering the current position of the proxy, this method attempts to move the proxy towards the device position (the goal). If its path is blocked by an obstacle (e.g., a triangle in a mesh), the proxy is moved to this intersection point and a new goal is calculated as the closest point to the original goal in the half-plane above the intersection triangle. The process is repeated if necessary, bringing the proxy to its final location.
a_goal | The goal position of the proxy subject to constraints. |
|
protectedvirtual |
This method attempts to move the proxy, subject to friction constraints. This is called from computeNextBestProxyPosition() when the proxy is ready to move along a known surface.
a_goal | The location to which we'd like to move the proxy. |
a_proxy | The current position of the proxy. |
a_normal | The surface normal at the obstructing surface. |
a_parent | The surface along which we're moving. |
|
protectedvirtual |
This method uses the contact to determine the force to apply to the device. The function computes a force proportional to the distance between the positions of the proxy and the device and scaled by the average stiffness of each contact triangle.
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
This method computes the surface normal at the proxy position.
a_contactPoint | Position of proxy. |
cCollisionEvent* chai3d::cAlgorithmFingerProxy::m_collisionEvents[3] |
bool chai3d::cAlgorithmFingerProxy::m_useDynamicProxy |
double chai3d::cAlgorithmFingerProxy::m_frictionDynHysteresisMultiplier |
Dynamic friction hysteresis multiplier In CHAI's proxy, the angle computed from the coefficient is multiplied by this constant to avoid rapidly oscillating between slipping and sticking without having to turn the dynamic friction level way down.
double chai3d::cAlgorithmFingerProxy::m_forceShadingAngleThreshold |
cCollisionSettings chai3d::cAlgorithmFingerProxy::m_collisionSettings |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
To address numerical errors during geometric computation, several epsilon values are computed and used.
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |