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

« back to all changes in this revision

Viewing changes to Box2D/Testbed/Tests/TimeOfImpact.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:
65
65
 
66
66
                b2TimeOfImpact(&output, &input);
67
67
 
68
 
                m_debugDraw.DrawString(5, m_textLine, "toi = %g", output.t);
 
68
                g_debugDraw.DrawString(5, m_textLine, "toi = %g", output.t);
69
69
                m_textLine += DRAW_STRING_NEW_LINE;
70
70
 
71
71
                extern int32 b2_toiMaxIters, b2_toiMaxRootIters;
72
 
                m_debugDraw.DrawString(5, m_textLine, "max toi iters = %d, max root iters = %d", b2_toiMaxIters, b2_toiMaxRootIters);
 
72
                g_debugDraw.DrawString(5, m_textLine, "max toi iters = %d, max root iters = %d", b2_toiMaxIters, b2_toiMaxRootIters);
73
73
                m_textLine += DRAW_STRING_NEW_LINE;
74
74
 
75
75
                b2Vec2 vertices[b2_maxPolygonVertices];
80
80
                {
81
81
                        vertices[i] = b2Mul(transformA, m_shapeA.m_vertices[i]);
82
82
                }
83
 
                m_debugDraw.DrawPolygon(vertices, m_shapeA.m_count, b2Color(0.9f, 0.9f, 0.9f));
 
83
                g_debugDraw.DrawPolygon(vertices, m_shapeA.m_count, b2Color(0.9f, 0.9f, 0.9f));
84
84
 
85
85
                b2Transform transformB;
86
86
                sweepB.GetTransform(&transformB, 0.0f);
91
91
                {
92
92
                        vertices[i] = b2Mul(transformB, m_shapeB.m_vertices[i]);
93
93
                }
94
 
                m_debugDraw.DrawPolygon(vertices, m_shapeB.m_count, b2Color(0.5f, 0.9f, 0.5f));
 
94
                g_debugDraw.DrawPolygon(vertices, m_shapeB.m_count, b2Color(0.5f, 0.9f, 0.5f));
95
95
 
96
96
                sweepB.GetTransform(&transformB, output.t);
97
97
                for (int32 i = 0; i < m_shapeB.m_count; ++i)
98
98
                {
99
99
                        vertices[i] = b2Mul(transformB, m_shapeB.m_vertices[i]);
100
100
                }
101
 
                m_debugDraw.DrawPolygon(vertices, m_shapeB.m_count, b2Color(0.5f, 0.7f, 0.9f));
 
101
                g_debugDraw.DrawPolygon(vertices, m_shapeB.m_count, b2Color(0.5f, 0.7f, 0.9f));
102
102
 
103
103
                sweepB.GetTransform(&transformB, 1.0f);
104
104
                for (int32 i = 0; i < m_shapeB.m_count; ++i)
105
105
                {
106
106
                        vertices[i] = b2Mul(transformB, m_shapeB.m_vertices[i]);
107
107
                }
108
 
                m_debugDraw.DrawPolygon(vertices, m_shapeB.m_count, b2Color(0.9f, 0.5f, 0.5f));
 
108
                g_debugDraw.DrawPolygon(vertices, m_shapeB.m_count, b2Color(0.9f, 0.5f, 0.5f));
109
109
 
110
110
#if 0
111
111
                for (float32 t = 0.0f; t < 1.0f; t += 0.1f)
115
115
                        {
116
116
                                vertices[i] = b2Mul(transformB, m_shapeB.m_vertices[i]);
117
117
                        }
118
 
                        m_debugDraw.DrawPolygon(vertices, m_shapeB.m_count, b2Color(0.9f, 0.5f, 0.5f));
 
118
                        g_debugDraw.DrawPolygon(vertices, m_shapeB.m_count, b2Color(0.9f, 0.5f, 0.5f));
119
119
                }
120
120
#endif
121
121
        }