DNESS / cocos2d-iphone

Automatically exported from code.google.com/p/cocos2d-iphone
1 stars 0 forks source link

ccpIntersectPoint gives incorrect result for incident lines that intersect at their end point #1481

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?

1. Run the following code...

    CGPoint pt1 = CGPointMake(0, 0);
    CGPoint pt2 = CGPointMake(1, 1);
    CGPoint pt3 = CGPointMake(1, 1);
    CGPoint pt4 = CGPointMake(2, 2);
    bool intersect = ccpSegmentIntersect(pt1, pt2, pt3, pt4);
    if (intersect) {
         CGPoint location = ccpIntersectPoint(pt1, pt2, pt3, pt4);
         NSLog(@"Intersect location: %@", NSStringFromCGPoint(location));
    }

What is the expected output?

Intersect location: {1, 1}

What do you see instead?

Intersect location: {0, 0}

What cocos2d version are you using ?

2.0

What iOS / Mac SDK are you using ?

6.1

Debug or Release ?

Debug

Which target device / target OS are you using ?

iPad

iOS only: Does this happens on device ? or on the simulator ? or on both ?

Both

Mac only: x86 or i386 ?

Please provide any additional information below.

Original issue reported on code.google.com by combinat...@gmail.com on 3 Apr 2013 at 4:21