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"

A little vector math problem

alt text

I need to move pawn P to location L along the right vector of actor A (none moving static mesh), L being on the line of A's forward vector. Or put more simply, move P along A's right vector until they line up.

How would you do this?

Product Version: Not Selected
Tags:
more ▼

asked Nov 23 '14 at 04:37 PM in C++ Programming

avatar image

Gigantoad
111 9 13 22

avatar image BaderThanBad Nov 23 '14 at 04:44 PM

Is this in 2d (You want to line up the x,y) or 3d?

avatar image Gigantoad Nov 23 '14 at 04:55 PM

It will be 3D but I suck at drawing in perspective! Was hoping the same principles would apply.

Just to clarify, the question is how to determine L.

avatar image BaderThanBad Nov 23 '14 at 04:55 PM

Project point P onto the line created by A's forward vector. Look up how to do projection with vectors and points. The behavior of how you want to move it is entirely up to you.

avatar image BaderThanBad Nov 23 '14 at 05:03 PM

This function would probably do what you want. link text

avatar image Gigantoad Nov 23 '14 at 05:26 PM

Indeed, projection seems to be what I was missing. Will look into it, thanks a lot.

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

1 answer: sort voted first

You could raytrace from Pawn's forward vector and have the pawn move to the left until the ray trace hits actor A, then stop movement. Or some system like that

more ▼

answered Dec 30 '14 at 03:45 PM

avatar image

Fenra
276 9 15 185

(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