How clean is teleportation via updating pos?

About advanced scenes, and the Thyme scripting language used in Algodoo.

How clean is teleportation via updating pos?

Postby Kitesurfer » Wed Feb 10, 2021 11:22 am

Hi,

I have a scene where a vehicle driven by various forces navigates in 2-d. I want to add a view where I simulate the vehicle's stability around an axis you don't see in the 2-d plane. I want to let that view follow the vehicle as it and the panning camera focus move over the 2-d grid.

Now, the solution is to just update the pos of the items in the stability view; that is to continuosly teleport it to somewhere near the vehicle .

Aaaand... my question is: does updating of the pos variable affect forces or have any other side-effects in the simulation? Are all variables of an object teleported without change when I update pos?
Kitesurfer
 
Posts: 10
Joined: Thu Jan 07, 2021 5:27 pm

Re: How clean is teleportation via updating pos?

Postby FRA32 » Sun Feb 28, 2021 3:13 pm

Changing the position of an object literally does just that. The object just moves. The simulation carries on as usual, the object will now simply be in a different location. This can of course have unexpected results if your object is glued, fixed or hinged to any other objects as these types of joints dont automatically move with the object, thus "stretching" the joint, which can have wierd consequences.
FRA32
 
Posts: 227
Joined: Wed Dec 03, 2014 9:51 pm

Re: How clean is teleportation via updating pos?

Postby Kitesurfer » Tue Mar 02, 2021 11:15 am

Thanks a lot for the reply! That is really clean!
Kitesurfer
 
Posts: 10
Joined: Thu Jan 07, 2021 5:27 pm


Return to Thyme scripting

Who is online

Users browsing this forum: No registered users and 3 guests

cron