~ubuntu-branches/ubuntu/wily/box2d/wily

« back to all changes in this revision

Viewing changes to Box2D/Testbed/Tests/EdgeShapes.h

  • Committer: Package Import Robot
  • Author(s): Markus Koschany
  • Date: 2014-05-30 18:42:02 UTC
  • mfrom: (1.1.2)
  • Revision ID: package-import@ubuntu.com-20140530184202-hosw11agojg02ac3
Tags: 2.3.1+ds-1
* Imported Upstream version 2.3.1+ds.
* Fix debian/watch to determine new releases by parsing
  the SVN tags of upstream's version control system.
* Update get-orig-source target for new release.
* dh_strip override: Replace $VER variable with 2.3.0 string.
* debian/copyright: Add new Public Domain and Apache 2.0 license.
* libbox2d-dev.install:
  - Install *.cmake files in /usr/lib/$(DEB_HOST_MULTIARCH)/cmake/Box2D.

Show diffs side-by-side

added added

removed removed

Lines of Context:
27
27
                m_fixture = NULL;
28
28
        }
29
29
 
30
 
        float32 ReportFixture(  b2Fixture* fixture, const b2Vec2& point,
31
 
                const b2Vec2& normal, float32 fraction)
 
30
        float32 ReportFixture(b2Fixture* fixture, const b2Vec2& point,
 
31
                                                  const b2Vec2& normal, float32 fraction)
32
32
        {
33
33
                m_fixture = fixture;
34
34
                m_point = point;
75
75
                }
76
76
 
77
77
                {
78
 
                        b2Vec2 vertices[3];
79
 
                        vertices[0].Set(-0.5f, 0.0f);
80
 
                        vertices[1].Set(0.5f, 0.0f);
81
 
                        vertices[2].Set(0.0f, 1.5f);
82
 
                        m_polygons[0].Set(vertices, 3);
83
 
                }
 
78
                b2Vec2 vertices[3];
 
79
                vertices[0].Set(-0.5f, 0.0f);
 
80
                vertices[1].Set(0.5f, 0.0f);
 
81
                vertices[2].Set(0.0f, 1.5f);
 
82
                m_polygons[0].Set(vertices, 3);
 
83
        }
84
84
 
85
85
                {
86
86
                        b2Vec2 vertices[3];
178
178
                }
179
179
        }
180
180
 
181
 
        void Keyboard(unsigned char key)
 
181
        void Keyboard(int key)
182
182
        {
183
183
                switch (key)
184
184
                {
185
 
                case '1':
186
 
                case '2':
187
 
                case '3':
188
 
                case '4':
189
 
                case '5':
190
 
                        Create(key - '1');
 
185
                case GLFW_KEY_1:
 
186
                case GLFW_KEY_2:
 
187
                case GLFW_KEY_3:
 
188
                case GLFW_KEY_4:
 
189
                case GLFW_KEY_5:
 
190
                        Create(key - GLFW_KEY_1);
191
191
                        break;
192
192
 
193
 
                case 'd':
 
193
                case GLFW_KEY_D:
194
194
                        DestroyBody();
195
195
                        break;
196
196
                }
201
201
                bool advanceRay = settings->pause == 0 || settings->singleStep;
202
202
 
203
203
                Test::Step(settings);
204
 
                m_debugDraw.DrawString(5, m_textLine, "Press 1-5 to drop stuff");
 
204
                g_debugDraw.DrawString(5, m_textLine, "Press 1-5 to drop stuff");
205
205
                m_textLine += DRAW_STRING_NEW_LINE;
206
206
 
207
207
                float32 L = 25.0f;
215
215
 
216
216
                if (callback.m_fixture)
217
217
                {
218
 
                        m_debugDraw.DrawPoint(callback.m_point, 5.0f, b2Color(0.4f, 0.9f, 0.4f));
 
218
                        g_debugDraw.DrawPoint(callback.m_point, 5.0f, b2Color(0.4f, 0.9f, 0.4f));
219
219
 
220
 
                        m_debugDraw.DrawSegment(point1, callback.m_point, b2Color(0.8f, 0.8f, 0.8f));
 
220
                        g_debugDraw.DrawSegment(point1, callback.m_point, b2Color(0.8f, 0.8f, 0.8f));
221
221
 
222
222
                        b2Vec2 head = callback.m_point + 0.5f * callback.m_normal;
223
 
                        m_debugDraw.DrawSegment(callback.m_point, head, b2Color(0.9f, 0.9f, 0.4f));
 
223
                        g_debugDraw.DrawSegment(callback.m_point, head, b2Color(0.9f, 0.9f, 0.4f));
224
224
                }
225
225
                else
226
226
                {
227
 
                        m_debugDraw.DrawSegment(point1, point2, b2Color(0.8f, 0.8f, 0.8f));
 
227
                        g_debugDraw.DrawSegment(point1, point2, b2Color(0.8f, 0.8f, 0.8f));
228
228
                }
229
229
 
230
230
                if (advanceRay)