diff options
Diffstat (limited to 'source/gameengine/Converter/KX_ConvertActuators.cpp')
-rw-r--r-- | source/gameengine/Converter/KX_ConvertActuators.cpp | 20 |
1 files changed, 11 insertions, 9 deletions
diff --git a/source/gameengine/Converter/KX_ConvertActuators.cpp b/source/gameengine/Converter/KX_ConvertActuators.cpp index b9e41d553b3..01516a24182 100644 --- a/source/gameengine/Converter/KX_ConvertActuators.cpp +++ b/source/gameengine/Converter/KX_ConvertActuators.cpp @@ -37,6 +37,8 @@ #pragma warning (disable : 4786) #endif //WIN32 +#include <math.h> + #include "MEM_guardedalloc.h" #include "KX_BlenderSceneConverter.h" @@ -395,7 +397,7 @@ void BL_ConvertActuators(char* maggiename, new KX_SoundActuator(gameobj, snd_sound, soundact->volume, - exp((soundact->pitch / 12.0) * log(2.0)), + (float)(exp((soundact->pitch / 12.0) * log(2.0))), is3d, settings, soundActuatorType); @@ -542,8 +544,8 @@ void BL_ConvertActuators(char* maggiename, /* convert settings... degrees in the ui become radians */ /* internally */ if (conact->type == ACT_CONST_TYPE_ORI) { - min = (MT_2_PI * conact->minloc[0])/360.0; - max = (MT_2_PI * conact->maxloc[0])/360.0; + min = (float)((MT_2_PI * conact->minloc[0])/360.0); + max = (float)((MT_2_PI * conact->maxloc[0])/360.0); switch (conact->mode) { case ACT_CONST_DIRPX: locrot = KX_ConstraintActuator::KX_ACT_CONSTRAINT_ORIX; @@ -642,18 +644,18 @@ void BL_ConvertActuators(char* maggiename, break; case ACT_CONST_ROTX: locrot = KX_ConstraintActuator::KX_ACT_CONSTRAINT_ROTX; - min = MT_2_PI * conact->minrot[0] / 360.0; - max = MT_2_PI * conact->maxrot[0] / 360.0; + min = conact->minrot[0] * (float)MT_RADS_PER_DEG; + max = conact->maxrot[0] * (float)MT_RADS_PER_DEG; break; case ACT_CONST_ROTY: locrot = KX_ConstraintActuator::KX_ACT_CONSTRAINT_ROTY; - min = MT_2_PI * conact->minrot[1] / 360.0; - max = MT_2_PI * conact->maxrot[1] / 360.0; + min = conact->minrot[1] * (float)MT_RADS_PER_DEG; + max = conact->maxrot[1] * (float)MT_RADS_PER_DEG; break; case ACT_CONST_ROTZ: locrot = KX_ConstraintActuator::KX_ACT_CONSTRAINT_ROTZ; - min = MT_2_PI * conact->minrot[2] / 360.0; - max = MT_2_PI * conact->maxrot[2] / 360.0; + min = conact->minrot[2] * (float)MT_RADS_PER_DEG; + max = conact->maxrot[2] * (float)MT_RADS_PER_DEG; break; default: ; /* error */ |