void Space::DebugDumpFrames() { memset(space, ' ', sizeof(space)); printf("Frame structure for '%s':\n", m_starSystem->GetName().c_str()); DebugDumpFrame(m_rootFrame.Get(), 2); }
static void DebugDumpFrame(Frame *f, unsigned int indent) { printf("%.*s%p (%s)", indent, space, f, f->GetLabel().c_str()); if (f->GetParent()) printf(" parent %p (%s)", f->GetParent(), f->GetParent()->GetLabel().c_str()); if (f->GetBody()) printf(" body %p (%s)", f->GetBody(), f->GetBody()->GetLabel().c_str()); if (Body *b = f->GetBody()) printf(" bodyFor %p (%s)", b, b->GetLabel().c_str()); printf(" distance %f radius %f", f->GetPosition().Length(), f->GetRadius()); printf("%s\n", f->IsRotFrame() ? " [rotating]" : ""); for (Frame::ChildIterator it = f->BeginChildren(); it != f->EndChildren(); ++it) DebugDumpFrame(*it, indent+2); }
static void DebugDumpFrame(const Frame *f, unsigned int indent) { printf("%.*s%p (%s)", indent, space, f, f->GetLabel().c_str()); if (f->m_parent) printf(" parent %p (%s)", f->m_parent, f->m_parent->GetLabel().c_str()); if (f->m_astroBody) printf(" body %p (%s)", f->m_astroBody, f->m_astroBody->GetLabel().c_str()); if (Body *b = f->GetBodyFor()) printf(" bodyFor %p (%s)", b, b->GetLabel().c_str()); printf(" distance %f radius %f", f->GetPosition().Length(), f->GetRadius()); printf("%s\n", f->IsRotatingFrame() ? " [rotating]" : ""); for (std::list<Frame*>::const_iterator i = f->m_children.begin(); i != f->m_children.end(); ++i) DebugDumpFrame(*i, indent+2); }