cmm-21 / a5

0 stars 0 forks source link

L0 - Spring length #20

Closed Maenzgi closed 3 years ago

Maenzgi commented 3 years ago

Dear TAs

Quick question: In Ex. 2, I noticed in the code some lines that require us to change l0 of the springs: // TODO: Fix the following line springs.back()->l0 = 0; I am not really sure what you want us to do there. Is this just there if we want to change l0, or is there actually something that you want us to implement there. If so, what should that part do?

Thank you in advance!

nwicki commented 3 years ago

The double l0 represents the length of the spring in a resting state (you can easily compute the length by using the anchor points at initialisation). You will need it further on to compute the amount of deformation applied on the spring. From this, you will apply corresponding forces on attached rigid bodies.

eastskykang commented 3 years ago

Please check the following comment in the source code file.

// default rest length is the distance between attaching points when
// the spring is added.

l0 is the rest length of a spring.

Maenzgi commented 3 years ago

Ahh ok I think I get it. Thank you!