00001 #ifndef DEFINES_H
00002 #define DEFINES_H
00003
00004
00005 #include <cmath>
00006
00007
00008
00009 #ifdef DEBUG
00010 #include <iostream>
00011
00012 #define LOG(x) std::cout << "LOG " << __FILE__ << ":" << __LINE__ << " : " << x << std::endl;
00013
00014 #ifdef DOLOG
00015 #define LLOG(x) LOG(x)
00016 #else
00017 #define LLOG(x)
00018 #endif
00019
00020 #define TRACE(x) std::cout << "TRACE " << __FILE__ << ":" << __LINE__ << " : " << __PRETTY_FUNCTION__ << " : " << x << std::endl;
00021 #else
00022 #define LOG(x)
00023 #define TRACE(x)
00024 #endif
00025
00026
00028 class Vec3f;
00029 class RGBAColor;
00030
00031
00033 extern const float EPSILON;
00034 extern const int RESX;
00035 extern const int RESY;
00036 extern const float MIN_INFLUENCE;
00037 extern const int MAX_RECURSION_DEEP;
00038 const static int NUMBER_OF_THREADS = 1;
00039 extern const unsigned int FRAMES;
00040
00041
00042 extern const float BALL_RADIUS;
00043 extern const Vec3f WORLD_UP;
00044 extern const Vec3f WORLD_UP_MASK;
00045 extern const Vec3f TABLE_MIN;
00046 extern const Vec3f TABLE_MAX;
00047
00048
00049 extern const float PHYS_EPS;
00050 extern const float MUE_SLIDING;
00051 extern const float MUE_ROLLING;
00052 extern const float MUE_BALLS;
00053 extern const float COLLISION_LOSS;
00054 extern const float T_IMPULSE;
00055 extern const float GRAVITY;
00056 extern const float CONTACT_RADIUS;
00057 extern const float BALL_MASS;
00058 extern const float SPREAD_POW;
00059 extern const float SPREAD_MAX_V;
00060 extern const float FRAME_LENGTH;
00061
00062
00067 float frand();
00068
00069
00077 float lerp(float a, float b, float f);
00078
00079
00087 Vec3f lerp(const Vec3f & a, const Vec3f & b, float f);
00088
00089
00097 RGBAColor lerp(const RGBAColor & a, const RGBAColor & b, float f);
00098
00099
00100 #endif
00101