Lephisto/src/space.h

37 lines
958 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(void);
static void Serialize(void);
static void Unserialize(void);
static void GenBody(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;
static Frame* rootFrame;
private:
static void MoveOrbitingObjectFrames(Frame* f);
static void UpdateFramesOfReference(void);
static void CollideFrame(Frame* f);
static void PruneCorpses(void);
static void ApplyGravity(void);
static std::list<Body*> corpses;
};