project_files/HedgewarsMobile/Classes/CGPointUtils.h
author koda
Sat, 05 Feb 2011 15:45:44 +0100
changeset 4920 bc3c077e15a2
parent 4476 4bf74e158f44
child 4976 088d40d8aba2
permissions -rw-r--r--
cleaning up how chat is handled on idevices updated project to use updated libs some leaks resolved (maybe)
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
3547
02875b1145b7 i <3 mercurial
koda
parents: 3546
diff changeset
     1
/*
02875b1145b7 i <3 mercurial
koda
parents: 3546
diff changeset
     2
 *  CGPointUtils.h
02875b1145b7 i <3 mercurial
koda
parents: 3546
diff changeset
     3
 *  PinchMe
02875b1145b7 i <3 mercurial
koda
parents: 3546
diff changeset
     4
 *
02875b1145b7 i <3 mercurial
koda
parents: 3546
diff changeset
     5
 *  Created by Jeff LaMarche on 8/2/08.
02875b1145b7 i <3 mercurial
koda
parents: 3546
diff changeset
     6
 *  Copyright 2008 __MyCompanyName__. All rights reserved.
02875b1145b7 i <3 mercurial
koda
parents: 3546
diff changeset
     7
 *
02875b1145b7 i <3 mercurial
koda
parents: 3546
diff changeset
     8
 */
02875b1145b7 i <3 mercurial
koda
parents: 3546
diff changeset
     9
02875b1145b7 i <3 mercurial
koda
parents: 3546
diff changeset
    10
#import <CoreGraphics/CoreGraphics.h>
02875b1145b7 i <3 mercurial
koda
parents: 3546
diff changeset
    11
3680
aaf832c6fbd7 fix panning when zoomed (finally)
koda
parents: 3551
diff changeset
    12
#define degreesToRadians(x) ( M_PI * x / 180.0)
aaf832c6fbd7 fix panning when zoomed (finally)
koda
parents: 3551
diff changeset
    13
#define radiansToDegrees(x) (180.0 * x / M_PI )
3547
02875b1145b7 i <3 mercurial
koda
parents: 3546
diff changeset
    14
3680
aaf832c6fbd7 fix panning when zoomed (finally)
koda
parents: 3551
diff changeset
    15
#define HWX(x) (int)(x-screen.size.height/2)/HW_zoomFactor()
3996
eb549fd864a5 the ios port is also iphone compatible
koda
parents: 3680
diff changeset
    16
#define HWY(x) (int)(screen.size.width-x)/HW_zoomFactor() + (IS_IPAD()?40:17.5)*HW_zoomLevel()/HW_zoomFactor()
3680
aaf832c6fbd7 fix panning when zoomed (finally)
koda
parents: 3551
diff changeset
    17
aaf832c6fbd7 fix panning when zoomed (finally)
koda
parents: 3551
diff changeset
    18
#define HWXZ(x) (int)(x-screen.size.height/2)
aaf832c6fbd7 fix panning when zoomed (finally)
koda
parents: 3551
diff changeset
    19
#define HWYZ(x) (int)(screen.size.width-x)
3551
d4de36b3801a moar zoom, fixed fort mode, other glitches
koda
parents: 3547
diff changeset
    20
3547
02875b1145b7 i <3 mercurial
koda
parents: 3546
diff changeset
    21
CGFloat distanceBetweenPoints (CGPoint first, CGPoint second);
02875b1145b7 i <3 mercurial
koda
parents: 3546
diff changeset
    22
CGFloat angleBetweenPoints(CGPoint first, CGPoint second);
3680
aaf832c6fbd7 fix panning when zoomed (finally)
koda
parents: 3551
diff changeset
    23
CGFloat angleBetweenLines(CGPoint line1Start, CGPoint line1End, CGPoint line2Start, CGPoint line2End);
4476
4bf74e158f44 team selection completely refactored, now has animation and more performance
koda
parents: 3996
diff changeset
    24
4bf74e158f44 team selection completely refactored, now has animation and more performance
koda
parents: 3996
diff changeset
    25
CGFloat CGPointDot(CGPoint a, CGPoint b);
4bf74e158f44 team selection completely refactored, now has animation and more performance
koda
parents: 3996
diff changeset
    26
CGFloat CGPointLen(CGPoint a);
4bf74e158f44 team selection completely refactored, now has animation and more performance
koda
parents: 3996
diff changeset
    27
CGPoint CGPointSub(CGPoint a, CGPoint b);
4bf74e158f44 team selection completely refactored, now has animation and more performance
koda
parents: 3996
diff changeset
    28
CGFloat CGPointDist(CGPoint a, CGPoint b);
4bf74e158f44 team selection completely refactored, now has animation and more performance
koda
parents: 3996
diff changeset
    29
CGPoint CGPointNorm(CGPoint a);