Skip to content

Commit

Permalink
fix(SecondaryAnimation): Not throw Error when no colliderGroups/boneG…
Browse files Browse the repository at this point in the history
…roups

fix #31
  • Loading branch information
il-m-yamagishi committed Aug 1, 2019
1 parent 30caf86 commit c0f74da
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions src/secondary-animation/spring-bone-controller.ts
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,9 @@ export class SpringBoneController {
}

private constructColliderGroups(getBone: getBone) {
if (!this.ext.colliderGroups || !this.ext.colliderGroups.length) {
return [];
}
const colliderGroups: ColliderGroup[] = [];
this.ext.colliderGroups.forEach((colliderGroup) => {
const bone = getBone(colliderGroup.node) as TransformNode;
Expand All @@ -77,6 +80,9 @@ export class SpringBoneController {
}

private constructSprings(getBone: getBone, colliderGroups: ColliderGroup[]) {
if (!this.ext.boneGroups || !this.ext.boneGroups.length) {
return [];
}
const springs: VRMSpringBone[] = [];
this.ext.boneGroups.forEach((spring) => {
const rootBones = (spring.bones || []).map((bone) => {
Expand Down

0 comments on commit c0f74da

Please sign in to comment.