Physics4K  2013-06-04
Physics4K is the next great evolution in 2D physics engines. built upon the C++ Game Framework, it is going to take the next generation gaming world by storm.
 All Classes Namespaces Files Functions Variables Enumerations Enumerator Friends Macros
World.h
Go to the documentation of this file.
1 // Filename: World.h
4 
5 //Preprocessor directive designed to cause the current source file to be included only once in a single compilation
6 #pragma once
7 
8 //Includes
9 #include "PKInclude.h"
10 #include <vector>
11 #include "Box.h"
12 #include "Vector2f.h"
13 #include "ShapePair.h"
14 #include "MathXtras.h"
15 #include "Joint.h"
16 #include "Shape.h"
17 
18 namespace PK
19 {
20  class PK_API World
21  {
22  public:
23  World(Vector2f gravity);
24  ~World();
25 
26  void GenerateWorld();
27  bool Update(float timeStep);
28 
29  void Add(Shape* item);
30  void Add(Joint* item);
31  Joint* GenerateJoint(Box* box1, Box* box2, const Vector2f anchorPoint);
32  void Clear();
33 
34  std::vector<Vector2f> GetCurrentCollisionPoints();
35 
36  private:
37  std::vector<Shape*> m_physicsList;
38  std::vector<Joint*> m_jointList;
39  ShapePair** m_shapePairList;
40  int m_shapePairListSize;
42  bool m_canRun;
43  Vector2f m_gravity;
44  };
45 }