RSS

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

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

« back to all changes in this revision

Viewing changes to source/geometry.h

Dömötör Gulyás
2010-08-14 00:28:38
Revision ID: dognotdog@gmail.com-20100813222838-6csktimwtfzq66fl
fixes CGPoint rotation; makes VertexArray accept other vertex formats

Show diffs side-by-side

added added

removed removed

366
366
}
367
367
 
368
368
 
 
369
static inline CGPoint CGPointMin(CGPoint a, CGPoint b)
 
370
{
 
371
        return CGPointMake(fminf(a.x,b.x), fminf(a.y,b.y));
 
372
}
 
373
 
 
374
static inline CGPoint CGPointMax(CGPoint a, CGPoint b)
 
375
{
 
376
        return CGPointMake(fmaxf(a.x,b.x), fmaxf(a.y,b.y));
 
377
}
 
378
 
369
379
static inline CGPoint CGPointAdd(CGPoint a, CGPoint b)
370
380
{
371
381
        return CGPointMake(a.x+b.x, a.y+b.y);
440
450
 
441
451
static inline CGPoint CGPointRotate(CGPoint a, float w)
442
452
{
443
 
        CGPoint cross = CGPointMake(a.y,-a.x);
444
 
 
445
453
        float cosa = cosf(w), sina = sin(w);
446
454
        
447
455
        CGPoint r;
448
456
 
449
 
        r.x = a.x*cosa + cross.x*sina;
450
 
        r.y = a.y*cosa + cross.y*sina;
 
457
        r.x = a.x*cosa - a.y*sina;
 
458
        r.y = a.y*cosa + a.x*sina;
451
459
 
452
460
        return r;
453
461
        

Loggerhead 1.17 is a web-based interface for Bazaar branches