Assignment for RMIT Mixed Reality in 2020
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 

31 lines
724 B

using UnityEngine;
using System.Collections;
using System;
public class PoseEditHelper : MonoBehaviour {
public Transform poseRoot;
void OnDrawGizmos()
{
if (poseRoot != null)
{
DrawJoints(poseRoot);
}
}
private void DrawJoints(Transform joint)
{
Gizmos.DrawWireSphere(joint.position, 0.005f);
for (int i = 0; i < joint.childCount; ++i)
{
Transform child = joint.GetChild(i);
if (child.name.EndsWith("_grip") || child.name.EndsWith("hand_ignore"))
{
continue;
}
Gizmos.DrawLine(joint.position, child.position);
DrawJoints(child);
}
}
}