Download

Make rotation from axes

I want to create a rotator based on forward and up axes. There seems to be a function to do this in Blueprint (https://docs.unrealengine.com/latest/INT/BlueprintAPI/Math/Rotator/MakeRotationfromAxes/index.html), but I can’t find anything to do this in C++ short of constructing a rotation matrix then converting that into a rotator. Is there an easier way of doing this?

Thanks.

Yep, seems that’s what’s happening in that node.

FRotator UKismetMathLibrary::MakeRotationFromAxes(FVector Forward, FVector Right, FVector Up)
{
	Forward.Normalize();
	Right.Normalize();
	Up.Normalize();

	FMatrix RotMatrix(Forward, Right, Up, FVector::ZeroVector);

	return RotMatrix.Rotator();
}

Also discussed here: Access KismetMathLibrary? - UE4 AnswerHub