moved Engine::Object::draw() into .cc file as it got bigger
git-svn-id: svn://anubis/anaglym/trunk@50 99a6e188-d820-4881-8870-2d33a10e2619
This commit is contained in:
parent
4b34a2e565
commit
452b8fe3f3
32
anaglym.cc
32
anaglym.cc
@ -314,6 +314,21 @@ void Engine::update()
|
||||
m_drawing = false;
|
||||
}
|
||||
|
||||
void Engine::doPhysics()
|
||||
{
|
||||
static Uint32 last_updated = 0;
|
||||
Uint32 current_ticks = SDL_GetTicks();
|
||||
if (last_updated > 0)
|
||||
{
|
||||
Uint32 msec_steps = current_ticks - last_updated;
|
||||
for (int i = 0; i < msec_steps; i++)
|
||||
m_world.step();
|
||||
}
|
||||
last_updated = current_ticks;
|
||||
}
|
||||
|
||||
|
||||
|
||||
void Engine::Object::loadPhy(const std::string & path, bool static_data)
|
||||
{
|
||||
geoms = g_engine->m_world.loadPhy(path, &body, static_data);
|
||||
@ -338,15 +353,12 @@ void Engine::Object::getPosition(double * x, double * y, double * z)
|
||||
}
|
||||
}
|
||||
|
||||
void Engine::doPhysics()
|
||||
void Engine::Object::draw()
|
||||
{
|
||||
static Uint32 last_updated = 0;
|
||||
Uint32 current_ticks = SDL_GetTicks();
|
||||
if (last_updated > 0)
|
||||
{
|
||||
Uint32 msec_steps = current_ticks - last_updated;
|
||||
for (int i = 0; i < msec_steps; i++)
|
||||
m_world.step();
|
||||
}
|
||||
last_updated = current_ticks;
|
||||
if (body != 0)
|
||||
OdeWorld::pushTransform(dBodyGetPosition(body),
|
||||
dBodyGetRotation(body));
|
||||
glCallList(display_list);
|
||||
if (body != 0)
|
||||
glPopMatrix();
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user