Lephisto/src/space.h

34 lines
875 B
C++

#pragma once
#include <list>
#include "vector3.h"
#include "star_system.h"
class Body;
class Frame;
/* The place all the 'Body's exist in. */
class Space {
public:
static void Init(void);
static void Clear(void);
static void BuildSystem(StarSystem* s);
static void GenBody(StarSystem* s, StarSystem::SBody* b, Frame* f);
static void TimeStep(float step);
static void AddBody(Body*);
static void KillBody(Body*);
static void Render(const Frame* cam_frame);
static Frame* GetRootFrame(void) { return rootFrame; }
static dWorldID world;
static std::list<Body*> bodies;
typedef std::list<Body*>::iterator bodiesIter_t;
private:
static void UpdateFramesOfReference(void);
static void CollideFrame(Frame* f);
static void PruneCorpses(void);
static Frame* rootFrame;
//static std::list<Frame*> rootFrames;
static std::list<Body*> corpses;
};