Announcement

Collapse
No announcement yet.

These operators

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

    These operators

    The operators >> and << show up in Epics code rather often when converting Velocity and Rotation into a "real velocity". I was just wondering what do they actually do and how do they work... They appear to be operators for a logical shift left or a logical shift right but i dont understand how Velocity << Rotation produces the actual velocity.

    #2
    I would really like to know this too. I racked my brain trying to figure out these **** things...

    Comment


      #3
      if, for instance, you have a flashlight you want to project into the world. you spawn it at the pawns eyelocation. it looks like its coming from your forehead. if, for instance, you want the light to come from one side or the other, you have to "offset" it i a bit. you define a vector for this, and add it to your pawns eye location when you spawn the flashlight. so if you define the offset vector to be 7 units in the y direction, and apply that to your pawn, youll get an absolute offset. meaning, no matter which direction youre facing, its always 7 units in the y direction. so to convert this to "relative" coordinates, you would rotate this offset. so you define a rotator to be the view rotation. to rotate the offset, you call this:

      RotatedVector = OffsetVector >> ViewRotation;

      this will rotate the vector to face the direction of the rotator. this way, when you add this new vector to your eye location, the flashlight always spawns on the right side of your pawns head.

      to put it in simpler terms, it just rotates the vector to face the same direction as the rotator. as far as i know, it can only be used with a vector and a rotator, in that order. << might do the opposite, and make the rotator face the direction of the vector (i dont personally know of another way to do this, but this is just a guess).

      Comment


        #4
        Ah, thank you. I thought it might do something like that, but wasnt sure. This info will be handy to know.

        Comment

        Working...
        X