From ad19e537066742e1a5f9bbb8c3549a47480a33c1 Mon Sep 17 00:00:00 2001 From: Samu Laaksonen Date: Mon, 10 Dec 2012 23:47:03 +0200 Subject: Box2d integration Very crude and buggy Needs to be much better --- src/common.h | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) create mode 100644 src/common.h (limited to 'src/common.h') diff --git a/src/common.h b/src/common.h new file mode 100644 index 0000000..42f55f7 --- /dev/null +++ b/src/common.h @@ -0,0 +1,17 @@ +#ifndef COMMON_H +#define COMMON_H + +// Box2D works best for objects of size 0.1m ... 10m +// So we have a miniature world this time, makes easier to make things happen when +// used forces are not too big, and nothing too surprising should not happen either... +// 16px = 0.1m +// this makes our main character as 32px * 64px ( 20cm wide and 40cm tall ) +#define _PMF (0.1f / 16.0f) + +#define P2M(x) ((x) * (_PMF)) +#define M2P(x) ((x) / (_PMF)) + +#define FPS 60 +#define FRAME_INTERVAL (1000 / FPS) + +#endif -- cgit v1.2.3