Page 1 of 1

Scene.addFixjoint Can't find geomID

PostPosted: Sun Apr 07, 2019 1:05 am
by doodlechaos
Hello! I am working on a new video for my YouTube channel and I got stuck by an issue in thyme. My project spawns so many circles that it eventually bogs down the performance of the scene. After the circles roll and collide with a specific object I would like to glue them to the background so that they aren't updating values forever after reaching their final position.

The most promising method would be to add a fixed joint to something that is already glued to the background using Scene.addFixjoint as shown below. This is what I've been trying in my "onCollide" scripting section.

"(e)=>{
Scene.addFixjoint({
geom0 := e.this.geomID;
geom1 := e.other.geomID;
geom0pos := e.this.pos;
geom1pos := e.other.pos;
size := 0.1
})
}"

Unfortunately it seems unable to find the geomID. At first I thought this was due to the position updating and it not finding a match, but after testing on unchanging positions it still can't find the correct ID.
84381016 ms: - ERROR - Couldn't find geom with ID #1628594
84381016 ms: - ERROR - Constraint connected to unknown geometry

This tetris project is potentially useful: https://github.com/tatt61880/algodoo_te ... tetris.phn
That is where I am taking the syntax for Scene.addFixjoint.

Any help would be much appreciated! Hopefully somebody in this community has a solution.

Best,
DoodleChaos

Re: Scene.addFixjoint Can't find geomID

PostPosted: Mon Apr 08, 2019 2:31 pm
by FRA32
As far as I am aware, hinges and fixJoints can only be attached to objects AS THEY SPAWN, meaning attaching them to already existing geometry is basically impossible unless you delete the original and spawn a copy. Why would you want fixjoints to something glued anyways? Doing so would have absolutely no consequence except for adding another object to be rendered.

Re: Scene.addFixjoint Can't find geomID

PostPosted: Tue Apr 09, 2019 3:18 am
by Ken3344
Hey Doodlechaos, I am not sure if this is possible. Although I am not as advanced at Thyme like FRA32 is, I can say that gluing something to the scene *may* be possible with thyme, but I am not sure if it will work in your case. I was able to get an object to be glued and unglued later in thyme, but I am not sure if flipping the order of it would work. Can I see what you're trying to do? I might find a simpler solution for it. ;)