Changeset 5668 for code/branches/resource2/src/ois/OISForceFeedback.cpp
- Timestamp:
- Aug 22, 2009, 11:16:34 PM (15 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
code/branches/resource2/src/ois/OISForceFeedback.cpp
r1505 r5668 27 27 28 28 //-------------------------------------------------------------// 29 void ForceFeedback::_addEffectTypes( Effect::EForce force, Effect::EType type)29 ForceFeedback::ForceFeedback() : mSetGainSupport(false), mSetAutoCenterSupport(false) 30 30 { 31 if( force == Effect::UnknownForce || type == Effect::Unknown )32 OIS_EXCEPT( E_General, "Unknown Force||Type was added too effect list..." );33 34 mSupportedEffects[force] = type;35 31 } 36 32 37 33 //-------------------------------------------------------------// 38 const ForceFeedback::SupportedEffectList& 39 ForceFeedback::getSupportedEffects() const 34 void ForceFeedback::_addEffectTypes( Effect::EForce force, Effect::EType type ) 35 { 36 if( force <= Effect::UnknownForce || force >= Effect::_ForcesNumber 37 || type <= Effect::Unknown || type >= Effect::_TypesNumber ) 38 OIS_EXCEPT( E_General, "Can't add unknown effect Force/Type to the supported list" ); 39 40 mSupportedEffects.insert(std::pair<Effect::EForce, Effect::EType>(force, type)); 41 } 42 43 //-------------------------------------------------------------// 44 void ForceFeedback::_setGainSupport( bool on ) 45 { 46 mSetGainSupport = on; 47 } 48 49 //-------------------------------------------------------------// 50 void ForceFeedback::_setAutoCenterSupport( bool on ) 51 { 52 mSetAutoCenterSupport = on; 53 } 54 55 //-------------------------------------------------------------// 56 const ForceFeedback::SupportedEffectList& ForceFeedback::getSupportedEffects() const 40 57 { 41 58 return mSupportedEffects; 42 59 } 60 61 //-------------------------------------------------------------// 62 bool ForceFeedback::supportsEffect(Effect::EForce force, Effect::EType type) const 63 { 64 const std::pair<SupportedEffectList::const_iterator, SupportedEffectList::const_iterator> 65 iterRange = mSupportedEffects.equal_range(force); 66 SupportedEffectList::const_iterator iter; 67 for (iter = iterRange.first; iter != iterRange.second; iter++) 68 { 69 if ((*iter).second == type) 70 return true; 71 } 72 73 return false; 74 }
Note: See TracChangeset
for help on using the changeset viewer.