AttachObjectToObject messing up objects
#4

Okay I found out AttachObjectToObject offsets are really messy in the code itself, I don't know what's causing it really.

If someone is interested about how I fixed it:

pawn Код:
new Float:tposx = NukeObject[i][PosX]-NukeObject[0][PosX], Float:tposy = NukeObject[0][PosY]-NukeObject[i][PosY], Float:tposz = NukeObject[0][PosZ]-NukeObject[i][PosZ];
new Float:tposrx = NukeObject[i][PosRX]-NukeObject[0][PosRX], Float:tposry = NukeObject[i][PosRY]-NukeObject[0][PosRY], Float:tposrz = NukeObject[0][PosRZ]-NukeObject[i][PosRZ];
AttachObjectToObject(NukeObject[i][ObjID], NukeObject[0][ObjID], tposy, tposz, tposx, tposry, -tposrz, tposrx, 1);
So, generally everything is meant to be calculated by attachedobj - mainobj XYZs. But, it seems to not work that way, so I debugged it ingame quite some time, and found out that Y, Z and RZ offsets should be calculated the other way around, by mainobj - attachedobj.

Also, when attaching the object, the parameters are not (x, y, z, rx, ry, rz), they are actually (y, z, x, y, z, x).

Enjoy
Reply


Messages In This Thread
AttachObjectToObject messing up objects - by arad55 - 28.07.2017, 22:17
Re: AttachObjectToObject messing up objects - by Kane - 28.07.2017, 23:19
Re: AttachObjectToObject messing up objects - by arad55 - 28.07.2017, 23:42
Re: AttachObjectToObject messing up objects - by arad55 - 29.07.2017, 00:59
Re: AttachObjectToObject messing up objects - by Pottus - 29.07.2017, 02:10
Re: AttachObjectToObject messing up objects - by arad55 - 29.07.2017, 02:16
Re: AttachObjectToObject messing up objects - by Pottus - 29.07.2017, 02:22

Forum Jump:


Users browsing this thread: 1 Guest(s)