Rotation of -0.0118>0<0.0118 fails

Running UE 4.8.1 and 4.8.2, attempting a rotation between -0.0118 and 0.0118 will fail. In this case from BluePrint I have tested using AddActor(World|Local)Rotation and manually setting the rotation to current+deltaRotYaw.

From what I can see in the engine source code, this is due to small rotations being treated as inconsequential. In my case, I need the very small rotations to still count as I am rotating a planet (earth) in real-time speeds. I would be happy if there’s a way around this that does not require me to branch the source for this alone.

Hi kiforsbe,

Rotators aren’t meant to be used at such small increments and there is a cap to how many times they can be ticked in a rotation. This is just a limitation of the engine.

I suggest creating this feature by using XVector To Rotation. You would need to workout the math but it will work and be much more performant.

Another way to go about this all together would be to just use a panning material.

Cheers,

TJ

Hi TJ. Thanks for the quick reply.
I can’t unfortunately implement this solely by using material functions such as panning. At least not at this distance from the planet (0 to 100km above surface, think Kerbal Space Program or No Mans Sky).

I’ve now also tested using the following:

const FQuat CurRelRotQuat = GetOwner()->GetActorQuat();
const FQuat NewRelRotQuat = CurRelRotQuat * FRotator(0.f, -0.001f, 0.f).Quaternion();

const bool res = GetOwner()->SetActorRotation(NewRelRotQuat);

Which results in:

LogTemp: OldYaw: -133.783554, ProposedYaw: -133.784470, NewYaw: -133.783554, Rotation OK: 1

To be honest, still not sure what you mean with using XVector To Rotation, as the rotation is thrown away in UPrimitiveComponent::MoveComponentImpl from what I can see. Most likely on the following:

if (NewRotationQuat.Equals(ComponentToWorld.GetRotation()))
		{
			// copy to optional output param
			if (OutHit)
			{
				*OutHit = BlockingHit;
			}
			return true;
		}

Is there some other way to assign the rotation that gets around this limitation? Both FRotator and FQuat store the desired rotation properly, but it is not applied to the actor. I can’t really see any way around this at the moment other than to branch and change the tolerances in the engine.