Esempio n. 1
0
    // Start is called before the first frame update
    void Start()
    {
        m_id           = FKIKPlugin.CreateActor();
        m_jointPainter = this.GetComponent <JointPainter>();

        // Initialize the plugin and virtual joints
        TraverseJoints(m_root.transform); // Add joints to the m_joints and m_idJointMap
        LinkJoints();                     // Set the parent child relationship
        m_jointPainter.InitVirtualJoints(this.name + "joints", m_joints);
        ConstructJointDataArray();        // Initialize the joint data array
        ConstructIKChains();              // Construct IK chains for hands and feet
        GameObject[] endJoints = new GameObject[] { m_root, m_leftHand, m_rightHand, m_leftFoot, m_rightFoot };
        m_jointPainter.InitializeTargetJoints(endJoints);

        if (m_defaultBVH)
        {
            string projectPath = Application.dataPath;
            string filePath    = AssetDatabase.GetAssetPath(m_defaultBVH);
            string filename    = Path.Combine(projectPath, "../", filePath);
            Debug.Log(filename);
            LoadBVHFile(filename);
            StartMove();
        }
    }
Esempio n. 2
0
 // Start is called before the first frame update
 void Start()
 {
     m_jointPainter        = m_model.GetComponent <JointPainter>();
     m_characterController = m_model.GetComponent <FKIKCharacterController>();
 }