title: Cocos2d v3 & chipmunk collision detection issues
body: <p>First try at Chipmunk.</p>
  
  <p>Not getting collision detection registering is the problem.</p>
  
  <p>My code:</p>
  
  <pre><code>@implementation MainPlayScene
  {
      CCPhysicsNode *_physics;
      CCNode *MyPhysicsBody;
      CCNode *bottomBody;
  
  }
  
  + (instancetype)scene
  {
      return [[self alloc] init];
  }
  
  - (instancetype)init
   {
   // Apple recommend assigning self with      supers return value, and handling self not created
      self = [super init];
      if (!self) return(nil);
  
      _physics = [CCPhysicsNode node];
      _physics.debugDraw = YES;
      [self addChild:_physics z:1];
  
   /// BOTTOM
      CGRect bottomRect = CGRectMake(0, 0,      [CCDirector sharedDirector].viewSize.width, 10);
      bottomBody = [CCNode node];
      bottomBody.physicsBody = [CCPhysicsBody bodyWithPolylineFromRect:bottomRect     cornerRadius:0];
      bottomBody.physicsBody.collisionCategories = @[@"Bottom"];
     bottomBody.physicsBody.type =     CCPhysicsBodyTypeStatic;
      [_physics addChild:bottomBody];
  
    /// MyBody to bounce around
      MyPhysicsBody = [CCSprite spriteWithImageNamed:@"MyBody-64x64-24.png"];
      MyPhysicsBody.position = ccp((self.contentSize.width/2),(self.contentSize.height/2));
      MyPhysicsBody = [CCNode node];
      MyPhysicsBody.physicsBody = [CCPhysicsBody bodyWithRect:(CGRect){CGPointZero,  MyPhysicsBody.contentSize.height,MyPhysicsBody.contentSize.width} cornerRadius:0];
        MyPhysicsBody.physicsBody.collisionCategories = @[@"MyBody"];
      [_physics addChild:MyPhysicsBody z:150];
  
      self.userInteractionEnabled = YES;
      return self;
  }
  </code></pre>
  
  <p>Detecting touch events and applying force to physics body to have it bounce up and down onto bottom body</p>
  
  <pre><code> - (void)touchBegan:(UITouch *)touch withEvent:(UIEvent *)event
  {   
      CCLOG(@"Touch Detected");
      [MyPhysicsBody.physicsBody applyImpulse:ccp(0, 300.f)];
  }
  </code></pre>
  
  <p>Now I try to detect a collision on “Bottom” but nothing is being registered even though I see debug lines of 2 objects touch.</p>
  
  <pre><code>/// try onCollisionEnter first ... nothing 
  -(void)onCollisionEnter:(CCNode *)entity collisionPair:(CCPhysicsCollisionPair *)pair
  {
      if ([entity.physicsBody.collisionCategories  isEqual: @"Bottom"]) {
          CCLOG(@"Hit bottomBody");
      }
  
  }
  
  /// try ccPhysicsCollisionBegin pair ... nothing
  -(BOOL)ccPhysicsCollisionBegin:(CCPhysicsCollisionPair *)pair MyBody:(CCNode *) MyBody Botton:(CCNode *)Bottom
  {
       CCLOG(@"Hit bottomBody");
       return TRUE;
  }
  </code></pre>
  
  <p>Obviously I’m missing something critical here …</p>
  
  <p>Any help is VERY appreciated!</p>
  
  <p>Thanks</p>