From 412e3c5dc27ac396c1c17c2427e9d3deff009ff8 Mon Sep 17 00:00:00 2001 From: ousttrue Date: Mon, 17 Jun 2024 16:26:40 +0900 Subject: [PATCH] VRMC_springBone_extended_collider fallback export --- Assets/VRM10/Runtime/IO/Vrm10Exporter.cs | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/Assets/VRM10/Runtime/IO/Vrm10Exporter.cs b/Assets/VRM10/Runtime/IO/Vrm10Exporter.cs index 5f31d9e0ac..499b845da4 100644 --- a/Assets/VRM10/Runtime/IO/Vrm10Exporter.cs +++ b/Assets/VRM10/Runtime/IO/Vrm10Exporter.cs @@ -321,6 +321,17 @@ 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 しているので @@ -328,7 +339,7 @@ static UniGLTF.Extensions.VRMC_springBone.ColliderShape ExportShape(VRM10SpringB shape.Sphere = new UniGLTF.Extensions.VRMC_springBone.ColliderShapeSphere { Radius = 0, - Offset = new float[] { 0, 0, 0 }, + Offset = new float[] { 0, -10000, 0 }, }; break; }