Initialize libbullet git in 2.0_beta.
[platform/upstream/libbullet.git] / Extras / AllBulletDemosOSX / src / BTDemo.h
1 /*
2 Bullet Continuous Collision Detection and Physics Library
3 Copyright (c) 2003-2006 Erwin Coumans  http://continuousphysics.com/Bullet/
4
5 This software is provided 'as-is', without any express or implied warranty.
6 In no event will the authors be held liable for any damages arising from the use of this software.
7 Permission is granted to anyone to use this software for any purpose, 
8 including commercial applications, and to alter it and redistribute it freely, 
9 subject to the following restrictions:
10
11 1. The origin of this software must not be misrepresented; you must not claim that you wrote the original software. If you use this software in a product, an acknowledgment in the product documentation would be appreciated but is not required.
12 2. Altered source versions must be plainly marked as such, and must not be misrepresented as being the original software.
13 3. This notice may not be removed or altered from any source distribution.
14 */
15
16 #import <Cocoa/Cocoa.h>
17 #import "BTOpenGLDisplayDelegate.h"
18
19 @class BTDemoEntry;
20
21 @interface BTDemo : NSObject <BTOpenGLDisplayDelegate> {
22
23         NSString *_demoName;
24         BTDemoEntry *_demo;
25 }
26
27 /**
28         @brief Array of all available bullet demos
29 */
30 + (NSArray*) demoNames;
31
32 /**
33         @brief Verify a given string is a demo name
34 */
35 + (BOOL) isDemo: (NSString *) demoName;
36
37 /**
38         @brief Create a demo with a given name
39         @note Returns nil if the name is not a valid demo name
40 */
41 + (BTDemo*) demoWithName: (NSString *) demoName;
42
43 /**
44         @brief Initialize a demo with a given name
45 */
46 - (id) initWithDemoName: (NSString *) demoName;
47
48 /**
49         @brief Reset current demo
50 */
51 - (void) reset;
52
53 /**
54         @brief Name of current demo
55 */
56 - (NSString*) demoName;
57
58 ///////////////////////////////////////////////////////////////////////
59 // BTOpenGLDisplayDelegate
60
61 - (void) contextCreated;
62 - (void) contextWillBeDestroyed;
63 - (void) contextWillResize;
64 - (void) contextResized: (NSSize) newSize;
65 - (void) contextDidResize;
66 - (void) contextStateInvalidated;
67
68 - (void) display: (float) deltaT;
69
70 - (void) keyPressed: (unsigned char) key;
71 - (void) keyReleased: (unsigned char) key;
72
73 - (void) specialKeyPressed: (unsigned) GLUTKey;
74 - (void) specialKeyReleased: (unsigned) GLUTKey;
75
76 - (void) mouseButtonPressed: (unsigned) mouseButton;
77 - (void) mouseButtonReleased: (unsigned) mouseButton;
78 - (void) mouseMoved: (NSPoint) delta;
79 - (void) newMousePosition: (NSPoint) newMousePosition;
80 - (void) scrollWheel: (NSPoint) delta;
81
82 ///////////////////////////////////////////////////////////////////////
83 // Global simulation properties -- applies to all demos
84
85 + (void) setIterations: (unsigned) iterations;
86 + (unsigned) iterations;
87
88 + (unsigned) minIterations;
89 + (unsigned) maxIterations;
90
91 + (void) setDisableDeactivation: (BOOL) disableDeactivation;
92 + (BOOL) disableDeactivation;
93
94 + (void) setDrawAABBs: (BOOL) drawAABBs;
95 + (BOOL) drawAABBs;
96
97 + (void) setDebugDraw: (BOOL) debugDraw;
98 + (BOOL) debugDraw;
99
100 + (void) setSplitImpulse: (BOOL) splitImpulse;
101 + (BOOL) splitImpulse;
102
103 + (void) setDrawContacts: (BOOL) drawContacts;
104 + (BOOL) drawContacts;
105
106 @end