Tell me more ×
Stack Overflow is a question and answer site for professional and enthusiast programmers. It's 100% free, no registration required.

I want to create a CC3MeshNode with boundingvolume in cocos3d. I have created a CC3MeshNode with a pod file. I want to get notification on collision .

 -(void) initializeScene 
    {
    [self addContentFromPODFile: @"hello-world.pod" withName:@"pod1"];
    CC3MeshNode *object1 = (CC3MeshNode*)[self getNodeNamed: @"pod1"]; 
    CC3MeshNod *object2=[[object1 copyWithName:@"pod1"]autorelease];    
    [object1 populateAsSolidBox:CC3BoundingBoxMake(9.5, 5.0, 4.0, 0.0, 0.0, 0.0)];                 object1.location=cc3v(-5.0, 0.0, 0.0);  object2.location=cc3v(5.0, 0.0, 0.0);  
    [self addChild:object2];    
    CCActionInterval *move1=[CC3MoveTo actionWithDuration:3.0 moveTo:cc3v(-1.0, 0.0, 0.0)];    CCActionInterval *move2=[CC3MoveTo actionWithDuration:3.0 moveTo:cc3v(1.0, 0.0, 0.0)];    [object1 runAction:move1];    
    [object2 runAction:move2];
    }
        -(void) updateAfterTransform: (CC3NodeUpdatingVisitor*) visitor
         {
                if([object1 doesIntersectNode:object2])       
                NSLog(@"Collision !!!!!!!!!!!!!!!!!!!!!!");
        }

I tried to assign boundingvolume but didnt work. Actually i am confused in implementing boundingvolume for cc3MeshNode

share|improve this question
I get error in [object1 populateAsSolidBox:CC3BoundingBoxMake(9.5, 5.0, 4.0, 0.0, 0.0, 0.0)]; – Karan Alangat yesterday

Know someone who can answer? Share a link to this question via email, Google+, Twitter, or Facebook.

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Browse other questions tagged or ask your own question.