0 votes

I have created my own Two Bone IK Solver system for 3d skeletons that works well with no noticeable bugs. However there is no system in place to orientate the bone chain so that the "elbow" or "knee" looks at a point in 3d space. I have only done some testing here and there to get a system to no avail and was wondering if anyone had done this or know of any idea on how to get one working. This project is done in C# but I can translate C++ or GDScript to C# just fine so any code snippets are accepted if you are willing to provide.

Godot version 3.2.3.stabel.mono
in Engine by (19 points)
edited by

2 Answers

0 votes
Best answer

I have completed it myself and will post a link to a github in a few days on how I did it.
I stole a method from unity SignedAngle and used a Plane to determine the rotation around my arm normal given the projected points of my elbow and my magnet.

https://github.com/GainAw/GodotCSharpProjectTests link to demo project(s)

by (19 points)
edited by
0 votes

I can't find the documentation but there's a property named magnet under the SkeletonIK if I recall correctly. I think this is what you want.

This video demonstrates it https://youtu.be/Q4o_7_Rh510

by (631 points)

Sorry for the miss communication unfortunately. This is my own ik solver and not the built in one, so I am asking as to how the magnet works in say the SkeletonIK node, but you reminded me I can look at source.
edit* It seems as if the solver solves the chain with the magnet in mind using interpolation so I'm still not sure how to do this with Law of Cosigns

Oh right, I misread! I'm sorry it goes beyond my scope.
If you want to take a look, Blender also has open sources https://github.com/blender/blender/blob/master/source/blender/ikplugin/intern/iksolver_plugin.c

Welcome to Godot Engine Q&A, where you can ask questions and receive answers from other members of the community.

Please make sure to read Frequently asked questions and How to use this Q&A? before posting your first questions.
Social login is currently unavailable. If you've previously logged in with a Facebook or GitHub account, use the I forgot my password link in the login box to set a password for your account. If you still can't access your account, send an email to [email protected] with your username.