• [Unreal 게시판] MoveToward()의 거리 오차에 대한 오해2013.08.20 PM 10:38

게시물 주소 FONT글자 작게하기 글자 키우기

Question>

목적지까지 아래와 같이 이동을 했는데,

MoveToward( target, target, 300 );

이동을 다하고 정지상태에서 pawn과 target 사이 거리를

fGap = vsize( pawn.location - target.location );

위와 같이 계산하니 360정도가 찍히는데,
MoveToward()로 300 앞까지 접근해야 하는 거 아닌가?
target과의 거리가 300 이하일 때, 공격상태로 전환하려면?

-------------------------------------------------------------

Answer>

pawn과 target의 cylinderComponent.collisionRadius를 고려하셔야 합니다.

fGap =
vsize( pawn.location - target.location ) -
( pawn.cylinderComponent.collisionRadius + target.cylinderComponent.collisionRadius );

따라서,
fGap의 계산은 위와 같이 collisionRadius를 포함시켜야
정확한 계산이라 할 수 있습니다.^^;;;







Tag:
안기훈, Kee Hoon Ahn, 언리얼, Unreal, UDK, iPhone, iPad, app, 앱, iOS
댓글 : 0 개
친구글 비밀글 댓글 쓰기