Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Ballhead constraints for FABRIK #62003

Open
wants to merge 6 commits into
base: master
Choose a base branch
from

Conversation

KaruroChori
Copy link

A copy of #61994 to better follow the guidelines about rebasing.

Not to be merged yet, as I have not been able to really test its functionality.

godotengine/godot-proposals#750 (comment)
The author referenced a solution of ballhead constraint on the inverse kinematic model for FABRIK. I just ported its code and integrated it in the GUI of Godot.

Any external evaluation is very welcome.

@KaruroChori KaruroChori requested a review from a team as a code owner June 13, 2022 17:45
@@ -75,6 +78,10 @@ class SkeletonModification3DFABRIK : public SkeletonModification3D {
void chain_forwards();
void chain_apply();

Vector3 chain_ball_constraint(int i);
Vector3 getAngleLimitedUnitVectorDegs(const Vector3 &vecToLimit, const Vector3 &vecBaseline, real_t angleLimitDegs);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

godot is get_angle_limited_unit_vector and also uses radians by convention.

Vector3 SkeletonModification3DFABRIK::getAngleLimitedUnitVectorDegs(const Vector3 &vecToLimit, const Vector3 &vecBaseline, real_t angleLimitDegs) {
// Get the angle between the two vectors
// Note: This will ALWAYS be a positive value between 0 and 180 degrees.
float angleBetweenVectorsDegs = getAngleBetweenDegs(vecBaseline, vecToLimit);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

getAngleBetweenDegs -> get_angle_between_degs

Please correct the naming conventions.

@KaruroChori
Copy link
Author

https://github.com/godotengine/godot/runs/6867213499 is failing a task, but I am not able to reproduce the reason why this is the case.

I modified the source as requested by the revisions.

@fire fire requested a review from a team June 14, 2022 21:04
@ywmaa
Copy link
Contributor

ywmaa commented Jun 21, 2022

@KaruroChori

as I have not been able to really test its functionality.

did you test it ?
or is it crashing in Godot ?

@KaruroChori
Copy link
Author

KaruroChori commented Jun 21, 2022

The last version on my branch does not work, there were some problems with indices which I later solved but never pushed.

Still, I was not satisfied by that implementation, and I continued working on a more general way to integrate different types of constraint and the related UI. The main issue is that some of those I would like to integrate are not as easy on FABRIK and could cause numerical instabilities.
I am not an expert in this field and I do not really have much time to study more of it as of now; and I am in the middle of a job hunt, so it might take a while before I can go back working on this, sorry about that :).

@ywmaa
Copy link
Contributor

ywmaa commented Jun 22, 2022

The last version on my branch does not work, there were some problems with indices which I later solved but never pushed.

Still, I was not satisfied by that implementation, and I continued working on a more general way to integrate different types of constraint and the related UI. The main issue is that some of those I would like to integrate are not as easy on FABRIK and could cause numerical instabilities. I am not an expert in this field and I do not really have much time to study more of it as of now; and I am in the middle of a job hunt, so it might take a while before I can go back working on this, sorry about that :).

no problem at all, I was just checking because I don't think that my code is that good, I am too learning about the IK stuff, thanks for putting time and work into these stuff.

@GeorgeS2019
Copy link

@ywmaa

Can you share your thinking of the current Godot4 IK? Is there progress?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants