Skip to content

Commit

Permalink
Merge remote-tracking branch 'remotes/v-sekai-godot/vsk-many-bone-ik-…
Browse files Browse the repository at this point in the history
…4.2' into groups-staging-4.2
  • Loading branch information
fire committed Sep 20, 2023
2 parents 154a20e + 51410eb commit 9a26344
Show file tree
Hide file tree
Showing 27 changed files with 5,658 additions and 0 deletions.
12 changes: 12 additions & 0 deletions modules/many_bone_ik/.gitrepo
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
; DO NOT EDIT (unless you know what you are doing)
;
; This subdirectory is a git "subrepo", and this file is maintained by the
; git-subrepo command. See https://github.com/ingydotnet/git-subrepo#readme
;
[subrepo]
remote = https://github.com/V-Sekai/many_bone_ik
branch = master
commit = 820b56d5dcc1eac585cbf0b04fd4778a6f93bcf7
parent = f4c7bf6c9c54f1c5370fa4bc331671a7f542ad60
method = merge
cmdver = 0.4.6
9 changes: 9 additions & 0 deletions modules/many_bone_ik/AUTHORS.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
# Godot Engine Many Bone IK authors

GitHub usernames are indicated in parentheses.

## Initial Project

This project is originally a port from a Java project by Eron

Eron Gjoni (EGjoni) https://github.com/EGjoni/Everything-Will-Be-IK
13 changes: 13 additions & 0 deletions modules/many_bone_ik/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
# Many Bone IK

A custom inverse kinematics system solver for multi-chain skeletons and with constraints.

Lyuma mentioned that there are multiple plausible solutions, especially for dance, where people move internal joints in unusual ways. However, for everything other than dance, there is typically just one right answer - the energy minimizing one.

Lyuma also agreed that energy minimization is a good concept, as it results in the optimal solution and aligns with what your mind would choose without specific intent.

Eron explained that with the latest ewb-ik version, energy minimization is handled by defining 0 cost regions in kusudama constraints along with hard boundary (high cost regions).

Joints always negotiate between moving toward their own 0 cost region and toward the goal, with the former being less important than the latter. The "goal" here refers to whatever orientation allows descendant joints to reach their target.

Migrated to https://github.com/godotengine/godot/pull/70887.
14 changes: 14 additions & 0 deletions modules/many_bone_ik/SCsub
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
#!/usr/bin/env python

Import("env")
env_many_bone_ik = env.Clone()
env_many_bone_ik.Prepend(CPPPATH=["#modules/many_bone_ik"])
env_many_bone_ik.Prepend(CPPPATH=["#modules/many_bone_ik/src/math"])
env_many_bone_ik.Prepend(CPPPATH=["#modules/many_bone_ik/src"])
env_many_bone_ik.add_source_files(env.modules_sources, "constraints/*.cpp")
env_many_bone_ik.add_source_files(env.modules_sources, "src/math/*.cpp")
env_many_bone_ik.add_source_files(env.modules_sources, "src/*.cpp")
env_many_bone_ik.add_source_files(env.modules_sources, "*.cpp")

if env.editor_build:
env_many_bone_ik.add_source_files(env.modules_sources, "editor/*.cpp")
39 changes: 39 additions & 0 deletions modules/many_bone_ik/register_types.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
/**************************************************************************/
/* register_types.h */
/**************************************************************************/
/* This file is part of: */
/* GODOT ENGINE */
/* https://godotengine.org */
/**************************************************************************/
/* Copyright (c) 2014-present Godot Engine contributors (see AUTHORS.md). */
/* Copyright (c) 2007-2014 Juan Linietsky, Ariel Manzur. */
/* */
/* Permission is hereby granted, free of charge, to any person obtaining */
/* a copy of this software and associated documentation files (the */
/* "Software"), to deal in the Software without restriction, including */
/* without limitation the rights to use, copy, modify, merge, publish, */
/* distribute, sublicense, and/or sell copies of the Software, and to */
/* permit persons to whom the Software is furnished to do so, subject to */
/* the following conditions: */
/* */
/* The above copyright notice and this permission notice shall be */
/* included in all copies or substantial portions of the Software. */
/* */
/* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, */
/* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF */
/* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. */
/* IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY */
/* CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, */
/* TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE */
/* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */
/**************************************************************************/

#ifndef MANY_BONE_IK_REGISTER_TYPES_H
#define MANY_BONE_IK_REGISTER_TYPES_H

#include "modules/register_module_types.h"

void initialize_many_bone_ik_module(ModuleInitializationLevel p_level);
void uninitialize_many_bone_ik_module(ModuleInitializationLevel p_level);

#endif // MANY_BONE_IK_REGISTER_TYPES_H
Loading

0 comments on commit 9a26344

Please sign in to comment.