Hi, I am generating quaterion x.y.z, w values from an external c++ code, I want to apply these to an actor within unreal.
I found this code, but would like to understand how I can modify it for all my quaterion values, x,y,z,w so my actors rotation is rotated.
void ATestActor::Tick(float DeltaSeconds)
{
Super::Tick(DeltaSeconds);
auto rot = GetActorRotation();
FQuat q1 = FQuat(rot); // Current rotator to quaternion
FQuat q2(FVector(1,0,0), 0.2*DeltaSeconds); // rotate around axis (1,0,0) on angle 0.2*DeltaSeconds
FQuat qr = q2*q1; // Get result quaternion
SetActorRotation(qr.Rotator()); // Set quaternion to object
}