#include <OgreHapticsDevice.h>
Public Member Functions | |
virtual | ~Device () |
Virtual destructor. | |
virtual void | _notifyCreator (RenderSystem *renderSystem) |
Notify the Device of it's creator (internal use only). | |
virtual RenderSystem * | _getCreator (void) const |
Get the creator of the Device (internal use only). | |
const String & | getName (void) const |
Returns the name of the Device. | |
const String & | _getInitName (void) const |
Returns the name of the Device used for initialisation. | |
int | _getInitIndex (void) const |
Returns the index of the Device, as used by the rendering system which created the device. | |
const String & | getModel (void) const |
Returns the name of the model of the Device. | |
int | getSDKVersion (void) const |
Returns the version number of the SDK supporting the device. | |
int | getDriverVersion (void) const |
Returns the version number of the driver supporting the device. | |
virtual void | initialise (void)=0 |
Initialises the device. | |
virtual void | shutdown (void)=0 |
Stops the rendering through the device and uninitialises it. | |
bool | isInitialised (void) const |
Returns if the device is initialised. | |
DeviceCalibrationType | getCalibrationType (void) const |
Returns the DeviceCalibrationType describing how the device can be calibrated. | |
bool | needsCalibration (void) const |
Returns whether or not the device needs to be calibrated. | |
DeviceCalibrationState | getCalibrationState (void) const |
Returns the current calibration state of the device. | |
virtual void | calibrate (void)=0 |
Calibrates a device which needs manual calibration. | |
virtual void | enable (void)=0 |
Enables the rendering of forces to the device. | |
void | disable (void) |
Disables the rendering of forces to the device. | |
bool | isEnabled (void) const |
Returns whether or not the device is enabled. | |
const RenderStats & | getStatistics (void) |
Retrieves details of the current rendering performance. | |
void | resetStatistics (void) |
Resets saved render statistics. | |
const Real * | getDeviceWorkspaceDimensions (void) const |
Returns the dimensions of the physical workspace of the device, measured in millimeters from the device origin, in which haptic rendering is optimal. | |
void | setTouchspaceExtents (const Vector3 &leftLowerBack, const Vector3 &rightUpperFront) |
Defines the extents of the touch space in world coordinates, that will be used to map the workspace of the device. | |
void | setTouchspaceExtents (Real left, Real bottom, Real back, Real right, Real top, Real front) |
Defines the extents of the touch space in world coordinates, that will be used to map the workspace of the device. | |
const Real * | getTouchspaceExtents (void) const |
Returns the touch space extents as set. | |
void | setWorldTouchMatrix (const Matrix4 &worldTouchMatrix) |
Sets the transformation that will be used to transform from world space coordinates to touch space coordinates. | |
const Matrix4 & | getWorldTouchMatrix (void) const |
Returns the world space to touch space transformation matrix. | |
const Matrix4 & | getTouchWorkspaceMatrix (void) const |
Returns the touch space to device workspace transformation matrix. | |
const Matrix4 & | getWorldTouchWorkspaceMatrix (void) const |
Returns the world space to device workspace transformation matrix. | |
const Vector3 * | getWorldWorkspaceCorners (void) |
Returns the corners of the device workspace in world coordinates. | |
void | updateWorkspaceMapping (bool synchronise=true) |
Updates the matrices used in calculations to map the virtual workspace to the device workspace when needed. | |
void | capture (void) |
Captures the current state of the haptic device. | |
void | setDeviceListener (DeviceListener *listener) |
Sets the single DeviceListener as the listener for DeviceEvents. | |
bool | isButtonDown (DeviceButton button) |
Returns whether or not a button on the device, including the stylus/grip buttons, is pressed. | |
const Vector3 & | getPosition (void) const |
Returns the position of the device in device workspace coordinates. | |
const Quaternion & | getOrientation (void) const |
Returns the orientation of the device in device workspace coordinates. | |
const Vector3 & | getForce (void) const |
Returns the force applied to the device in device workspace coordinates. | |
const Vector3 & | getTorque (void) const |
Returns the torque (eg. | |
const Vector3 & | getLinearVelocity (void) const |
Returns the linear velocity of the device in device workspace coordinates. | |
const Vector3 & | getAngularVelocity (void) const |
Returns the angular velocity of the device in device workspace coordinates. | |
const Vector3 & | getWorldPosition (void) const |
Returns the position of the device in world space coordinates. | |
const Quaternion & | getWorldOrientation (void) const |
Returns the orientation of the device in world space coordinates. | |
const Vector3 & | getWorldForce (void) const |
Returns the force applied to the device in world space coordinates. | |
const Vector3 & | getWorldTorque (void) const |
Returns the torque (eg. | |
const Vector3 & | getWorldLinearVelocity (void) const |
Returns the linear velocity of the device in world space coordinates. | |
const Vector3 & | getWorldAngularVelocity (void) const |
Returns the angular velocity of the device in world space coordinates. | |
void | update (void) |
Updates the synchronisation of the matrices used for mapping between spaces (e.g. | |
const Vector3 & | _getPosition (void) const |
Returns the position of the device in device workspace coordinates. | |
const Quaternion & | _getOrientation (void) const |
Returns the orientation of the device in device workspace coordinates. | |
const Vector3 & | _getForce (void) const |
Returns the force applied to the device in device workspace coordinates. | |
const Vector3 & | _getTorque (void) const |
Returns the torque (eg. | |
const Vector3 & | _getLinearVelocity (void) const |
Returns the linear velocity of the device in device workspace coordinates. | |
const Vector3 & | _getAngularVelocity (void) const |
Returns the angular velocity of the device in device workspace coordinates. | |
const Vector3 & | _getWorldPosition (void) const |
Returns the position of the device in world space coordinates. | |
const Quaternion & | _getWorldOrientation (void) const |
Returns the orientation of the device in world space coordinates. | |
const Vector3 & | _getWorldForce (void) const |
Returns the force applied to the device in world space coordinates. | |
const Vector3 & | _getWorldTorque (void) const |
Returns the torque (eg. | |
const Vector3 & | _getWorldLinearVelocity (void) const |
Returns the linear velocity of the device in world space coordinates. | |
const Vector3 & | _getWorldAngularVelocity (void) const |
Returns the angular velocity of the device in world space coordinates. | |
const Vector3 & | _getPreviousPosition (void) const |
Returns the previous position (in haptic frames) of the device in device workspace coordinates. | |
const Quaternion & | _getPreviousOrientation (void) const |
Returns the previous orientation (in haptic frames) of the device in device workspace coordinates. | |
const Vector3 & | _getPreviousForce (void) const |
Returns the previous force (in haptic frames) applied to the device in device workspace coordinates. | |
const Vector3 & | _getPreviousTorque (void) const |
Returns the previous torque (eg. | |
const Vector3 & | _getPreviousLinearVelocity (void) const |
Returns the previous linear velocity (in haptic frames) of the device in device workspace coordinates. | |
const Vector3 & | _getPreviousAngularVelocity (void) const |
Returns the previous angular velocity (in haptic frames) of the device in device workspace coordinates. | |
const Vector3 & | _getPreviousWorldPosition (void) const |
Returns the previous position (in haptic frames) of the device in world space coordinates. | |
const Quaternion & | _getPreviousWorldOrientation (void) const |
Returns the previous orientation (in haptic frames) of the device in world space coordinates. | |
const Vector3 & | _getPreviousWorldForce (void) const |
Returns the previous force (in haptic frames) applied to the device in world space coordinates. | |
const Vector3 & | _getPreviousWorldTorque (void) const |
Returns the previous torque (eg. | |
const Vector3 & | _getPreviousWorldLinearVelocity (void) const |
Returns the previous linear velocity (in haptic frames) of the device in world space coordinates. | |
const Vector3 & | _getPreviousWorldAngularVelocity (void) const |
Returns the previous angular velocity (in haptic frames) of the device in world space coordinates. | |
bool | _isButtonDown (DeviceButton button) |
Returns whether or not a button on the device, including the stylus/grip buttons, is pressed. | |
virtual bool | _setOption (const String &key, const void *value) |
Sets a specific option of the device. | |
virtual bool | _getOption (const String &key, void *value) |
Retrieves a the value of an option of the device. | |
void | _setFrameListener (FrameListener *listener) |
Sets the single FrameListener as the listener for FrameEvents. | |
void | _addEffect (ForceEffect *effect) |
Adds a ForceEffect to the list of force effects to be rendered through the device (internal use only). | |
void | _removeEffect (ForceEffect *effect, bool immediate=false) |
Removes a ForceEffect from the list of force effects rendered throug the device (internal use only). | |
void | _restartEffect (ForceEffect *effect) |
Restarts a ForceEffect which is already being rendered through the device (internal use only). | |
void | _updateEffect (ForceEffect *effect) |
Marks the given ForceEffect to be updated in the haptic thread (internal use only). | |
virtual void | _applyForces (const Vector3 &force, const Vector3 &torque)=0 |
Sets the force and torque in device workspace coordinates to be applied to the device. | |
virtual void | _makeCurrent (void)=0 |
Sets the device as the current targer for haptic operations in a single RenderSystem. | |
Protected Types | |
enum | EventTypes { ET_BUTTON_DOWN, ET_BUTTON_UP, ET_CALIBRATION_STATE_CHANGED } |
Enumeration of types of events the Device will fire. More... | |
enum | FrameEventTimeType { FETT_ANY = 0, FETT_STARTED = 1, FETT_ENDED = 2, FETT_COUNT = 3 } |
typedef std::set< ForceEffect * > | ForceEffectList |
Protected Member Functions | |
Device (const String &name, const DeviceInitInfo &initInfo, int index=-1) | |
Private constructor. | |
void | _fireEvent (EventType type, const EventArgs &evt) |
Method for raising events. | |
void | _fireFrameStarted (void) |
void | _fireFrameEnded (void) |
virtual void | clearEventTimes (void) |
double | calculateEventTime (double currentTime, FrameEventTimeType type) |
void | _fireFrameStarted (FrameEvent &evt) |
void | _fireFrameEnded (FrameEvent &evt) |
void | updateTouchWorkspaceMapping (void) |
Calculates the transformation from touch workspace to device workspace. | |
void | updateWorldWorkspaceCorners (void) |
Calculates the transformed corners of the workspace. | |
virtual void | disableImpl (void)=0 |
Implements API specific operations to disable the device. | |
void | renderCallbackImpl (void) |
Implements the actual rendering callback. | |
void | updateStats (double currentTime) |
Updates render statistics used in haptic thread. | |
void | updateStates (void) |
Updates the device state structs used in haptic thread. | |
virtual void | obtainStateValues (double timeElapsed)=0 |
Obtains the device state values. | |
void | checkButtonState (int oldButtons, int newButtons, DeviceButton button) |
void | renderEffects (double currentTime) |
Updates the list of force effect to be rendered through the device. | |
void | synchroniseMatricesCallbackImpl (void) |
Implements the actual synchronisation of workspace mapping matrices. | |
void | synchroniseEffectsCallbackImpl (void) |
Implements the actual synchronisation of the force effect list. | |
Static Protected Member Functions | |
static SchedulerCallbackCode | statisticsResetCallback (void *params) |
Resets the statistics in a thread safe manner. | |
static SchedulerCallbackCode | synchroniseStatisticsCallback (void *params) |
Synchronises the statistics used in the client thread with those used in the haptic thread. | |
static SchedulerCallbackCode | synchroniseStatesCallback (void *params) |
Synchronises the DeviceState properties used in the client thread with those used in the haptic thread. | |
static SchedulerCallbackCode | synchroniseMatricesCallback (void *params) |
Synchronises the space transformation matrices used in the haptic thread with those used in the client thread. | |
static SchedulerCallbackCode | updateCallback (void *params) |
Synchronises the transformation matrices and force effect lists used in the haptic thread with those used in the client thread. | |
static SchedulerCallbackCode | removeEffectImmediateCallback (void *params) |
Removes a force effect from the appropiate list used in the haptic thread immediately. | |
Protected Attributes | |
String | mName |
The name of the Device. | |
String | mInitName |
The name used for initialisation of the Device. | |
String | mModel |
The name of the model of the Device. | |
RenderSystem * | mCreator |
The RenderSystem that created the Device. | |
Timer * | mTimer |
The Timer used for timings. | |
int | mIndex |
The index of the Device, used for unnamed initialisation. | |
int | mSDKVersion |
The version of SDK supporting the Device. | |
int | mDriverVersion |
The version of the driver supporting the Device. | |
bool | mIsInitialised |
Are we initialised yet? | |
bool | mIsEnabled |
Are we enabled yet? | |
bool | mDeviceWorkspaceDimensionsDirty |
Are the workspace dimensions updated? | |
bool | mRecalcWorkspaceMapping |
Do we need to update the workspace mapping? | |
bool | mSynchroniseWorkspaceMatrices |
Do we need to synchronise workspace matrices? | |
bool | mRecalcWorldWorkspaceCorners |
Do we need to update the workspace corners? | |
DeviceCalibrationType | mCalibrationType |
The type by which the device must be calibrated. | |
Real | mDeviceWorkspaceDimensions [6] |
Array holding the device workspace, measured in millimeters from the device origin. | |
Real | mTouchspaceExtents [6] |
Array holding the workspace, measured in world units from the origin. | |
Matrix4 | mWorldTouchMatrix |
Matrix4 describing the transformation from the world to the touch space. | |
Matrix4 | mhtWorldTouchMatrix |
Matrix4 describing the transformation from the world to the touch space used in haptic thread. | |
Matrix4 | mTouchWorkspaceMatrix |
Matrix4 describing the transformation from touch space to device workspace. | |
Matrix4 | mhtTouchWorkspaceMatrix |
Matrix4 describing the transformation from touch space to device workspace used in haptic thread. | |
Matrix4 | mInverseTouchWorkspaceMatrix |
Inverse of the touch to device workspace transformation matrix. | |
Matrix4 | mhtInverseTouchWorkspaceMatrix |
Inverse of the touch to device workspace transformation matrix used in haptic thread. | |
Matrix4 | mWorldTouchWorkspaceMatrix |
Matrix4 describing the transformation from the world to the device workspace. | |
Matrix4 | mhtWorldTouchWorkspaceMatrix |
Matrix4 describing the transformation from the world to the device workspace used in haptic thread. | |
Matrix4 | mInverseWorldTouchWorkspaceMatrix |
Inverse of the world space to device workspace transformation matrix. | |
Matrix4 | mhtInverseWorldTouchWorkspaceMatrix |
Inverse of the world space to device workspace transformation matrix used in haptic thread. | |
Vector3 | mWorldWorkspaceCorners [8] |
Corners of the device workspace in world coordinates. | |
AtomicScalar < DeviceCalibrationState > | mCalibrationState |
The calibration state of the device. | |
RenderStats | mStats |
RenderStats used in the client thread. | |
RenderStats | mhtStats |
RenderStats used in haptic thread. | |
unsigned int | mhtFrameCount |
Frame counter used for calculation of statistics in haptic thread. | |
double | mhtFrameTime |
The duration of the last haptic frame. | |
double | mhtLastTime |
The last time when a haptic frame occurred. | |
double | mhtLastSecond |
We only update stats once per second. | |
DeviceState | mDeviceState |
DeviceState of current haptic frame in device coordinates. | |
DeviceState | mhtDeviceState |
DeviceState of current haptic frame in device coordinates used in haptic thread. | |
DeviceState | mhtPreviousDeviceState |
DeviceState of previous haptic frame in device coordinates used in haptic thread. | |
DeviceState | mWorldDeviceState |
DeviceState of current haptic frame in which coordinates are transformed by the workspace to touch and the given world to touch matrices. | |
DeviceState | mhtWorldDeviceState |
DeviceState of current haptic frame in which coordinates are transformed by the workspace to touch and the given world to touch matrices used in haptic thread. | |
DeviceState | mhtPreviousWorldDeviceState |
DeviceState of previous haptic frame in which coordinates are transformed by the workspace to touch and the given world to touch matrices used in haptic thread. | |
ConcurrentQueue< EventArgs * > | mEventQueue |
Queue used to transfer events between haptic and client thread. | |
ConcurrentQueue< EventArgs * > ::HazardPtr * | mEventQueueHazardPtr |
Hazard pointer of the event queue used by client thread. | |
ConcurrentQueue< EventArgs * > ::HazardPtr * | mhtEventQueueHazardPtr |
Hazard pointer of the event queue used by haptic thread. | |
DeviceListener * | mListener |
Pointer to the listener of device events. | |
double | mEventTimes [FETT_COUNT][2] |
FrameListener * | mFrameListener |
Pointer to the listener of frame events. | |
AtomicScalar< int > | mFrameListenerLock |
Used for locking list of frame listener. | |
ForceEffectList | mEffectsToStart |
List of force effects which will be started at the next update. | |
ForceEffectList | mEffectsToStop |
List of force effects which will be stopped at the next update. | |
ForceEffectList | mEffectsToUpdate |
List of force effects of which parameters of the owned algorithms will be updated at the next update. | |
ForceEffectList | mhtFadingInEffects |
List of force effects which are fading in. Used in haptic thread. | |
ForceEffectList | mhtSustainingEffects |
List of force effects which are in sustaining state. | |
ForceEffectList | mhtFadingOutEffects |
List of force effects which are fading out. Used in haptic thread. | |
ForceOutput | mhtOutput |
Force output to be applied to device. | |
Friends | |
class | RenderSystem |
Classes | |
struct | RenderStats |
Structure holding data regarding rendering statistics. More... |
Through this class the application can control the input and output of a physical haptic device.
Definition at line 280 of file OgreHapticsDevice.h.
typedef std::set<ForceEffect*> OgreHaptics::Device::ForceEffectList [protected] |
Definition at line 1240 of file OgreHapticsDevice.h.
enum OgreHaptics::Device::EventTypes [protected] |
Enumeration of types of events the Device will fire.
Definition at line 1202 of file OgreHapticsDevice.h.
enum OgreHaptics::Device::FrameEventTimeType [protected] |
Definition at line 1223 of file OgreHapticsDevice.h.
virtual OgreHaptics::Device::~Device | ( | ) | [virtual] |
Virtual destructor.
OgreHaptics::Device::Device | ( | const String & | name, | |
const DeviceInitInfo & | initInfo, | |||
int | index = -1 | |||
) | [protected] |
Private constructor.
virtual void OgreHaptics::Device::_notifyCreator | ( | RenderSystem * | renderSystem | ) | [virtual] |
Notify the Device of it's creator (internal use only).
virtual RenderSystem* OgreHaptics::Device::_getCreator | ( | void | ) | const [virtual] |
Get the creator of the Device (internal use only).
Definition at line 304 of file OgreHapticsDevice.h.
const String& OgreHaptics::Device::getName | ( | void | ) | const |
const String& OgreHaptics::Device::_getInitName | ( | void | ) | const |
Returns the name of the Device used for initialisation.
Definition at line 315 of file OgreHapticsDevice.h.
int OgreHaptics::Device::_getInitIndex | ( | void | ) | const |
Returns the index of the Device, as used by the rendering system which created the device.
Definition at line 323 of file OgreHapticsDevice.h.
const String& OgreHaptics::Device::getModel | ( | void | ) | const |
Returns the name of the model of the Device.
Definition at line 331 of file OgreHapticsDevice.h.
int OgreHaptics::Device::getSDKVersion | ( | void | ) | const |
Returns the version number of the SDK supporting the device.
Definition at line 339 of file OgreHapticsDevice.h.
int OgreHaptics::Device::getDriverVersion | ( | void | ) | const |
Returns the version number of the driver supporting the device.
Definition at line 347 of file OgreHapticsDevice.h.
virtual void OgreHaptics::Device::initialise | ( | void | ) | [pure virtual] |
Initialises the device.
An | InvalidOperationException if the device has already been initialised. | |
An | HapticsAPIException if initialisation fails. |
virtual void OgreHaptics::Device::shutdown | ( | void | ) | [pure virtual] |
Stops the rendering through the device and uninitialises it.
bool OgreHaptics::Device::isInitialised | ( | void | ) | const |
DeviceCalibrationType OgreHaptics::Device::getCalibrationType | ( | void | ) | const |
Returns the DeviceCalibrationType describing how the device can be calibrated.
Definition at line 380 of file OgreHapticsDevice.h.
bool OgreHaptics::Device::needsCalibration | ( | void | ) | const |
Returns whether or not the device needs to be calibrated.
true
if the device has been initialised and has not been calibrated, false
otherwise. DeviceCalibrationState OgreHaptics::Device::getCalibrationState | ( | void | ) | const |
virtual void OgreHaptics::Device::calibrate | ( | void | ) | [pure virtual] |
Calibrates a device which needs manual calibration.
An | InvalidOperationException if the device has already been initialised. |
virtual void OgreHaptics::Device::enable | ( | void | ) | [pure virtual] |
Enables the rendering of forces to the device.
InvalidOperationException | if the device has not yet been initialised or if the RenderSystem which created the device has not been started or is stopped. |
void OgreHaptics::Device::disable | ( | void | ) |
Disables the rendering of forces to the device.
bool OgreHaptics::Device::isEnabled | ( | void | ) | const |
Returns whether or not the device is enabled.
Definition at line 434 of file OgreHapticsDevice.h.
const RenderStats& OgreHaptics::Device::getStatistics | ( | void | ) |
Retrieves details of the current rendering performance.
void OgreHaptics::Device::resetStatistics | ( | void | ) |
Resets saved render statistics.
const Real* OgreHaptics::Device::getDeviceWorkspaceDimensions | ( | void | ) | const |
Returns the dimensions of the physical workspace of the device, measured in millimeters from the device origin, in which haptic rendering is optimal.
These dimensions are used for mapping between the coordinate system used for visual rendering and the physical units of the device.
An | InvalidOperationException if the device has not been enabled yet. |
void OgreHaptics::Device::setTouchspaceExtents | ( | const Vector3 & | leftLowerBack, | |
const Vector3 & | rightUpperFront | |||
) |
Defines the extents of the touch space in world coordinates, that will be used to map the workspace of the device.
leftLowerBack | Ogre::Vector3 defining the coordinates of the point of the world workspace boundaries positioned at the bottom-left in the back. | |
rightUpperFront | Ogre::Vector3 defining the coordinates of the point of the world workspace boundaries positioned at the top-right in the front. |
void OgreHaptics::Device::setTouchspaceExtents | ( | Real | left, | |
Real | bottom, | |||
Real | back, | |||
Real | right, | |||
Real | top, | |||
Real | front | |||
) |
Defines the extents of the touch space in world coordinates, that will be used to map the workspace of the device.
left | The left of the touch space in world coordinates. | |
bottom | The bottom of the touch space in world coordinates. | |
back | The back of the touch space in world coordinates. | |
right | The right of the touch space in world coordinates. | |
top | The top of the touch space in world coordinates. | |
front | The front of the touch space in world coordinates. |
const Real* OgreHaptics::Device::getTouchspaceExtents | ( | void | ) | const |
Returns the touch space extents as set.
Definition at line 517 of file OgreHapticsDevice.h.
void OgreHaptics::Device::setWorldTouchMatrix | ( | const Matrix4 & | worldTouchMatrix | ) |
Sets the transformation that will be used to transform from world space coordinates to touch space coordinates.
worldTouchMatrix | The new world space to touch space transformation matrix. |
const Matrix4& OgreHaptics::Device::getWorldTouchMatrix | ( | void | ) | const |
Returns the world space to touch space transformation matrix.
Definition at line 530 of file OgreHapticsDevice.h.
const Matrix4& OgreHaptics::Device::getTouchWorkspaceMatrix | ( | void | ) | const |
Returns the touch space to device workspace transformation matrix.
Definition at line 532 of file OgreHapticsDevice.h.
const Matrix4& OgreHaptics::Device::getWorldTouchWorkspaceMatrix | ( | void | ) | const |
Returns the world space to device workspace transformation matrix.
Definition at line 534 of file OgreHapticsDevice.h.
const Vector3* OgreHaptics::Device::getWorldWorkspaceCorners | ( | void | ) |
Returns the corners of the device workspace in world coordinates.
5----4 /| /| / | / | / 6-/--7 1----0 / | / | / |/ |/ 2----3
void OgreHaptics::Device::updateWorkspaceMapping | ( | bool | synchronise = true |
) |
Updates the matrices used in calculations to map the virtual workspace to the device workspace when needed.
synchronise | If set to false , the workspace mapping matrices used in the haptic thread will not be synchronised with those used in the client thread. |
void OgreHaptics::Device::capture | ( | void | ) |
Captures the current state of the haptic device.
void OgreHaptics::Device::setDeviceListener | ( | DeviceListener * | listener | ) |
Sets the single DeviceListener as the listener for DeviceEvents.
To remove the listener call this with NULL
.
listener | The single listener to listen to events from the device. |
Definition at line 595 of file OgreHapticsDevice.h.
bool OgreHaptics::Device::isButtonDown | ( | DeviceButton | button | ) |
Returns whether or not a button on the device, including the stylus/grip buttons, is pressed.
button | The type of the DeviceButton to query. |
true
if the button is pressed, false
otherwise. const Vector3& OgreHaptics::Device::getPosition | ( | void | ) | const |
Returns the position of the device in device workspace coordinates.
const Quaternion& OgreHaptics::Device::getOrientation | ( | void | ) | const |
Returns the orientation of the device in device workspace coordinates.
const Vector3& OgreHaptics::Device::getForce | ( | void | ) | const |
Returns the force applied to the device in device workspace coordinates.
const Vector3& OgreHaptics::Device::getTorque | ( | void | ) | const |
Returns the torque (eg.
angular force) applied to the device in device workspace coordinates.
const Vector3& OgreHaptics::Device::getLinearVelocity | ( | void | ) | const |
Returns the linear velocity of the device in device workspace coordinates.
const Vector3& OgreHaptics::Device::getAngularVelocity | ( | void | ) | const |
Returns the angular velocity of the device in device workspace coordinates.
const Vector3& OgreHaptics::Device::getWorldPosition | ( | void | ) | const |
Returns the position of the device in world space coordinates.
const Quaternion& OgreHaptics::Device::getWorldOrientation | ( | void | ) | const |
Returns the orientation of the device in world space coordinates.
const Vector3& OgreHaptics::Device::getWorldForce | ( | void | ) | const |
Returns the force applied to the device in world space coordinates.
const Vector3& OgreHaptics::Device::getWorldTorque | ( | void | ) | const |
Returns the torque (eg.
angular force) applied to the device in world space coordinates.
const Vector3& OgreHaptics::Device::getWorldLinearVelocity | ( | void | ) | const |
Returns the linear velocity of the device in world space coordinates.
const Vector3& OgreHaptics::Device::getWorldAngularVelocity | ( | void | ) | const |
Returns the angular velocity of the device in world space coordinates.
void OgreHaptics::Device::update | ( | void | ) |
Updates the synchronisation of the matrices used for mapping between spaces (e.g.
world space, touch space and device workspace) as well as synchronises the lists of force effects to be rendered.
const Vector3& OgreHaptics::Device::_getPosition | ( | void | ) | const |
Returns the position of the device in device workspace coordinates.
const Quaternion& OgreHaptics::Device::_getOrientation | ( | void | ) | const |
Returns the orientation of the device in device workspace coordinates.
const Vector3& OgreHaptics::Device::_getForce | ( | void | ) | const |
Returns the force applied to the device in device workspace coordinates.
const Vector3& OgreHaptics::Device::_getTorque | ( | void | ) | const |
Returns the torque (eg.
angular force) applied to the device in device workspace coordinates.
const Vector3& OgreHaptics::Device::_getLinearVelocity | ( | void | ) | const |
Returns the linear velocity of the device in device workspace coordinates.
const Vector3& OgreHaptics::Device::_getAngularVelocity | ( | void | ) | const |
Returns the angular velocity of the device in device workspace coordinates.
const Vector3& OgreHaptics::Device::_getWorldPosition | ( | void | ) | const |
Returns the position of the device in world space coordinates.
const Quaternion& OgreHaptics::Device::_getWorldOrientation | ( | void | ) | const |
Returns the orientation of the device in world space coordinates.
const Vector3& OgreHaptics::Device::_getWorldForce | ( | void | ) | const |
Returns the force applied to the device in world space coordinates.
const Vector3& OgreHaptics::Device::_getWorldTorque | ( | void | ) | const |
Returns the torque (eg.
angular force) applied to the device in world space coordinates.
const Vector3& OgreHaptics::Device::_getWorldLinearVelocity | ( | void | ) | const |
Returns the linear velocity of the device in world space coordinates.
const Vector3& OgreHaptics::Device::_getWorldAngularVelocity | ( | void | ) | const |
Returns the angular velocity of the device in world space coordinates.
const Vector3& OgreHaptics::Device::_getPreviousPosition | ( | void | ) | const |
Returns the previous position (in haptic frames) of the device in device workspace coordinates.
const Quaternion& OgreHaptics::Device::_getPreviousOrientation | ( | void | ) | const |
Returns the previous orientation (in haptic frames) of the device in device workspace coordinates.
const Vector3& OgreHaptics::Device::_getPreviousForce | ( | void | ) | const |
Returns the previous force (in haptic frames) applied to the device in device workspace coordinates.
const Vector3& OgreHaptics::Device::_getPreviousTorque | ( | void | ) | const |
Returns the previous torque (eg.
angular force) (in haptic frames) applied to the device in device workspace coordinates.
const Vector3& OgreHaptics::Device::_getPreviousLinearVelocity | ( | void | ) | const |
Returns the previous linear velocity (in haptic frames) of the device in device workspace coordinates.
const Vector3& OgreHaptics::Device::_getPreviousAngularVelocity | ( | void | ) | const |
Returns the previous angular velocity (in haptic frames) of the device in device workspace coordinates.
const Vector3& OgreHaptics::Device::_getPreviousWorldPosition | ( | void | ) | const |
Returns the previous position (in haptic frames) of the device in world space coordinates.
const Quaternion& OgreHaptics::Device::_getPreviousWorldOrientation | ( | void | ) | const |
Returns the previous orientation (in haptic frames) of the device in world space coordinates.
const Vector3& OgreHaptics::Device::_getPreviousWorldForce | ( | void | ) | const |
Returns the previous force (in haptic frames) applied to the device in world space coordinates.
const Vector3& OgreHaptics::Device::_getPreviousWorldTorque | ( | void | ) | const |
Returns the previous torque (eg.
angular force) (in haptic frames) applied to the device in world space coordinates.
const Vector3& OgreHaptics::Device::_getPreviousWorldLinearVelocity | ( | void | ) | const |
Returns the previous linear velocity (in haptic frames) of the device in world space coordinates.
const Vector3& OgreHaptics::Device::_getPreviousWorldAngularVelocity | ( | void | ) | const |
Returns the previous angular velocity (in haptic frames) of the device in world space coordinates.
bool OgreHaptics::Device::_isButtonDown | ( | DeviceButton | button | ) |
Returns whether or not a button on the device, including the stylus/grip buttons, is pressed.
button | The type of the DeviceButton to query. |
true
if the button is pressed, false
otherwise. virtual bool OgreHaptics::Device::_setOption | ( | const String & | key, | |
const void * | value | |||
) | [virtual] |
Sets a specific option of the device.
These options are usually specific for certain implementations of the Device class, and may not exist across different implementations.
key | The name of the option to be set. | |
value | Pointer to a variable of which the value is read. |
true
if the option has been set successfully, false
otherwise. virtual bool OgreHaptics::Device::_getOption | ( | const String & | key, | |
void * | value | |||
) | [virtual] |
Retrieves a the value of an option of the device.
These options are usually specific for certain implementations of the Device class, and may not exist across different implementations.
key | The name of the option to retrieve. | |
value | Pointer to a variable of which the value is set if the query is successful. |
true
if the option has been retrieved successfully, false
otherwise. void OgreHaptics::Device::_setFrameListener | ( | FrameListener * | listener | ) |
Sets the single FrameListener as the listener for FrameEvents.
To remove the listener call this with NULL
.
listener | The single listener to listen to frame events from the device. |
void OgreHaptics::Device::_addEffect | ( | ForceEffect * | effect | ) |
Adds a ForceEffect to the list of force effects to be rendered through the device (internal use only).
void OgreHaptics::Device::_removeEffect | ( | ForceEffect * | effect, | |
bool | immediate = false | |||
) |
Removes a ForceEffect from the list of force effects rendered throug the device (internal use only).
void OgreHaptics::Device::_restartEffect | ( | ForceEffect * | effect | ) |
Restarts a ForceEffect which is already being rendered through the device (internal use only).
void OgreHaptics::Device::_updateEffect | ( | ForceEffect * | effect | ) |
Marks the given ForceEffect to be updated in the haptic thread (internal use only).
virtual void OgreHaptics::Device::_applyForces | ( | const Vector3 & | force, | |
const Vector3 & | torque | |||
) | [pure virtual] |
Sets the force and torque in device workspace coordinates to be applied to the device.
force | The force in N to be applied to the device. | |
torque | The torque in Nm to be applied to the device (if supported). |
virtual void OgreHaptics::Device::_makeCurrent | ( | void | ) | [pure virtual] |
Sets the device as the current targer for haptic operations in a single RenderSystem.
Method for raising events.
void OgreHaptics::Device::_fireFrameStarted | ( | void | ) | [protected] |
void OgreHaptics::Device::_fireFrameEnded | ( | void | ) | [protected] |
virtual void OgreHaptics::Device::clearEventTimes | ( | void | ) | [protected, virtual] |
double OgreHaptics::Device::calculateEventTime | ( | double | currentTime, | |
FrameEventTimeType | type | |||
) | [protected] |
void OgreHaptics::Device::_fireFrameStarted | ( | FrameEvent & | evt | ) | [protected] |
void OgreHaptics::Device::_fireFrameEnded | ( | FrameEvent & | evt | ) | [protected] |
void OgreHaptics::Device::updateTouchWorkspaceMapping | ( | void | ) | [protected] |
Calculates the transformation from touch workspace to device workspace.
This transformation only changes if the workspace extents, which represent the boundaries of touch workspace are changed.
void OgreHaptics::Device::updateWorldWorkspaceCorners | ( | void | ) | [protected] |
Calculates the transformed corners of the workspace.
virtual void OgreHaptics::Device::disableImpl | ( | void | ) | [protected, pure virtual] |
Implements API specific operations to disable the device.
void OgreHaptics::Device::renderCallbackImpl | ( | void | ) | [protected] |
Implements the actual rendering callback.
void OgreHaptics::Device::updateStats | ( | double | currentTime | ) | [protected] |
Updates render statistics used in haptic thread.
void OgreHaptics::Device::updateStates | ( | void | ) | [protected] |
Updates the device state structs used in haptic thread.
virtual void OgreHaptics::Device::obtainStateValues | ( | double | timeElapsed | ) | [protected, pure virtual] |
Obtains the device state values.
void OgreHaptics::Device::checkButtonState | ( | int | oldButtons, | |
int | newButtons, | |||
DeviceButton | button | |||
) | [protected] |
void OgreHaptics::Device::renderEffects | ( | double | currentTime | ) | [protected] |
Updates the list of force effect to be rendered through the device.
Calculates both the forces to be added as well as updates the remaining time of the current state of the force effects.
void OgreHaptics::Device::synchroniseMatricesCallbackImpl | ( | void | ) | [protected] |
Implements the actual synchronisation of workspace mapping matrices.
void OgreHaptics::Device::synchroniseEffectsCallbackImpl | ( | void | ) | [protected] |
Implements the actual synchronisation of the force effect list.
static SchedulerCallbackCode OgreHaptics::Device::statisticsResetCallback | ( | void * | params | ) | [static, protected] |
Resets the statistics in a thread safe manner.
static SchedulerCallbackCode OgreHaptics::Device::synchroniseStatisticsCallback | ( | void * | params | ) | [static, protected] |
Synchronises the statistics used in the client thread with those used in the haptic thread.
static SchedulerCallbackCode OgreHaptics::Device::synchroniseStatesCallback | ( | void * | params | ) | [static, protected] |
Synchronises the DeviceState properties used in the client thread with those used in the haptic thread.
static SchedulerCallbackCode OgreHaptics::Device::synchroniseMatricesCallback | ( | void * | params | ) | [static, protected] |
Synchronises the space transformation matrices used in the haptic thread with those used in the client thread.
static SchedulerCallbackCode OgreHaptics::Device::updateCallback | ( | void * | params | ) | [static, protected] |
Synchronises the transformation matrices and force effect lists used in the haptic thread with those used in the client thread.
static SchedulerCallbackCode OgreHaptics::Device::removeEffectImmediateCallback | ( | void * | params | ) | [static, protected] |
Removes a force effect from the appropiate list used in the haptic thread immediately.
friend class RenderSystem [friend] |
Definition at line 283 of file OgreHapticsDevice.h.
String OgreHaptics::Device::mName [protected] |
String OgreHaptics::Device::mInitName [protected] |
The name used for initialisation of the Device.
Definition at line 1100 of file OgreHapticsDevice.h.
String OgreHaptics::Device::mModel [protected] |
RenderSystem* OgreHaptics::Device::mCreator [protected] |
Timer* OgreHaptics::Device::mTimer [protected] |
int OgreHaptics::Device::mIndex [protected] |
The index of the Device, used for unnamed initialisation.
Definition at line 1108 of file OgreHapticsDevice.h.
int OgreHaptics::Device::mSDKVersion [protected] |
int OgreHaptics::Device::mDriverVersion [protected] |
The version of the driver supporting the Device.
Definition at line 1112 of file OgreHapticsDevice.h.
bool OgreHaptics::Device::mIsInitialised [protected] |
bool OgreHaptics::Device::mIsEnabled [protected] |
bool OgreHaptics::Device::mDeviceWorkspaceDimensionsDirty [protected] |
bool OgreHaptics::Device::mRecalcWorkspaceMapping [protected] |
bool OgreHaptics::Device::mSynchroniseWorkspaceMatrices [protected] |
bool OgreHaptics::Device::mRecalcWorldWorkspaceCorners [protected] |
The type by which the device must be calibrated.
Definition at line 1126 of file OgreHapticsDevice.h.
Real OgreHaptics::Device::mDeviceWorkspaceDimensions[6] [protected] |
Array holding the device workspace, measured in millimeters from the device origin.
Definition at line 1130 of file OgreHapticsDevice.h.
Real OgreHaptics::Device::mTouchspaceExtents[6] [protected] |
Array holding the workspace, measured in world units from the origin.
Definition at line 1132 of file OgreHapticsDevice.h.
Matrix4 OgreHaptics::Device::mWorldTouchMatrix [protected] |
Matrix4 describing the transformation from the world to the touch space.
Definition at line 1135 of file OgreHapticsDevice.h.
Matrix4 OgreHaptics::Device::mhtWorldTouchMatrix [protected] |
Matrix4 describing the transformation from the world to the touch space used in haptic thread.
Definition at line 1138 of file OgreHapticsDevice.h.
Matrix4 OgreHaptics::Device::mTouchWorkspaceMatrix [protected] |
Matrix4 describing the transformation from touch space to device workspace.
Definition at line 1141 of file OgreHapticsDevice.h.
Matrix4 OgreHaptics::Device::mhtTouchWorkspaceMatrix [protected] |
Matrix4 describing the transformation from touch space to device workspace used in haptic thread.
Definition at line 1144 of file OgreHapticsDevice.h.
Matrix4 OgreHaptics::Device::mInverseTouchWorkspaceMatrix [protected] |
Inverse of the touch to device workspace transformation matrix.
Definition at line 1146 of file OgreHapticsDevice.h.
Matrix4 OgreHaptics::Device::mhtInverseTouchWorkspaceMatrix [protected] |
Inverse of the touch to device workspace transformation matrix used in haptic thread.
Definition at line 1149 of file OgreHapticsDevice.h.
Matrix4 OgreHaptics::Device::mWorldTouchWorkspaceMatrix [protected] |
Matrix4 describing the transformation from the world to the device workspace.
Definition at line 1152 of file OgreHapticsDevice.h.
Matrix4 OgreHaptics::Device::mhtWorldTouchWorkspaceMatrix [protected] |
Matrix4 describing the transformation from the world to the device workspace used in haptic thread.
Definition at line 1155 of file OgreHapticsDevice.h.
Matrix4 OgreHaptics::Device::mInverseWorldTouchWorkspaceMatrix [protected] |
Inverse of the world space to device workspace transformation matrix.
Definition at line 1158 of file OgreHapticsDevice.h.
Matrix4 OgreHaptics::Device::mhtInverseWorldTouchWorkspaceMatrix [protected] |
Inverse of the world space to device workspace transformation matrix used in haptic thread.
Definition at line 1161 of file OgreHapticsDevice.h.
Vector3 OgreHaptics::Device::mWorldWorkspaceCorners[8] [protected] |
Corners of the device workspace in world coordinates.
Definition at line 1163 of file OgreHapticsDevice.h.
RenderStats OgreHaptics::Device::mStats [mutable, protected] |
RenderStats OgreHaptics::Device::mhtStats [protected] |
unsigned int OgreHaptics::Device::mhtFrameCount [protected] |
Frame counter used for calculation of statistics in haptic thread.
Definition at line 1172 of file OgreHapticsDevice.h.
double OgreHaptics::Device::mhtFrameTime [protected] |
double OgreHaptics::Device::mhtLastTime [protected] |
double OgreHaptics::Device::mhtLastSecond [protected] |
DeviceState OgreHaptics::Device::mDeviceState [protected] |
DeviceState of current haptic frame in device coordinates.
Definition at line 1181 of file OgreHapticsDevice.h.
DeviceState OgreHaptics::Device::mhtDeviceState [protected] |
DeviceState of current haptic frame in device coordinates used in haptic thread.
Definition at line 1184 of file OgreHapticsDevice.h.
DeviceState of previous haptic frame in device coordinates used in haptic thread.
Definition at line 1187 of file OgreHapticsDevice.h.
DeviceState OgreHaptics::Device::mWorldDeviceState [protected] |
DeviceState of current haptic frame in which coordinates are transformed by the workspace to touch and the given world to touch matrices.
Definition at line 1191 of file OgreHapticsDevice.h.
DeviceState OgreHaptics::Device::mhtWorldDeviceState [protected] |
DeviceState of current haptic frame in which coordinates are transformed by the workspace to touch and the given world to touch matrices used in haptic thread.
Definition at line 1195 of file OgreHapticsDevice.h.
DeviceState of previous haptic frame in which coordinates are transformed by the workspace to touch and the given world to touch matrices used in haptic thread.
Definition at line 1199 of file OgreHapticsDevice.h.
ConcurrentQueue<EventArgs*> OgreHaptics::Device::mEventQueue [protected] |
Queue used to transfer events between haptic and client thread.
Pointers to event arguments are used to avoid copy construction of the event when moved around between threads.
Definition at line 1214 of file OgreHapticsDevice.h.
ConcurrentQueue<EventArgs*>::HazardPtr* OgreHaptics::Device::mEventQueueHazardPtr [protected] |
Hazard pointer of the event queue used by client thread.
Definition at line 1216 of file OgreHapticsDevice.h.
ConcurrentQueue<EventArgs*>::HazardPtr* OgreHaptics::Device::mhtEventQueueHazardPtr [protected] |
Hazard pointer of the event queue used by haptic thread.
Definition at line 1218 of file OgreHapticsDevice.h.
DeviceListener* OgreHaptics::Device::mListener [protected] |
double OgreHaptics::Device::mEventTimes[FETT_COUNT][2] [protected] |
Definition at line 1231 of file OgreHapticsDevice.h.
FrameListener* OgreHaptics::Device::mFrameListener [protected] |
AtomicScalar<int> OgreHaptics::Device::mFrameListenerLock [protected] |
Used for locking list of frame listener.
A spin lock is used to avoid the use of a more expensive mutex while it is assumed a listener will not be changed often.
Definition at line 1238 of file OgreHapticsDevice.h.
ForceEffectList OgreHaptics::Device::mEffectsToStart [protected] |
List of force effects which will be started at the next update.
Definition at line 1242 of file OgreHapticsDevice.h.
ForceEffectList OgreHaptics::Device::mEffectsToStop [protected] |
List of force effects which will be stopped at the next update.
Definition at line 1244 of file OgreHapticsDevice.h.
ForceEffectList OgreHaptics::Device::mEffectsToUpdate [protected] |
List of force effects of which parameters of the owned algorithms will be updated at the next update.
Definition at line 1247 of file OgreHapticsDevice.h.
List of force effects which are fading in. Used in haptic thread.
Definition at line 1249 of file OgreHapticsDevice.h.
List of force effects which are in sustaining state.
Used in haptic thread.
Definition at line 1252 of file OgreHapticsDevice.h.
List of force effects which are fading out. Used in haptic thread.
Definition at line 1254 of file OgreHapticsDevice.h.
ForceOutput OgreHaptics::Device::mhtOutput [protected] |
Last modified Tue Jan 6 22:31:26 2009