Page 1 of 1

Spawning hinges nightmare

PostPosted: Sat Sep 05, 2009 12:23 pm
by Torpedo
So i'm trying to spawn hinges and having a nightmare trying.

Tried just using scene.addHinge and giving a location, a zdepth and a size, but that didnt work. then i assume i need both geometry ID's

however whatever i do, i cant get GeomID from anything. scene.my.wheel1 = E.geom.GeomID, scene.my.wheel1 = E.other.GeomID, neither have worked... ive also tried using entityID but that doesnt pick up either.

any ideas what i should be doing here?

Re: Spawning hinges nightmare

PostPosted: Sat Sep 05, 2009 1:28 pm
by gradyfitz
You could set a local variable when you spawn the object, that sets controllerAcc to the geomID, this is a temporary work around, you can toy around with it till you get it right. :D.

Re: Spawning hinges nightmare

PostPosted: Sat Sep 05, 2009 4:57 pm
by standardtoaster
Actually, as far as I know, spawning hinges or fixates wherever you want is impossible. To test it out create a hinge, select it, press control-c. Now go to this websity and paste it in the top box and click remove line breaks. Now go back to phun/Algodoo press ~ or F11 and press control-v, now hit return. As you can see it will not spawn it in same place as the other. :crazy:

Re: Spawning hinges nightmare

PostPosted: Sat Sep 05, 2009 5:18 pm
by Versieon
It is true, you can't spawn hinges onto existing geometrys.
However, if the geometry is spawned with a user set variable like globalID, you then can create hinges connecting to it.

Re: Spawning hinges nightmare

PostPosted: Thu Sep 17, 2009 5:28 pm
by algadoodle123
Versieon wrote:It is true, you can't spawn hinges onto existing geometrys.
However, if the geometry is spawned with a user set variable like globalID, you then can create hinges connecting to it.


what is a geom ID? :crazy:

Re: Spawning hinges nightmare

PostPosted: Thu Sep 17, 2009 11:44 pm
by Versieon
It is a unique variable that diferentiates objects in phun/algodoo.
if you set this when you spawn something, you can connect fixates or hinges to it through on collide.

Re: Spawning hinges nightmare

PostPosted: Fri Sep 18, 2009 2:13 am
by algadoodle123
how would I use it :wtf:

Re: Spawning hinges nightmare

PostPosted: Fri Sep 18, 2009 11:49 pm
by Versieon
Here is an auto fixate i made a while back, it shows how to use and implement GeomID

Image
Author: Versieon
Title: Fixate for TeleportImageImage

Re: Spawning hinges nightmare

PostPosted: Fri Sep 18, 2009 11:56 pm
by algadoodle123
you forgot to add the link

Re: Spawning hinges nightmare

PostPosted: Fri Sep 18, 2009 11:56 pm
by Versieon
Oops :D

Re: Spawning hinges nightmare

PostPosted: Sat Sep 19, 2009 2:33 am
by algadoodle123
thank you :D

edit: if you copy and past a hinge into text editor, it has the IDs of the object it was on