c++ - UnrealEngine4:how can I calculate the new vector after rotate and translate a distance from source vector -


in ue4, how can calculate new vector after rotate , translate distance source vector.

i rotate cameracomponent rotator(r1) vector(v2) , rotator(r2) , move forward length(l1) in direction(r1), how can calculate new vector(v1) base on r1,l1,v2,r2? use c++ code better,thx~

yes, want know vector end after transformations. had resolve problem.

i describe problem again:

at beginning, cameracomponent @ c point, point a position of character, rotates camera θ angle(rotator a) , move l distance in direction of θ angle b point, want calculate vector , rotation of b point.

my solution code this:

vector vc = ...; rotator ra = ...; float l = ...; vector vb = vc + ra.vector() * l;  //final transform of b point vb.x *= -1; ra *= -1; 

c point


Comments

Popular posts from this blog

sql - VB.NET Operand type clash: date is incompatible with int error -

SVG stroke-linecap doesn't work for circles in Firefox? -

python - TypeError: Scalar value for argument 'color' is not numeric in openCV -