Exemplo n.º 1
0
    // Insert a rotation key into both the euler curve and the quaternion curve
    // The keyID in these two curves should be the same
    public void InsertRotationKey(GameObject key)
    {
        if (m_rotationKeyPointList.IndexOf(key) != -1)
        {
            Debug.Log("This rotation key has been added.");
            return;
        }
        double t       = GetVecKeyID(key); // Assume t equals keyID
        int    eulerID = CurvePlugin.InsertEulerKey(m_id, t, PluginHelpFunction.Vector3ToDoubleArray(Quaternion.identity.eulerAngles));
        int    quatID  = CurvePlugin.InsertQuatKey(m_id, t, PluginHelpFunction.QuaternionToDoubleArray(Quaternion.identity));

        if (eulerID != quatID)
        {
            Debug.LogError("Euler curve ID and Quat curve ID are different");
        }
        m_rotationKeyPointList.Insert(eulerID, key);
    }
Exemplo n.º 2
0
    public void EditQuatKey(GameObject key, Quaternion quat)
    {
        int keyID = GetRotationKeyID(key);

        CurvePlugin.EditQuatKey(m_id, keyID, PluginHelpFunction.QuaternionToDoubleArray(quat));
    }