public:
void Update(float dt);
+ bool InBounds(Vector<int> pos) const
+ { return pos.x > 0 && pos.y > 0 && pos.x < size.x && pos.y < size.y; }
int Index(Vector<int> pos) const { return pos.x * size.y + pos.y; }
float MassAt(Vector<int> pos) const { return masses[Index(pos)]; }
Entity &AddEntity(const Entity &);
Vector<float> ForceAt(Vector<float>, float m) const;
+ bool WorldCollision(const Entity &, Vector<float> &) const;
+ Vector<float> NormalAt(Vector<float>) const;
+ bool IsSurface(Vector<int>) const;
private:
Vector<int> size;