From 716283dcc0bc6df3743c64f2e7bcadfee98e141c Mon Sep 17 00:00:00 2001 From: ousttrue Date: Wed, 20 Nov 2024 15:34:17 +0900 Subject: [PATCH] external --- .../RotateParticle/Runtime/Jobs/RotateParticleJobSystem.cs | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/Assets/VRM10_Samples/ClothSample/RotateParticle/Runtime/Jobs/RotateParticleJobSystem.cs b/Assets/VRM10_Samples/ClothSample/RotateParticle/Runtime/Jobs/RotateParticleJobSystem.cs index a312ee5c4..afa878002 100644 --- a/Assets/VRM10_Samples/ClothSample/RotateParticle/Runtime/Jobs/RotateParticleJobSystem.cs +++ b/Assets/VRM10_Samples/ClothSample/RotateParticle/Runtime/Jobs/RotateParticleJobSystem.cs @@ -156,11 +156,13 @@ namespace RotateParticle.Jobs var parent = Info[parentIndex]; var parentParentRotation = CurrentTransforms[parent.ParentIndex].Rotation; + var external = (particle.Settings.gravityDir * particle.Settings.gravityPower + Frame.Force) * Frame.DeltaTime; + var newPosition = CurrentPositions[index] + (CurrentPositions[index] - PrevPositions[index]) * (1.0f - particle.Settings.dragForce) + parentParentRotation * parent.InitLocalRotation * particle.InitLocalPosition * particle.Settings.stiffnessForce * Frame.DeltaTime // 親の回転による子ボーンの移動目標 - + Frame.Force * Frame.SqDeltaTime + + external ; // 位置を長さで拘束