I m developing a shooter. Vector EA is my sight view (Camera view direction). Vector DB is a line of the barrel and point B is a muzzle. Of course, the player “moves” the vector EA in different directions and moreover there is a leaning at the left and at the right.
I am doing all calculation with aid of sin and cos. Could someone provide a code how to use FRotationMatrix?
-
How can I get DB (rotator or vector) from EA (rotator) if I know angle BDC?
-
How can I get DB (rotator or vector) from EA (rotator) if I know angle BDC, and distance between AB (FVector).
-
How can I get DB (rotator or vector) from EA (rotator) if I know angle BDC, distance between AB (FVector), and ange of lean accordingly to EA line (EA will be always EA despite of amount of the angle).
FRotator SightLine; // direction of vector EA
FRotator BarrelAngle; // BarrelAngle.Pitch = angle BDC
FVector MuzzleShift; // MuzzleShift.Z = AB
FRotator LeanAngle; // LeanAngle.Roll = lean angle
