Announcement

Collapse
No announcement yet.

What does Combine Rotators do ?

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

    What does Combine Rotators do ?

    Hello, I was doing some little research but I am still not able to figure out what does "Combine Rotators" node do. I was expecting it is simple RotatorA.Yaw + RotatorB.Yaw, RotatorA.Pitch + RotatorB.Pitch, RotatorA.Roll + RotatorB.Roll, but after checking results it is some different operation. Can you give me please some nice explanation on this node ? I saw it here http://www.youtube.com/watch?v=JH6zL...aR5dLHOFw4-MMl and I am not sure why he includes node in his graph. Thank you

    #2
    they are internally quaternion, here is a snipped of code from engine source

    Code:
    FRotator UKismetMathLibrary::ComposeRotators(FRotator A, FRotator B)
    {
        FQuat AQuat = FQuat(A);
        FQuat BQuat = FQuat(B);
    
        return FRotator(BQuat*AQuat);
    }
    Unreal Engine 4 Game Framework diagram for relation of all major base object types
    Unreal Engine 4 Input Event diagram, scroll down to section Input Processing Procedural
    Resident Evil Classic Camera
    RPCs official document, Must Read
    Everything you should know about replication

    Comment


      #3
      Hello. In the video, the function just adds 22.5 degrees to the yaw of the player character. I guess this is because he wanted to set the range of the north, for example, to be between 336.5 and 22.5 degrees, but not between 0 and 45 degrees, without troublesome calculation.

      Comment


        #4
        Originally posted by ymars View Post
        Hello. In the video, the function just adds 22.5 degrees to the yaw of the player character. I guess this is because he wanted to set the range of the north, for example, to be between 336.5 and 22.5 degrees, but not between 0 and 45 degrees, without troublesome calculation.
        I still don't understand this can you make it little bit more clear? He said the directions will be from 0 to 180 with sign. So where does this 336.5 come from?

        Comment


          #5
          Hello AbhimanyuAryan,

          Imagine what would happen if we disabled the offset as shown below:

          Click image for larger version

Name:	Direction1.png
Views:	1
Size:	31.1 KB
ID:	1112242

          This would be odd because, even though you faced in the direction of 359 degrees, the direction would result in North West instead of North. The direction of 359 degrees is really close to the imaginary Noth axis, which is displayed just below 0 degree as a green line.

          So, the zone for North should be placed around the North axis (grey line) as shown below:

          Click image for larger version

Name:	Direction2.png
Views:	1
Size:	39.5 KB
ID:	1112243

          As you should have understood by now, the offset is supposed to be 22.5 degrees as each zone has a 45 degree range and each axis needs to be located in the middle of the zone.

          So, if the character faces in the direction of 359 degrees (or -1 degree), the rotation will be changed into 21.5 degrees, which, in turn, falls into Index 0 (i.e. North) of the array as it is divided by 45 degrees using the "Floor" node.
          Last edited by ymars; 07-19-2016, 08:10 AM.

          Comment


            #6
            for other people ,such us A(10,20,30)、B(40,50,60),CombineRotator(A,B) .In world space.First, make A rotate 40 on the Roll.Second ,make A rotate 50 on the Pitch.Last,make A rotate 60 on the Yaw。

            Comment

            Working...
            X