From: <hik...@us...> - 2009-08-13 12:37:56
|
Revision: 3852 http://supertuxkart.svn.sourceforge.net/supertuxkart/?rev=3852&view=rev Author: hikerstk Date: 2009-08-13 12:29:45 +0000 (Thu, 13 Aug 2009) Log Message: ----------- Fixed VS compilation error and warnings (no hypotf). Modified Paths: -------------- main/branches/irrlicht/src/items/flyable.cpp Modified: main/branches/irrlicht/src/items/flyable.cpp =================================================================== --- main/branches/irrlicht/src/items/flyable.cpp 2009-08-13 12:24:19 UTC (rev 3851) +++ main/branches/irrlicht/src/items/flyable.cpp 2009-08-13 12:29:45 UTC (rev 3852) @@ -192,12 +192,12 @@ float item_XY_speed, float gravity, float y_offset, float *fire_angle, float *up_velocity, float *time_estimated) { - btVector3 relative_target_kart_loc = target_kart->getTrans().getOrigin() - origin; + Vec3 relative_target_kart_loc = target_kart->getTrans().getOrigin() - origin; btTransform trans = target_kart->getTrans(); - btVector3 target_direction(trans.getBasis()[0][1], - trans.getBasis()[1][1], - trans.getBasis()[2][1]); + Vec3 target_direction(trans.getBasis()[0][1], + trans.getBasis()[1][1], + trans.getBasis()[2][1]); float dx = relative_target_kart_loc.getX(); float dy = relative_target_kart_loc.getY(); @@ -207,7 +207,7 @@ float gy = target_direction.getY(); float gz = target_direction.getZ(); - float target_kart_speed = hypotf(gx, gy) * target_kart->getSpeed(); //Projected onto X-Y plane + float target_kart_speed = target_direction.length_2d() * target_kart->getSpeed(); //Projected onto X-Y plane float target_kart_heading = atan2f(-gx, gy); //anti-clockwise @@ -231,10 +231,10 @@ fire_th += M_PI; //createPhysics offset - time -= y_offset / hypotf(a, b); + time -= y_offset / sqrt(a*a+b*b); *fire_angle = fire_th; - *up_velocity = (0.5 * time * gravity) + (dz / time) + (gz * target_kart->getSpeed()); + *up_velocity = (0.5f * time * gravity) + (dz / time) + (gz * target_kart->getSpeed()); *time_estimated = time; } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |