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"

how can I get 6DoF with control rotation?

My character is tumbling over on his head when he approaches the axis poles. The code below is in my character class on the tick function. It is intended to keep his feet pointed at the world center (the world is round). It works right up until he approaches the axis poles of the world.

 FTransform orgRot(FRotationMatrix::MakeFromZX(GetCapsuleComponent()->GetComponentLocation(), GetCapsuleComponent()->GetForwardVector()).ToQuat());
     FQuat addInRot = FRotator(0, mouseX, 0).Quaternion();

Product Version: UE 4.10
more ▼

asked Jul 01 '16 at 04:24 PM in C++ Programming

avatar image

966 143 150 390

avatar image Thumper Jul 05 '16 at 02:55 PM

alt text The character is standing on one of the poles of the world. The image is taken as I move the mouse to get yaw input. As I get input from the mouse x the character capsule starts to flip over on it's head.

upvector.jpg (69.7 kB)
avatar image Thumper Jul 05 '16 at 08:28 PM

I tried approaching it like this...

 const FVector yawAround = -GetCapsuleComponent()>GetComponentLocation().GetSafeNormal();
     const FVector newYawVec = GetCapsuleComponent()->GetForwardVector().RotateAngleAxis(mouseX, yawAround);
     FQuat orgRot(FRotationMatrix::MakeFromZX(GetCapsuleComponent()->GetComponentLocation(), newYawVec).Rotator());

and still exact same results....

avatar image Thumper Jul 06 '16 at 01:38 PM

I don't understand how adding the quaternions together in any order will help this. Ultimately I have to setControlRotation with a rotator. The debug stats above the character show the control rotation and the problem is and has been that I lose a degree of freedom.

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

1 answer: sort voted first

I had multiple posts (sorry). The answer is here.

more ▼

answered Jul 07 '16 at 04:23 PM

avatar image

966 143 150 390

(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