#bevy #animation #gamedev

bevy_fabrik

IK solver for Bevy using FABRIK algorithm

2 releases

0.1.1 Nov 1, 2024
0.1.0 Oct 23, 2024

#1612 in Game dev

Download history 172/week @ 2024-10-21 130/week @ 2024-10-28 38/week @ 2024-11-04 3/week @ 2024-11-18 48/week @ 2024-12-02 58/week @ 2024-12-09

109 downloads per month

MIT/Apache

3MB
300 lines

bevy_fabrik

An implementation of FABRIK inverse kinematics algorithm for Bevy game engine.

example

Disclaimer: multi-chain support is not implemented yet.

How to use

Add InverseKinematicsPlugin to your App:

app.add_plugins(InverseKinematicsPlugin);

Add IkChain component to the last entity (tail) of a chain of entities you want to control:

commands.entity(chain_tail).insert(IkChain::new(joint_count));

Note that IkChain will calculate bone lengths based on the distance between entities in the chain when inserted, so make sure the entities and their transforms are set up correctly before inserting it.

Finally, update IkChain's target field as needed to solve the chain towards it. For a more complete example, see examples/basic.rs.

To add joint constraints, insert TwistConstraint and/or SwingConstraint components to the entities within the chain, and they will be applied during chain solving.

Compatibility

Bevy bevy_fabrik
0.14 0.1

Alternatives

License

Dual-licensed under either:

at your option.

Dependencies

~25MB
~463K SLoC