| User Functions |
|
|
Don't have an account yet? Sign up as a New User
|
|
| Events |
|
|
There are no upcoming events |
|
|
 |
| 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.
|
|
|
|
|