Figured out how to do joints
So I have a working template for a joint, except that am having trouble making it react exactly as would with Gravity if was not a work around. I know they are coming out with joints soon. So why am I working on this? Cause it challenges me. Anyway, I have no problem now rotating an rectangular actor around one of it's corners like a joint, I am using a bone system, I created along with some of the math in the post about freeing yourself from the tyranny of center rotations. Anyway, it's been a lot of fun. I would, however, like to work with one of the actual math gurus to make this work with gravity or at least simulate it. I know, joints are coming. But I am in it to the learning and exploration experience. So if you are interested in collaborating cause you just like challenges, let me know. My goal is to release everything free to the community even if the specific application will soon be moot b/c I figure it could be adapted for things that won't directly work in GS.
Comments
I've created a few simple bones systems in GS as well. I'm currently working on verlet integration to simulate the fluid motion of ropes, chains, and cloth. Creating a bone system seems to be only half the battle. Its difficult getting the objects to react properly to the other objects in the scene. For example, I can make simple ragdolls that act/react -- except they just fall through the floor and walls. I guess that you are experiencing the same sort of thing?
Here is an example that consists of four joints and three sticks:
http://www.speedyshare.com/files/30349459/IKExperiment.zip
You can drag the different joints around and the attached parts follow. It has the rudiments of inverse kinematics.
The brown square was there as an object for the bones react to. But so far, no dice.
Is this similar to what you are interested in?
RThurman
Despite its current limitations, exploring what GameSalad is capable of doing is great fun! For me, GameSalad is the game!
On a technical note, in the current version of GameSalad all the calculations needed to do a crude version of joints can be done with change attribute behaviors and a timing system. (Roughly four per joint and three per bone.) Will using change attribute (instead of constrain attribute) cut down the potential for crashing? Or will that technique just trade one set of problems for another?
RThurman
So joints are easy! Its the physics that makes joints challenging.
RThurman
Yes, it is a challenge to get everything linked up correctly so that there is mutual influence up and down the chain of joints. In the example I posted above, I tried to address that by making each actor influenced by the one immediately above it -- and the one immediately below it. And I also gave each actor the ability to be moved by the mouse. The effect is that all actors mutually influence each other by their linkages up and down the chain.
In principle, this should work for actor collisions. So that in a chain of five joined actors, if actor 3 has a has a bounce behavior activated, then actors 2 and 4 behave so as to maintain their relationship with actor 3. And actor 1 moves to catch up to actor 2. And actor 5 moves to catch up with actor 4.
The above paragraph isn't as clear as I hoped it would be. But I hope it conveys some sense of how to approach this.
All this logic (of who influences who and by how munch) will still need to be addressed whether GameSalad gets joints or if developers decide to create their own 'system of mutual influence.'
Either way, its still fun to puzzle out the logic of it all. GameSalad is a great product for just trying to puzzle out the logic without all the hassle of code.
RThurman
I guess it just proves (for those who ask) that GameSalad does handle joints. But it will be even better if/when the update includes an official version of joints.
RThurman
http://www.speedyshare.com/files/30363183/PivotingPortraitIPhone_V4.zip
I made this back in July. And I've learned a bit since then. (But forgotten more.)
Is this the kind of gravity work you are interested in?
RThurman