Thanks Bill for answer my question. Now I have a new problem. I want to record a node selection by swipe gesture like in CC3DemoMashUp, but in my case the first touch not necessarily need to be inside the node. I need to record a kCCTouchMoved and i do the following:
-(void) touchEvent: (uint) touchType at: (CGPoint) touchPoint
{
if (touchType == kCCTouchBegan) {
NSLog(@"Began");
}
if (touchType == kCCTouchMoved) {
NSLog(@"Moved");
[touchedNodePicker pickNodeFromTouchEvent:touchType at:touchPoint];
}
if (touchType == kCCTouchEnded) {
NSLog(@"Ended");
}
}
and
-(void) nodeSelected: (CC3Node*) aNode byTouchEvent: (uint) touchType at: (CGPoint) touchPoint {
NSLog(@"%@", aNode);
}
When i make slow swip gestures the console result is:
2011-09-23 11:56:33.940 [1334:207] Began
2011-09-23 11:56:34.707 [1334:207] Moved
2011-09-23 11:56:34.785 [1334:207] (null)
2011-09-23 11:56:38.613 [1334:207] Moved
2011-09-23 11:56:38.668 [1334:207] CC3PODMeshNode corn_plant_lower07-62
2011-09-23 11:56:39.321 [1334:207] Moved
2011-09-23 11:56:39.418 [1334:207] (null)
2011-09-23 11:56:42.190 [1334:207] Ended
But for fast movement:
2011-09-23 11:59:40.324 [1334:207] Began
2011-09-23 11:59:40.846 [1334:207] Moved
2011-09-23 11:59:40.889 [1334:207] Moved
2011-09-23 11:59:40.902 [1334:207] (null)
2011-09-23 11:59:40.943 [1334:207] Moved
2011-09-23 11:59:40.950 [1334:207] Moved
2011-09-23 11:59:40.955 [1334:207] Moved
2011-09-23 11:59:41.000 [1334:207] Moved
2011-09-23 11:59:41.002 [1334:207] (null)
2011-09-23 11:59:41.047 [1334:207] Moved
2011-09-23 11:59:41.115 [1334:207] Moved
2011-09-23 11:59:41.119 [1334:207] (null)
2011-09-23 11:59:43.456 [1334:207] Ended
like missing picked nodes.
I'm using cocos3d 0.6.1 and read the documentation and tells that -(void) pickTouchedNode picks the node during drawing operations and dispatchPickedNode is invoked during update operations. Also tells that:
"For rapid finger movements, it is quite likely that more than one touch event could arrive before the next rendering pass picks a 3D node. For this reason, no attempt is made to find the node for each and every touch location. In addition, the touch type is only added to the queue if it is different than the previous touch type."
IS there any way to issue my problem. I'm making a mistake? Thanks.