Jump to content

Is there a way to constrain particles to a surface while they are movi


magneto

Recommended Posts

Lastly when should I be using Timeinc in my code? I didn't realized I had to here.

it all comes to understanding of the data you need to manipulate and how the solver is using it

so for example v stores distance per second

but the introduced P displacement by snapping it to the surface was done in each timestep and v from that would be distance per timestep

so to convert it to distance per second you need to divide it by timestep which is represented by @Timeinc and contains currently simulated fraction of the time

the whole timestep handling is necessary because it's variable and depends on your FPS and number of substeps, but you expect similar results per second so this conversion is crucial

 

So if I had to update force, I would use Timeinc there too?

in this case yes, it would be the same, the force from the displacement would be just per timestep you need to convert it to per second as solver will multiply force by @Timeinc (and divide by @mass if desired) before adding to v to properly add acceleration each timestep

but in case you are setting force that is already in seconds then no

 

If that's the case, should you also be using it in VEXpressions to change parameter values?

usually no, parameters represent values per second so you want to work with them like that

or even if the values are not per second, they are usually being adjusted internally to account for timestep

you should treat VEXpressions on parameters as literally just setting values of that parameter per particle

  • Like 1
Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...