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

Hotfix/ik constraint #299

Open
wants to merge 4 commits into
base: stable
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions flare_flutter/android/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
local.properties
2 changes: 0 additions & 2 deletions flare_flutter/android/local.properties

This file was deleted.

2 changes: 2 additions & 0 deletions flare_flutter/ios/Runner/GeneratedPluginRegistrant.h
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@
// Generated file. Do not edit.
//

// clang-format off

#ifndef GeneratedPluginRegistrant_h
#define GeneratedPluginRegistrant_h

Expand Down
2 changes: 2 additions & 0 deletions flare_flutter/ios/Runner/GeneratedPluginRegistrant.m
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@
// Generated file. Do not edit.
//

// clang-format off

#import "GeneratedPluginRegistrant.h"

@implementation GeneratedPluginRegistrant
Expand Down
9 changes: 6 additions & 3 deletions flare_flutter/lib/base/actor_ik_constraint.dart
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,8 @@ class ActorIKConstraint extends ActorTargetedConstraint {
for (int i = 0; i < _boneData.length - 1; i++) {
BoneChain item = _boneData[i];
item.included = true;
_fkChain[item.index + 1].included = true;
_fkChain.firstWhereOrNull((element) => element.index == item.index + 1)
?.included = true;
}
}

Expand Down Expand Up @@ -203,7 +204,7 @@ class ActorIKConstraint extends ActorTargetedConstraint {
_invertDirection = node._invertDirection;
if (node._influencedBones != null) {
_influencedBones = <InfluencedBone>[];
for (int i = 0; i < _influencedBones!.length; i++) {
for (int i = 0; i < node._influencedBones!.length; i++) {
_influencedBones!
.add(InfluencedBone(node._influencedBones![i].boneIdx));
}
Expand Down Expand Up @@ -252,7 +253,9 @@ class ActorIKConstraint extends ActorTargetedConstraint {
void solve2(BoneChain fk1, BoneChain fk2, Vec2D worldTargetTranslation) {
ActorBone b1 = fk1.bone;
ActorBone b2 = fk2.bone;
BoneChain firstChild = _fkChain[fk1.index + 1];
BoneChain firstChild = (_fkChain.firstWhereOrNull(
(chain) => chain.index == fk1.index + 1
))!;

Mat2D iworld = fk1.parentWorldInverse;

Expand Down