• Stars
    star
    107
  • Rank 323,587 (Top 7 %)
  • Language
    Objective-C
  • Created over 11 years ago
  • Updated over 11 years ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

Detect tangible objects on iOS. Tangible objects are physical objects detected on screen.

IOSTangibleDetector

Detect tangible objects on iOS. Tangible objects are physical objects detected on screen.
Currently, TangibleDetector detect only one object with 3 contact points.
Beta version : V 0.9.1

Screenshot & Demo Video

To see a demo video, click here

ScreenShot Demo Video

How To Get Started

Distance to point :

ScreenShot Demo Video

Add "TangilbleDetector.h" and "TangilbleDetector.m" in your xcodeprojet. Import the .h file :

``` objective-c #import "TangilbleDetector.h" ```

Add Delegate TangibleDetector :

``` objective-c @interface M_01 : CCLayer ```

Init the TangilbleDetector and multitouch :

``` objective-c TangilbleDetector *tangibleDetector = [[TangilbleDetector alloc]init]; self.tangibleDetector.delegate = self; self.view.multipleTouchEnabled = YES; ```

Add touch functions

- (void)touchesBegan:(NSSet *)touches withEvent:(UIEvent *)event{[self.tangibleDetector touchesBegan:touches];}

- (void)touchesMoved:(NSSet *)touches withEvent:(UIEvent *)event{[self.tangibleDetector touchesMoved:touches];}

- (void)touchesEnded:(NSSet *)touches withEvent:(UIEvent *)event{[self.tangibleDetector touchesEnded:touches];}

Edit TangilbleDetector.m

Change value to distance to touch :

``` objective-c int DistanceObjectMin = 96; int DistanceObjectLong1 = 111; int DistanceObjectLong2 = 111; ```

Get the position and angle of the object

Use delegate function in your view :

``` objective-c - (void)objectDetectedWithPosition:(CGPoint)position andAngle:(float)angle{
// (CGPoint)position
// position of object

// (float)angle
// angle of object

}

  • (void)objectisNotDetected{

    // if object is not Detected

}