Mercurial > hg > ccmieditor
changeset 8:ea7885bd9bff tip
fixed bug : render solid line as dotted/dashed when moving the stylus from dotted/dashed to solid
author | ccmi-guest |
---|---|
date | Thu, 03 Jul 2014 16:12:20 +0100 |
parents | 075ae9eb2a40 |
children | |
files | native/PhantomOmni/HapticManager.cpp |
diffstat | 1 files changed, 9 insertions(+), 4 deletions(-) [+] |
line wrap: on
line diff
--- a/native/PhantomOmni/HapticManager.cpp Tue Dec 18 18:49:20 2012 +0000 +++ b/native/PhantomOmni/HapticManager.cpp Thu Jul 03 16:12:20 2014 +0100 @@ -56,6 +56,7 @@ HapticManager *pThis = static_cast<HapticManager*>(userdata); if(object == pThis->wall1Id||object == pThis->wall2Id) // no event is associated to the wall return; + if(pThis->lastMovedElement == object){ pThis->stillTouchingLastMovedElement = true; } @@ -66,6 +67,7 @@ CollectionsManager::EdgeData & ed = pThis->collectionsManager->getEdgeDataFromID(object); pThis->lastTouchedEdgeID = object; pThis->lastTouchedEdgeIsUntouched = false; + pThis->lastTouchedEdgeStipplePattern = ed.stipplePattern; // check if the proxy is still touching the edge's node, in that case only play the sound HLboolean isTouching = HL_FALSE; @@ -103,7 +105,7 @@ HapticManager *pThis = static_cast<HapticManager*>(userdata); if(object == pThis->wall1Id||object == pThis->wall2Id) // no event is associated to the wall return; - + if(object == pThis->lastMovedElement){ pThis->lastMovedElement = HL_OBJECT_ANY; pThis->stillTouchingLastMovedElement = false; @@ -112,6 +114,7 @@ pThis->lastHighlightElementID = HL_OBJECT_ANY; pThis->executeCommand('u',0,0,0,0,0); } + if(pThis->lastTouchedEdgeID == object){ pThis->lastTouchedEdgeIsUntouched = true; } @@ -516,9 +519,8 @@ if(lastTouchedEdgeID != HL_OBJECT_ANY){ /* check if the edge is still there, it might not as the tab could be changed */ if(collectionsManager->isEdge(lastTouchedEdgeID)){ - //hlGetShapeBooleanv(lastTouchedEdgeID,HL_PROXY_IS_TOUCHING,&isTouching); FIXME to remove - if(frictionDisabled||lastTouchedEdgeIsUntouched/*(isTouching == HL_FALSE)*/){ - hlEffectd(HL_EFFECT_PROPERTY_MAGNITUDE, 0); + if(frictionDisabled||lastTouchedEdgeIsUntouched){ + hlEffectd(HL_EFFECT_PROPERTY_MAGNITUDE, 0); // none hlEffectd(HL_EFFECT_PROPERTY_GAIN, 0); }else{ if(lastTouchedEdgeStipplePattern == 0xAAAA){ // dotted @@ -527,6 +529,9 @@ }else if(lastTouchedEdgeStipplePattern == 0xF0F0){ // dashed hlEffectd(HL_EFFECT_PROPERTY_MAGNITUDE, 0.6); hlEffectd(HL_EFFECT_PROPERTY_GAIN, 0.6); + }else{ + hlEffectd(HL_EFFECT_PROPERTY_MAGNITUDE, 0); // solid + hlEffectd(HL_EFFECT_PROPERTY_GAIN, 0); } } }else{