comparison melee.d @ 7:2217fd1fe384

added angular and linear velocity limit
author zzzzrrr <mason.green@gmail.com>
date Sat, 21 Mar 2009 19:34:20 -0400
parents eb6059f7035a
children 4ee9e4a0c03b
comparison
equal deleted inserted replaced
6:eb6059f7035a 7:2217fd1fe384
62 const HINGE_RADIUS = 0.05f; 62 const HINGE_RADIUS = 0.05f;
63 63
64 // Smallest allowed dimension 64 // Smallest allowed dimension
65 const MIN_DIMENSION = 0.1; 65 const MIN_DIMENSION = 0.1;
66 66
67 // Water stuffs
68 const MAX_PARTICLES = 10000;
69 const WATER_BOUNCE = 0.01;
70 const WATER_FRICTION = 0.5;
71 const WATER_RADIUS = 0.05f;
72 const MAX_CIRCLE_RES = 32;
73
74 const k_maxContactPoints = 2048; 67 const k_maxContactPoints = 2048;
75 68
76 enum ContactState { 69 enum ContactState {
77 e_contactAdded, 70 e_contactAdded,
78 e_contactPersisted, 71 e_contactPersisted,
89 ContactState state; 82 ContactState state;
90 } 83 }
91 84
92 // Melee settings. Some can be controlled in the GUI. 85 // Melee settings. Some can be controlled in the GUI.
93 struct Settings { 86 struct Settings {
94 float hz = 60; 87 float hz = 30;
95 int velocityIterations = 8; 88 int velocityIterations = 5;
96 int positionIterations = 2; 89 int positionIterations = 1;
97 bool drawShapes = true; 90 bool drawShapes = true;
98 bool drawJoints = true; 91 bool drawJoints = true;
99 bool drawControllers; 92 bool drawControllers;
100 bool drawCoreShapes; 93 bool drawCoreShapes;
101 bool drawAABBs; 94 bool drawAABBs;
169 init(); 162 init();
170 } 163 }
171 164
172 void init() { 165 void init() {
173 // Define world boundaries 166 // Define world boundaries
174 worldAABB.lowerBound.set(-100.0f, -100.0f); 167 worldAABB.lowerBound.set(-200.0f, -200.0f);
175 worldAABB.upperBound.set(100.0f, 100.0f); 168 worldAABB.upperBound.set(200.0f, 200.0f);
176 world = new bzWorld(worldAABB, gravity, allowSleep); 169 world = new bzWorld(worldAABB, gravity, allowSleep);
177 world.boundaryListener = m_boundaryListener; 170 world.boundaryListener = m_boundaryListener;
178 world.contactListener = m_contactListener; 171 world.contactListener = m_contactListener;
179 viewCenter = vec2(10, 10); 172 viewCenter = vec2(10, 10);
180 ship1 = new Orz(world); 173 ship1 = new Orz(world);