use mvc for the testbed, update almost all tests, bugfixes, improvements, cleanup
Since I started altering the testbed for better maintainability, I prefered to drop this (tested) large change with a single commit. Some changes below: Put some globals in their correct place, Now Testbed uses the MVC pattern (Model-View Controller). This way it becomes better to maintain than using no pattern in my opinion. Fixed some bugs in the debug draw interface. Of course, updated almost all tests because of the differences. Update script.
This commit is contained in:
@ -19,8 +19,6 @@
|
||||
#ifndef ROPE_TEST_H
|
||||
#define ROPE_TEST_H
|
||||
|
||||
extern Settings g_settings;
|
||||
|
||||
class Rope : public Test
|
||||
{
|
||||
public:
|
||||
@ -31,8 +29,6 @@ public:
|
||||
|
||||
Rope()
|
||||
{
|
||||
g_camera.m_zoom = 30.0f;
|
||||
|
||||
b3Vec3 vs[e_count];
|
||||
float32 ms[e_count];
|
||||
|
||||
@ -89,22 +85,8 @@ public:
|
||||
|
||||
void Step()
|
||||
{
|
||||
float32 dt = g_settings.hertz > 0.0f ? 1.0f / g_settings.hertz : 0.0f;
|
||||
|
||||
if (g_settings.pause)
|
||||
{
|
||||
if (g_settings.singleStep)
|
||||
{
|
||||
g_settings.singleStep = false;
|
||||
}
|
||||
else
|
||||
{
|
||||
dt = 0.0f;
|
||||
}
|
||||
}
|
||||
|
||||
m_rope.Step(dt);
|
||||
m_rope.Draw(g_debugDraw);
|
||||
m_rope.Step(g_settings->inv_hertz);
|
||||
m_rope.Draw();
|
||||
}
|
||||
|
||||
static Test* Create()
|
||||
|
Reference in New Issue
Block a user