iphone toDegrees toDegrees编译器问题
我试着用目标c函数的环面,将双折射率转换成弧度,如下所示:iphone toDegrees toDegrees编译器问题,iphone,objective-c,compiler-construction,warnings,Iphone,Objective C,Compiler Construction,Warnings,我试着用目标c函数的环面,将双折射率转换成弧度,如下所示: double oldLat = toRadians(oldLocation.coordinate.latitude); location = [[CCDirector sharedDirector] convertToGL:location]; // Determine offset of location to projectile int offX = location.x - PROJECTIL
double oldLat = toRadians(oldLocation.coordinate.latitude);
location = [[CCDirector sharedDirector] convertToGL:location];
// Determine offset of location to projectile
int offX = location.x - PROJECTILE_POSITION_X;
int offY = location.y - PROJECTILE_POSITION_Y;
int realX = winSize.width + (PROJECTILE_WIDTH/2);
float ratio = (float) offY / (float) offX;
int realY = (realX * ratio) + PROJECTILE_POSITION_Y;
int offRealX = realX - PROJECTILE_POSITION_X;
int offRealY = realY - PROJECTILE_POSITION_Y;
// Determine angle to face
float angleRadians = atanf((float)offRealY / (float)offRealX);
float angleDegrees = (__angleRadians__)/((__angleRadians__) * 57.29577951f);
但我不断收到编译器警告和错误,或是托拉迪安和托德格的隐式声明
location = [[CCDirector sharedDirector] convertToGL:location];
// Determine offset of location to projectile
int offX = location.x - PROJECTILE_POSITION_X;
int offY = location.y - PROJECTILE_POSITION_Y;
int realX = winSize.width + (PROJECTILE_WIDTH/2);
float ratio = (float) offY / (float) offX;
int realY = (realX * ratio) + PROJECTILE_POSITION_Y;
int offRealX = realX - PROJECTILE_POSITION_X;
int offRealY = realY - PROJECTILE_POSITION_Y;
// Determine angle to face
float angleRadians = atanf((float)offRealY / (float)offRealX);
float angleDegrees = (__angleRadians__)/((__angleRadians__) * 57.29577951f);
我包括了#import
,但出于某种原因,这并没有解决问题
location = [[CCDirector sharedDirector] convertToGL:location];
// Determine offset of location to projectile
int offX = location.x - PROJECTILE_POSITION_X;
int offY = location.y - PROJECTILE_POSITION_Y;
int realX = winSize.width + (PROJECTILE_WIDTH/2);
float ratio = (float) offY / (float) offX;
int realY = (realX * ratio) + PROJECTILE_POSITION_Y;
int offRealX = realX - PROJECTILE_POSITION_X;
int offRealY = realY - PROJECTILE_POSITION_Y;
// Determine angle to face
float angleRadians = atanf((float)offRealY / (float)offRealX);
float angleDegrees = (__angleRadians__)/((__angleRadians__) * 57.29577951f);
任何帮助都是非常值得赞赏的。< / P> < P >基础课上没有TrADADIANS。您可以手动转换它
location = [[CCDirector sharedDirector] convertToGL:location];
// Determine offset of location to projectile
int offX = location.x - PROJECTILE_POSITION_X;
int offY = location.y - PROJECTILE_POSITION_Y;
int realX = winSize.width + (PROJECTILE_WIDTH/2);
float ratio = (float) offY / (float) offX;
int realY = (realX * ratio) + PROJECTILE_POSITION_Y;
int offRealX = realX - PROJECTILE_POSITION_X;
int offRealY = realY - PROJECTILE_POSITION_Y;
// Determine angle to face
float angleRadians = atanf((float)offRealY / (float)offRealX);
float angleDegrees = (__angleRadians__)/((__angleRadians__) * 57.29577951f);
degrees*M_PI/180.0
location = [[CCDirector sharedDirector] convertToGL:location];
// Determine offset of location to projectile
int offX = location.x - PROJECTILE_POSITION_X;
int offY = location.y - PROJECTILE_POSITION_Y;
int realX = winSize.width + (PROJECTILE_WIDTH/2);
float ratio = (float) offY / (float) offX;
int realY = (realX * ratio) + PROJECTILE_POSITION_Y;
int offRealX = realX - PROJECTILE_POSITION_X;
int offRealY = realY - PROJECTILE_POSITION_Y;
// Determine angle to face
float angleRadians = atanf((float)offRealY / (float)offRealX);
float angleDegrees = (__angleRadians__)/((__angleRadians__) * 57.29577951f);
基金会导入了math.h,所以你将有M_PI,否则你将不得不
location = [[CCDirector sharedDirector] convertToGL:location];
// Determine offset of location to projectile
int offX = location.x - PROJECTILE_POSITION_X;
int offY = location.y - PROJECTILE_POSITION_Y;
int realX = winSize.width + (PROJECTILE_WIDTH/2);
float ratio = (float) offY / (float) offX;
int realY = (realX * ratio) + PROJECTILE_POSITION_Y;
int offRealX = realX - PROJECTILE_POSITION_X;
int offRealY = realY - PROJECTILE_POSITION_Y;
// Determine angle to face
float angleRadians = atanf((float)offRealY / (float)offRealX);
float angleDegrees = (__angleRadians__)/((__angleRadians__) * 57.29577951f);
<代码>包括< /代码>
< P >基础类中没有TrADADIAN。您可以手动转换它location = [[CCDirector sharedDirector] convertToGL:location];
// Determine offset of location to projectile
int offX = location.x - PROJECTILE_POSITION_X;
int offY = location.y - PROJECTILE_POSITION_Y;
int realX = winSize.width + (PROJECTILE_WIDTH/2);
float ratio = (float) offY / (float) offX;
int realY = (realX * ratio) + PROJECTILE_POSITION_Y;
int offRealX = realX - PROJECTILE_POSITION_X;
int offRealY = realY - PROJECTILE_POSITION_Y;
// Determine angle to face
float angleRadians = atanf((float)offRealY / (float)offRealX);
float angleDegrees = (__angleRadians__)/((__angleRadians__) * 57.29577951f);
degrees*M_PI/180.0
location = [[CCDirector sharedDirector] convertToGL:location];
// Determine offset of location to projectile
int offX = location.x - PROJECTILE_POSITION_X;
int offY = location.y - PROJECTILE_POSITION_Y;
int realX = winSize.width + (PROJECTILE_WIDTH/2);
float ratio = (float) offY / (float) offX;
int realY = (realX * ratio) + PROJECTILE_POSITION_Y;
int offRealX = realX - PROJECTILE_POSITION_X;
int offRealY = realY - PROJECTILE_POSITION_Y;
// Determine angle to face
float angleRadians = atanf((float)offRealY / (float)offRealX);
float angleDegrees = (__angleRadians__)/((__angleRadians__) * 57.29577951f);
基金会导入了math.h,所以你将有M_PI,否则你将不得不
location = [[CCDirector sharedDirector] convertToGL:location];
// Determine offset of location to projectile
int offX = location.x - PROJECTILE_POSITION_X;
int offY = location.y - PROJECTILE_POSITION_Y;
int realX = winSize.width + (PROJECTILE_WIDTH/2);
float ratio = (float) offY / (float) offX;
int realY = (realX * ratio) + PROJECTILE_POSITION_Y;
int offRealX = realX - PROJECTILE_POSITION_X;
int offRealY = realY - PROJECTILE_POSITION_Y;
// Determine angle to face
float angleRadians = atanf((float)offRealY / (float)offRealX);
float angleDegrees = (__angleRadians__)/((__angleRadians__) * 57.29577951f);
#包括
尝试以下编码:-(弧度到度)
location = [[CCDirector sharedDirector] convertToGL:location];
// Determine offset of location to projectile
int offX = location.x - PROJECTILE_POSITION_X;
int offY = location.y - PROJECTILE_POSITION_Y;
int realX = winSize.width + (PROJECTILE_WIDTH/2);
float ratio = (float) offY / (float) offX;
int realY = (realX * ratio) + PROJECTILE_POSITION_Y;
int offRealX = realX - PROJECTILE_POSITION_X;
int offRealY = realY - PROJECTILE_POSITION_Y;
// Determine angle to face
float angleRadians = atanf((float)offRealY / (float)offRealX);
float angleDegrees = (__angleRadians__)/((__angleRadians__) * 57.29577951f);
尝试以下编码:-(弧度到度)
location = [[CCDirector sharedDirector] convertToGL:location];
// Determine offset of location to projectile
int offX = location.x - PROJECTILE_POSITION_X;
int offY = location.y - PROJECTILE_POSITION_Y;
int realX = winSize.width + (PROJECTILE_WIDTH/2);
float ratio = (float) offY / (float) offX;
int realY = (realX * ratio) + PROJECTILE_POSITION_Y;
int offRealX = realX - PROJECTILE_POSITION_X;
int offRealY = realY - PROJECTILE_POSITION_Y;
// Determine angle to face
float angleRadians = atanf((float)offRealY / (float)offRealX);
float angleDegrees = (__angleRadians__)/((__angleRadians__) * 57.29577951f);