FBS DevLab
User Functions
Username:

Password:

Don't have an account yet? Sign up as a New User

Events
There are no upcoming events

Older Stories
Wednesday 03-Dec
  • Blob Redux (26)

  • Tuesday 04-Nov
  • Virtools P5 Glove Building Block (28)

  • Thursday 16-Oct
  • Ragdoll Bull Riding (29)

  • Saturday 11-Oct
  • Fun With Limits (30)
  • Object Precaching Techniques (32)
  • Spring Toolkit (23)

  • Sunday 28-Sep
  • 50th Post, Been Busy (Yet Again) (24)

  • Saturday 20-Sep
  • Game of Life, First Optimizations (19)
  • IGDA Slides - Music Games (23)

  • Sunday 14-Sep
  • Conway's Game of Life (24)


  • Spring Toolkit
    Saturday, October 11 2003 @ 06:19 AM EDT, Matthew
    One of the most annoying aspects of the Virtools physics pack is the inability to properly store references to springs, motors, and constraints. Practically speaking, this means that truly dynamic uses that utilize these features--say, prompting the user for how many springs to make in a pattern--are difficult.

    Recently, though, I realized one solution is to simply copy a static script in order to directly reference the retrieved spring/motor/constraint. I tried it out by creating some tools for springs, and it works fairly well. I made a Spring Create and Spring Destroy wrapper, which works by copying a template frame and script. I included functionality for break points at defined low and high stretch points.

    Try it out with the web version. Notice you can break a spring if you pummel the side it's supporting (they break at 120% stretch). Grab the source .CMO to check out the BGs, if you're interested in their usage. To use them in your own project, just export the two spring frames and import. Optionally, you can have the spring logic record its current length and stretch percent for use in your own logic.

    When I have some time, I'll do similiar wrappers for constraints and motors. I have a few interesting tests in mind that will use dynamic springs/constraints, which I hope to have time for soon.

        


    What's Related
  • Try it out
  • source .CMO

  • Story Options
  • Printable Story Format