mirror of
https://github.com/vrm-c/UniVRM.git
synced 2026-09-09 12:29:23 -05:00
FastSpringBoneCombinedBuffer.DrawGizmos
This commit is contained in:
@@ -15,5 +15,12 @@ namespace UniGLTF.SpringBoneJobs.Blittables
|
||||
// capsule tail or plane normal
|
||||
public Vector3 tailOrNormal;
|
||||
public int transformIndex;
|
||||
|
||||
public void DrawGizmo(BlittableTransform t)
|
||||
{
|
||||
Gizmos.matrix = t.localToWorldMatrix;
|
||||
Gizmos.color = Color.blue;
|
||||
Gizmos.DrawWireSphere(offset, radius);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -17,5 +17,12 @@ namespace UniGLTF.SpringBoneJobs.Blittables
|
||||
public float length;
|
||||
public Quaternion localRotation;
|
||||
public Vector3 boneAxis;
|
||||
|
||||
public void DrawGizmo(BlittableTransform t, BlittableJointMutable m)
|
||||
{
|
||||
Gizmos.matrix = t.localToWorldMatrix;
|
||||
Gizmos.color = Color.green;
|
||||
Gizmos.DrawWireSphere(Vector3.zero, m.radius);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -7,5 +7,7 @@ namespace UniGLTF.SpringBoneJobs.Blittables
|
||||
{
|
||||
public int startIndex;
|
||||
public int count;
|
||||
|
||||
public int EndIndex => startIndex + count;
|
||||
}
|
||||
}
|
||||
@@ -95,5 +95,13 @@ namespace UniGLTF.SpringBoneJobs
|
||||
_combinedBuffer = null;
|
||||
}
|
||||
}
|
||||
|
||||
public void DrawGizmos()
|
||||
{
|
||||
if (_combinedBuffer is FastSpringBoneCombinedBuffer combined)
|
||||
{
|
||||
combined.DrawGizmos();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -398,5 +398,27 @@ namespace UniGLTF.SpringBoneJobs
|
||||
logicsIndex += length;
|
||||
}
|
||||
}
|
||||
|
||||
public void DrawGizmos()
|
||||
{
|
||||
foreach (var collider in _colliders)
|
||||
{
|
||||
collider.DrawGizmo(_transforms[collider.transformIndex]);
|
||||
}
|
||||
|
||||
foreach (var spring in _springs)
|
||||
{
|
||||
for (int i = spring.logicSpan.startIndex; i < spring.logicSpan.EndIndex; ++i)
|
||||
{
|
||||
var joint = _logics[i];
|
||||
joint.DrawGizmo(_transforms[joint.tailTransformIndex], _joints[i]);
|
||||
|
||||
Gizmos.matrix = Matrix4x4.identity;
|
||||
Gizmos.DrawLine(
|
||||
_transforms[joint.tailTransformIndex].position,
|
||||
_transforms[joint.headTransformIndex].position);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -124,7 +124,7 @@ namespace UniVRM10
|
||||
|
||||
public void DrawGizmos()
|
||||
{
|
||||
|
||||
m_bufferCombiner.DrawGizmos();
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -102,5 +102,13 @@ namespace UniVRM10.FastSpringBones
|
||||
}
|
||||
_fastSpringBoneScheduler.Schedule(deltaTime).Complete();
|
||||
}
|
||||
|
||||
public void OnDrawGizmosSelected()
|
||||
{
|
||||
if (enabled)
|
||||
{
|
||||
BufferCombiner.DrawGizmos();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user