AttachObjectToObject messing up objects
#5

Quote:
Originally Posted by arad55
Посмотреть сообщение
Also, when attaching the object, the parameters are not (x, y, z, rx, ry, rz), they are actually (y, z, x, y, z, x)
That is because you are attaching objects to a rotated object! So that is not really how it is at all. The easiest solution is to use a dummy object to attach all objects to. My favourite one is the golf ball.

http://dev.prineside.com/en/gtasa_sa...4-kb_golfball/

What to do.

1.) Choose a central location (the center of all objects).
https://github.com/Pottus/Texture-St...dio/groups.pwn
line 446 - tsfunc GetGroupCenter(playerid, &Float:X, &Float:Y, &Float:Z)

Код:
	X = (highX + lowX) / 2;
	Y = (highY + lowY) / 2;
	Z = (highZ + lowZ) / 2;
Just add the highest x,y,z to the lowest x,y,z of the given set of objects and divide by 2 gives you the group center.

2.) Create golf at this position
3.) Calculate offsets
4.) Attach objects to golf ball

Make sure the ball has a rotation of 0,0,0 then the rotation of the objects you are attaching need no extra calculations let the client do the dirty work at this point.
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)