Download

Rotator or Vector? I have states that need to set a impulse vector for the pawn...

Hey all,
Being pretty new to Vector/3D math, I was a little confused as to how to store desired Pawn direction headings so that when its state changes, it gets an appropriate impulse vector.

ie: when state is set to North, set the pawn impulse vector to FVector or FRotator labelled as North to get an impulse vector of X1,Y0,Z0

Basically should those direction headings be stored as a FRotator or FVector - and why?

Thanks!

I would assume FVector is ideal, as an impulse could be represented by a vector in space with a certain magnitude. The FRotator would be useful if you need to keep track of the orientation of something. I guess it would be possible to combine both the FRotator and FVector to create an impulse that both pushes an object and gives it a spin. This is at least what pops into my mind on the subject.

Maybe it’s best to ask, what do you want to happen when the object receives the impulse? That could change the answer drastically.

Ah so maybe I misunderstood rotator, does it impart angular momentum for spinning?

I don’t know that much about how the engine handles it specifically, but I assume it could. If I’m not mistaken the FRotator can be converted to euler, quaternion and matrix representation of rotations. So they can be used for a lot of things. I don’t see why it could not be used for angular momentum.

right, sorry I was just curious if you meant it was only used for angular momentum cases, thanks

No worries. You can use FVector and FRotators just as you would with a float or int32. They have some extra advantages of course, like helper functions for normalizing them or operator overloading for dot and cross products. Make good use of them. :smiley: