Hello everyone!
I’m working on the Ferris wheel and Rollercoaster and they are almost done, however the CPU usage is immersive due to the code. It’s based on the two decompiled files of GTA as well as the work from @manups4e (thanks a lot!).
So, my issue is… is there a an alternative of “SetEntityCoordsNoOffset” that can “move” the cabins alongside with the wheel or a way to reduce the load from this loop? It’s called each tick so the movement of the cabins can be synchronized with the one from the ferris wheel.
for (int ss = 0; ss < 16; ss++)
{
float x = 6.28319f / 16 * ss;
Vector3 offset_cabin = GetOffsetFromEntityInWorldCoords(Wheel.Entity.Handle, 0f, CustomMath.Deg2rad(15.3f) * CustomMath.Rad2deg((float)Math.Sin(x)), CustomMath.Deg2rad(-15.3f) * CustomMath.Rad2deg((float)Math.Cos(x)));
SetEntityCoordsNoOffset(Cabins[ss].Entity.Handle, offset_cabin.X, offset_cabin.Y, offset_cabin.Z, true, false, false);
}
Thanks!