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,17 +19,11 @@
|
||||
#ifndef CLOTH_H
|
||||
#define CLOTH_H
|
||||
|
||||
extern DebugDraw* g_debugDraw;
|
||||
extern Camera g_camera;
|
||||
extern Settings g_settings;
|
||||
|
||||
class Cloth : public Test
|
||||
{
|
||||
public:
|
||||
Cloth()
|
||||
{
|
||||
g_camera.m_zoom = 25.0f;
|
||||
|
||||
b3ClothDef def;
|
||||
def.mesh = &m_clothMesh;
|
||||
def.density = 0.2f;
|
||||
@ -57,22 +51,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_cloth.Step(dt, g_settings.positionIterations);
|
||||
m_cloth.Draw(g_debugDraw);
|
||||
m_cloth.Step(g_settings->inv_hertz, g_settings->positionIterations);
|
||||
m_cloth.Draw();
|
||||
}
|
||||
|
||||
static Test* Create()
|
||||
|
Reference in New Issue
Block a user