1. 속도 계산
tempSpeed = newLocation.speed*3.6f;// m/s를 km/h로 바꾸기 (60*60)/1000
2. 타이머로 인터럽트
//타이머 생성
[NSTimer scheduledTimerWithTimeInterval:0.25f <ㅡ 요 단위마다 튕김
target:self
selector:@selector(onTick:)
userInfo:nil
repeats:YES];
그리고 구현..
-(void)onTick:(NSTimer*)timer
{
.. 요안에
}
일단 0.5초 단위로 onTick으로가서 나침반을 돌리면 움직임이 부드럽지 않을까?
cocos2D의 단위시간당 회전을 이용하면…
흠, 그런데 rotate 명령의 앵글은 추가 변화값이다. 기존 각도 값에서 변화된 양만큼만 뽑아서 계산해줘야하는구나.. 음. 일단 보류.