Download

rotation values are not precise

Hi
I have a problem with strange values when rotating SM, for example, I take a basic static mesh cube, rotate it by 30 degrees and the program rotates the solid by 30.000061 degrees. How can I fix it?

See here.

This is arguably the type of question that should be in a FAQ somewhere (maybe it is, IDK?).
Overall, Epic aren’t really great at explaining things and have neglected the docs for a decade.
Maybe they should just outsource it all, stick to what they’re genius at, which is engine tech?:wink:

@CoquiGames

If we assume that 1uu == 1cm then difference is ]61 micrometers. Does it really matter?

Editt: I was wrong. Its 0.61 micrometers.

if you are making architecture? Yea. It matters.

imagine this is the placement of a beam on which you attach a 10km stick.
The end point of the clearly imaginary stick would be:
.000061 × 10,000.0 = .61 - or nearly half a meter away from where you needed it to be.

It’s miniscule, sure. But it is also enough to cause issues when baking lights.

If it matters for you, simply set it manually by typing it in and hitting enter - which converts the euler to quat.
or, make an actor you place around that automatically removes by rounding the final value on construction script. You can even force snapping in 90 or 45 increments this way, without having to change the snap settings in editor. Dpending on what it is ofc.

if you are concerned of performance, you could modify the engine’s static mesh actor code to do this as well…

If this is really important, there is a problem because float doesn’t have that precision.