HISM AddInstances "IsRotationNormalized" error

When calling “AddInstances” from “HISM” in the editor, sometimes an error occurs

Assertion failed: IsRotationNormalized()

I set the rotation as follows:

FRotator rot(0, 360.f - countTurns * 90.f, 0);
rot.Normalize();
FTransform transform(rot, f_location);

Please help me figure it out.

Hi qimby123,

don’t call the normalize - the transform is expecting angles between -180 and 180 (or 0 to 360)

Hi!

Thanks, but without using normalization an error also occurs.
With such a rotation setting, it guarantees that it will be from 90 to 360.

FRotator rot(0, 360.f - (countTurns % 4) * 90.f, 0);
FTransform transform(rot, f_location);

The error occurs at different times, so the values are not the problem here.

Even so, the error occurs.

FTransform transform(FRotator::ZeroRotator, f_location);

I’ve never had this issue and I construct FTransforms all the time - only difference (I can’t see it making a difference with the exception though) is that I pass a FVector(1,1,1) for the Scale3D (3rd parameter).

Scale is passed by default to FVector(1,1,1). It didn’t help(

exactly, it looks like a bug:

In this example, “FQuat NewRot” is really not normalized, which is why an error occurs, but in my case it is normalized.
The problem is not in the rotation values, if that were the case, it would break at the first generation, but it breaks at different times for me.

There is an assumption that there is a memory overflow due to the created instances, but I’m not at all sure about it and I don’t know how to avoid it.

Decided.
I added “FCriticalSection critical” to the header, and locked the addition of the transform.

critical.Lock();
InstancesTransforms[hism].Add(transform);
critical.Unlock();

the problem was that I was recording from several threads and sometimes garbage was formed in the transforms, so such an error appeared.

2 Likes

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.