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"

Add Torque in local space in C++

I am able to add torque to my objects, but it seems to be relative to the world and not to the actor, how do I change that? Currently using something like the following

 void AFlightPawn::Pitch(float Val)
     AddTorque(FVector(0, Val * SpeedFactor * 1000, 0));
Product Version: Not Selected
more ▼

asked Aug 11 '14 at 12:53 AM in C++ Programming

avatar image

16 4 5 7

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

1 answer: sort voted first

This got me very confused for a couple hours until I realized its just the failings of using Euler angles instead of Quaternions. No idea why such an advanced game engine wouldn't use quaternions as the default (and why the left handed coordinate system whyyyyy).


This will rotate the actor around its own Z axis (Yaw).

 FQuat myActorQuat = GetActorQuat();
 MyMesh->AddTorque(myActorQuat.RotateVector(FVector(0.0f, 0.0f, myRotForce)), NAME_None, false); 

more ▼

answered Nov 05 '15 at 07:16 PM

avatar image

279 14 27 91

(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