You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I have been trying to implement this library, I have it working if I re-create the chain/bones each frame. However, trying to preserve the structure, chain3d etc I get some weird results...
createIKStructure() {
const segment = this.segment;
this.ikLegTarget = new IK.V3(this.footPosition.x, this.footPosition.y, this.footPosition.z); // or IK.V2
this.ikLeg = new IK.Chain3D(); // or Chain2D
this.ikLeg.setFixedBaseMode(true);
const leg = this.ikLeg; // or Chain2D
// with start position, direction and length:
const baseBoneA = new IK.Bone3D( // or Bone2D
new IK.V3(segment.x, segment.y, segment.z), // start position. Use IK.V2 if you are using Chain2D.
undefined, // no end position given
new IK.V3(0, 1, 0), // direction. Use IK.V2 if you are using Chain2D.
1 // length
);
leg.addBone(baseBoneA);
leg.addConsecutiveBone(
new IK.V3(0, -1, 0), // direction. Use IK.V2 if you are using Chain2D.
1 // length
);
this.structure = new IK.Structure3D(); // or Structure2D
this.structure.add(leg, this.ikLegTarget);
}
update(delta) {
this.createIKStructure(); // only works if i do this, below lines seem to do nothing/produce buggy results
leg.baseLocation.set(segment.x, segment.y, segment.z);
this.ikLegTarget.set(this.footPosition.x, this.footPosition.y, this.footPosition.z); // or IK.V2
this.structure.update();
}
As you can see from this rough snippet, I tried using a few methods to reset the base location and others. Doesnt seem to do much besides produce buggy results. Re-creating everything produces the correct result from what I can see. Any ideas how to approach this?
The text was updated successfully, but these errors were encountered:
Hello!
I have been trying to implement this library, I have it working if I re-create the chain/bones each frame. However, trying to preserve the structure, chain3d etc I get some weird results...
As you can see from this rough snippet, I tried using a few methods to reset the base location and others. Doesnt seem to do much besides produce buggy results. Re-creating everything produces the correct result from what I can see. Any ideas how to approach this?
The text was updated successfully, but these errors were encountered: