x

Search in
Sort by:

Question Status:

Search help

  • Simple searches use one or more words. Separate the words with spaces (cat dog) to search cat,dog or both. Separate the words with plus signs (cat +dog) to search for items that may contain cat but must contain dog.
  • You can further refine your search on the search results page, where you can search by keywords, author, topic. These can be combined with each other. Examples
    • cat dog --matches anything with cat,dog or both
    • cat +dog --searches for cat +dog where dog is a mandatory term
    • cat -dog -- searches for cat excluding any result containing dog
    • [cats] —will restrict your search to results with topic named "cats"
    • [cats] [dogs] —will restrict your search to results with both topics, "cats", and "dogs"

Office Holiday

Epic Games' offices will be on holiday from June 22nd to July 7th. During this period support will be limited. Our offices will reopen on Monday, July 8th. 

Can I use ProjectPointToNavigation in C++?

I'm just wondering if there is a C++ version of the blueprint function ProjectPointToNavigation. I've gone through the list of functions that a vector uses and PointPlaneProject is probably the closest to what I want to use (though at this point I'm not sure how to get a reference to a nav mesh plane).

Product Version: Not Selected
Tags:
more ▼

asked Mar 20 '15 at 12:29 AM in C++ Programming

avatar image

jechli
145 22 26 84

avatar image mirsabayu Mar 20 '15 at 12:46 AM

Is it project point to navigation for aicontroller?? If it's like that i think it is a cpp function. Try to look at aicontroller function moveToActor and moveToLocation

(comments are locked)
10|2000 characters needed characters left
Viewable by all users

1 answer: sort voted first

You can find ProjectPointToNavigation in NavigationSystem.h

two definition for you

     bool ProjectPointToNavigation(const FVector& Point, FNavLocation& OutLocation, const FVector& Extent = INVALID_NAVEXTENT, const FNavAgentProperties* AgentProperties = NULL, TSharedPtr<const FNavigationQueryFilter> QueryFilter = NULL)

and

     bool ProjectPointToNavigation(const FVector& Point, FNavLocation& OutLocation, const FVector& Extent = INVALID_NAVEXTENT, const ANavigationData* NavData = NULL, TSharedPtr<const FNavigationQueryFilter> QueryFilter = NULL) const;
 



And you can use it with something like this

 FNavLocation NavLoc;
 FVector QueryingExtent = FVector(50.0f, 50.0f, 250.0f);
 FNavAgentProperties NavAgentProps;
 //Set you NavAgentProps properties here (radius, height, etc)
     bool bProjectedLocationValid = GetWorld()->GetNavigationSystem()->ProjectPointToNavigation(GetActorLocation(), NavLoc, QueryingExtent, MyNavData);


Hopes this helps

Cheers,

  • Marc

more ▼

answered Mar 20 '15 at 01:09 AM

avatar image

MarcAndreG
710 27 12 40

avatar image jechli Mar 20 '15 at 04:25 PM

Thank you!

(comments are locked)
10|2000 characters needed characters left
Viewable by all users
Your answer
toggle preview:

Up to 5 attachments (including images) can be used with a maximum of 5.2 MB each and 5.2 MB total.

Follow this question

Once you sign in you will be able to subscribe for any updates here

Answers to this question