20 #ifndef WORLDSIMCONFIG_H
21 #define WORLDSIMCONFIG_H
29 #ifdef FARSA_WSIM_BUILDING_DLL
30 #define FARSA_WSIM_API __declspec(dllexport)
31 #define FARSA_WSIM_TEMPLATE __declspec(dllexport)
33 #define FARSA_WSIM_API __declspec(dllimport)
34 #define FARSA_WSIM_TEMPLATE
36 #define FARSA_WSIM_INTERNAL
38 #define FARSA_WSIM_API
39 #define FARSA_WSIM_TEMPLATE
40 #define FARSA_WSIM_INTERNAL __attribute__ ((visibility ("hidden")))
43 extern bool FARSA_WSIM_API initWorldSimLib();
44 static const bool worldSimInitializer = initWorldSimLib();
51 #define FARSA_WSIM_VERSION 10203
58 #define UNUSED_PARAM( a ) ( (void) a );
67 #define PI_GRECO 3.14159265358979323846f
77 inline FARSA_WSIM_TEMPLATE real
toRad( real x ) {
78 return (x)*PI_GRECO/180.0f;
84 inline FARSA_WSIM_TEMPLATE real
toDegree( real x ) {
85 return (x)*180.0f/PI_GRECO;
91 template<
class T,
class U>
92 FARSA_WSIM_TEMPLATE
const T
min(
const T& t1,
const U& t2 ) {
103 template<
class T,
class U>
104 FARSA_WSIM_TEMPLATE
const T
max(
const T& t1,
const U& t2 ) {
115 inline FARSA_WSIM_TEMPLATE real
ramp( real minv, real maxv, real value ) {
116 if ( value > maxv )
return maxv;
117 if ( value < minv )
return minv;
131 float outMin = -1,
float outMax = 1 ) {
132 float m = ( outMax-outMin )/(
max-
min );
133 float q = outMin - m*
min;
135 if (ret < outMin)
return outMin;
136 if (ret > outMax)
return outMax;
150 float outMin = -1,
float outMax = 1 ) {
151 double m = - ( outMax-outMin )/(
max-
min );
152 double q = outMax - m*
min;
154 if (ret < outMin)
return outMin;
155 if (ret > outMax)
return outMax;
161 #include "simpletimer.h"