Skip to content

Commit

Permalink
Merge pull request #2323 from ousttrue/fix/VRMC_springBone_extended_c…
Browse files Browse the repository at this point in the history
…ollider_fallback

VRMC_springBone_extended_collider fallback export
  • Loading branch information
ousttrue authored Jun 17, 2024
2 parents 8b09ff9 + 412e3c5 commit 3104b4c
Showing 1 changed file with 12 additions and 1 deletion.
13 changes: 12 additions & 1 deletion Assets/VRM10/Runtime/IO/Vrm10Exporter.cs
Original file line number Diff line number Diff line change
Expand Up @@ -321,14 +321,25 @@ static UniGLTF.Extensions.VRMC_springBone.ColliderShape ExportShape(VRM10SpringB
break;
}

case VRM10SpringBoneColliderTypes.Plane:
{
const float DISTANCE = 1000.0f;
shape.Sphere = new UniGLTF.Extensions.VRMC_springBone.ColliderShapeSphere
{
Radius = 1000.0f,
Offset = ReverseX(z.Offset - z.TailOrNormal.normalized * DISTANCE),
};
break;
}

default:
{
// 既存実装で未知の collider が来た時に throw しているので
// 回避するために適当な Shpere を作る。
shape.Sphere = new UniGLTF.Extensions.VRMC_springBone.ColliderShapeSphere
{
Radius = 0,
Offset = new float[] { 0, 0, 0 },
Offset = new float[] { 0, -10000, 0 },
};
break;
}
Expand Down

0 comments on commit 3104b4c

Please sign in to comment.