RSS

(root)/iphone/common : 23 : common/source/geometry.h

To get this branch, use:
bzr branch /browse/iphone/common

« back to all changes in this revision

Viewing changes to common/source/geometry.h

Dömötör Gulyás
2009-08-09 18:33:08
Revision ID: dognotdog@gmail.com-20090809163308-k92rpn48plb13cqe
adds ability to create textures from PDF; adds color value to shaders; jigs now displays movement mode

Show diffs side-by-side

added added

removed removed

382
382
        return ((ta > 0.0) && (ta < 1.0) && (tb > 0.0) && (tb < 1.0));
383
383
}
384
384
 
 
385
static inline CGPoint CGLineIntersectionPoint(CGPoint p0, CGPoint p1, CGPoint p2, CGPoint p3)
 
386
{
 
387
        float d = CGPointCross(CGPointSub(p1,p0), CGPointSub(p3,p2));
 
388
        
 
389
        if (d == 0.0)
 
390
                return CGPointZero;
 
391
        
 
392
//      float a = CGPointCross(CGPointSub(p2,p0), CGPointSub(p3,p2));
 
393
        float b = CGPointCross(CGPointSub(p2,p0), CGPointSub(p1,p0));
 
394
        
 
395
//      float ta = a/d;
 
396
        float tb = b/d;
 
397
 
 
398
        return CGPointAdd(p2, CGPointScale(CGPointSub(p3,p2), tb));
 
399
}
 
400
 
 
401
 
385
402
static inline long CGPointInTriangle(CGPoint p, CGPoint a0, CGPoint a1, CGPoint a2)
386
403
{
387
404
        CGPoint v0 = CGPointSub(a1, a0);

Loggerhead 1.17 is a web-based interface for Bazaar branches