IK Solving Plugin

Forum for plugin, effect and behavior programmers. Please use the Help & Support forum for help using Construct.

Post » Wed Mar 11, 2009 4:27 am

I'm pretty sure somebody asked for this before(Quazi, I think), and so here it is. I was needing something to test out my crappy C++ skills on and this seemed easy enough. :P

Anyways, what this does is does all of the fancy math for you when solving a triangle to use for IK applications. It consists of only one action, which is "Solve IK". In the action, you specify two sprites to act as bones and one to act as a control point. The bones will automatically be rotated and positioned accordingly(the second bone will even position its self to the end of the first bone automatically). Just make sure that the hotspots on your bones are on the far left of the sprite or things might work funky. Also, it's approximately 30% faster than doing it manually. :)

And, without further ado, here it is:

IK Solver Plugin

So, be sure to leave feedback. If you want some more control over a specific aspect or want something added, don't forget to let me know. :)
Moderator
B
98
S
37
G
19
Posts: 1,584
Reputation: 17,817

Post » Wed Mar 11, 2009 7:57 am

Awesome! What is the "Test Value" property, though?
B
62
S
21
G
12
Posts: 1,910
Reputation: 13,155

Post » Wed Mar 11, 2009 8:03 am

That's really cool :)

Any way you could make it so it can solve counter-clockwise as well? Or whatever the terminology is. You know... the other, uh, direction or whatever. I tried making a crab walk, but the knees all bend the same way.
Moderator
B
5
S
2
G
6
Posts: 4,348
Reputation: 10,971

Post » Wed Mar 11, 2009 11:05 am

Nice!
One thing I notice, if the control sprite overlaps the other two, they disappear.
Image Image
B
161
S
48
G
90
Posts: 7,356
Reputation: 66,767

Post » Wed Mar 11, 2009 3:24 pm

Thanks, guys. :)

@Mipey - The test value is something I forgot to take out. :P

@deadeye - I whipped up a new version real quick. It adds a new action to rotate the bones the opposite way: IK Solving Plugin 1.1

@newt - I haven't noticed anything like that. Could you put up a CAP? Unless, of course, you're just using the example one I put together.
Moderator
B
98
S
37
G
19
Posts: 1,584
Reputation: 17,817

Post » Wed Mar 11, 2009 7:44 pm

I cant seem to reproduce it now, I will say I had the control set to move to mouse x,y.

Edit: Also a suggestion, it would be nice if the actions showed on the editor what sprites were connected.
Image Image
B
161
S
48
G
90
Posts: 7,356
Reputation: 66,767

Post » Sat Mar 14, 2009 5:17 am

[quote="newt":3m7s0541]Also a suggestion, it would be nice if the actions showed on the editor what sprites were connected.[/quote:3m7s0541]

I'm not exactly sure how that's done. It's a miracle I was able to piece together a plugin in the first place. :P
Moderator
B
98
S
37
G
19
Posts: 1,584
Reputation: 17,817

Post » Sat Mar 14, 2009 6:24 am

Please reupload 1.1 on another server:

[quote:a3st23f0]Guys, [u:a3st23f0]our host deleted all of our user-uploaded files[/u:a3st23f0]. (People logged in while uploading). I have emailed them about this and I hope to get these files back up ASAP.

Even making a new account to upload wont work right now, my host has me entirely locked out of the folder. Ive emailed them but they havent replied back yet.

Posted by ChIkEn on March 13, 2009, 1:10 pm[/quote:a3st23f0]
B
4
G
4
Posts: 24
Reputation: 1,248

Post » Sat Mar 14, 2009 2:28 pm

Bleh, I forgot about that:

IK Solver 1.1
Moderator
B
98
S
37
G
19
Posts: 1,584
Reputation: 17,817

Post » Sat Mar 14, 2009 8:34 pm

Version 1.2 coming through! I found out how to show which objects are connected in the editor(thanks to the RTS source), so that's in there now.

Also, instead of the second bone merely being placed at the very end of the first one, there's now a reletive distance value that you can specify. 0 is default and will keep the bone at the very end, negative values will have it closer to the pivot point, and positive values will place it farther out. Very helpful for making more seamless joints. :)

IK Solver 1.2

NOTE: If you have any CAPs using this, the IK stuff won't work anymore. You'll have to edit any actions using the plugin to make them work again. The reason for this is that the control point is now the FOURTH parameter since the distance parameter is now behind it.
Moderator
B
98
S
37
G
19
Posts: 1,584
Reputation: 17,817

Next

Return to Construct engineering

Who is online

Users browsing this forum: No registered users and 0 guests