Changes to Curtain

Posted on July 19, 2011 | Category :Dev Log, Processing App, Source Code | No Comments

Click here to see How to Make a Fabric Simulator

Click here to see How to Make a Fabric Simulator Part 2

Yesterday and today I made some long needed changes to Curtain‘s code. Most of it is behind the scenes stuff. The most noticeable change will be how it interacts with the mouse. It should now be a lot smoother and when the user is tearing (right clicking), it wont just tear at points it sees the cursor at, but it’ll tear ALL points between the cursor’s current and previous positions. Meaning it’s now a lot easier to slice the curtain in half with just one swipe.

You might also notice changes in the speed since the majority of the changes are optimization. You’ll only notice it if Curtain was laggy or slow for you before this update. To try out the newly optimized Curtain, check it out here. You can also check out its source here or here. To see a list of updates, jump to the end of the post.

In addition to cleaning up some of Curtain, I’ve made a completely new version of the fabric simulator with my main emphasis on performance. Check it out here.

Changes made to Curtain:

  • Removed unnecessary “fixedDeltaTimeSeconds = fixedDeltaTime/1000″ in code.
  • leftOverDeltaTime now properly accumulates
  • Made changes to Particle.updateInteraction (it’s moved to along side the physics update)
  • Simplified some function parameters (namely Link’s constructors and function inside Particle)
  • Moved Link drawing into Link, instead of Particle
  • Removed translate(width/2,height/2) in draw
  • Removed a for loop for drawing, and put the drawing into the physics loop with the condition of it only running on the last loop
  • Moved the pinned constraint in Particle’s update() to solveConstraints()
  • Interaction now takes into account every point between pmouse and mouse

» Tags: , , , , ,

Comments 0

Leave a Reply

Your email address will not be published. Required fields are marked *


You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>