[Pogamut-list] Feedback, Things that don't work properly and things that should be included
michal.bida
pogamut-forum at diana.ms.mff.cuni.cz
Thu Apr 28 09:54:58 CEST 2011
Re: Feedback, Things that don't work properly and things that should be included
Author: michal.bida
This is absolutely not necessary for the thing you want to do. To set focus point to someting in Front of the bot just compute it from bots location and rotation attributes:
{CODE()}
//computes focus point 500 ut units = 500 cm in front of the bot
Location startLoc = info.getLocation();
Location directionVector = self.getRotation().toLocation().getNormalized();
Location focusInFront = startLoc.add(directionVector.scale(500));
{CODE}
Find some examples online how to compute vectors and directions: e.g. [http://www.unrealtexture.com/Unreal/Downloads/3DEditing/UnrealEd/Tutorials/unrealwiki-offline/unrealscript-vector-maths.html]
(vector corresponds to Location, VSize corresponds to .size() , cross corresponds to .cross(), dot corresponds to .dot(), + to .add(), - to .sub(), normal to .getNormalized())
Note: If you call in pogamut myLoc.getNormalized() this means that it will return the new value as a result of this operation and this WILL NOT change the myLoc variable attribute. If you want to change the myLoc variable do it like this: myLoc = myLoc.getNormalized();
Best,
Michal
--
Reply Link: <http://diana.ms.mff.cuni.cz/main/tiki-view_forum_thread.php?forumId=4&comments_reply_threadId=4&comments_parentId=646&post_reply=1#form>
More information about the Pogamut-list
mailing list