A CC3WorldTouchHandler instance handles the touch event logic for a CC3World instance. More...
#import <CC3World.h>
Public Member Functions | |
(void) | - dispatchPickedNode |
(id) | - initOnWorld: |
(void) | - pickTouchedNode |
(void) | - touchEvent:at: |
Static Public Member Functions | |
(id) | + handlerOnWorld: |
A CC3WorldTouchHandler instance handles the touch event logic for a CC3World instance.
- (void) dispatchPickedNode |
Invoked by the CC3World during update operations, in the update loop that occurs occurs just after a touch event has been received by the touchEvent:at: method, and after a node has been picked as a result, by the pickTouchedNode method.
This implementation invokes the nodeSelected:byTouchEvent:at: method on the CC3World instance.
This method is invoked automatically whenever a touch event occurs. Usually, the application never needs to invoke this method directly.
+ (id) handlerOnWorld: | (CC3World *) | aCC3World |
Allocates and initializes an autoreleased instance on the specified CC3World.
- (void) pickTouchedNode |
Invoked by the CC3World during drawing operations in the rendering frame that occurs just after a touch event has been received by the touchEvent:at: method.
The picking algorithm runs a specialized drawing routine that paints each node with a unique color. The algorithm then reads the color of the pixel under the touch point from the GL color buffer. The received color is then mapped back to the node that was painted with that color.
This specialized coloring algorithm is inserted into normal drawing operations when (and only when) a touch event has been received. Once the node has been picked, the drawing operations are re-run in normal fashion prior to the final posting of the frame to the display.
The coloring-and-picking algorithm is run only once per touch event, and is not run during rendering frames when there has been no touch event received.
This method is invoked automatically whenever a touch event occurs. Usually, the application never needs to invoke this method directly.
- (void) touchEvent: | (uint) | tType | |
at: | (CGPoint) | tPoint | |
Handles the touch event of the specified type that occurred at the specified point.
The tType is one of the enumerated touch types: kCCTouchBegan, kCCTouchMoved, kCCTouchEnded, or kCCTouchCancelled. The tPoint is the location in 2D coordinate system of the CC3Layer where the touch occurred.
This method is invoked automatically whenever a touch event occurs. Usually, the application never needs to invoke this method directly.