Esempio n. 1
0
    private void _InitMusclePosInfo()
    {
        MoveMuscle   musclePtr = null;
        MoveViceBone bonePtr   = null;

        for (int i = 0; i < c_nMaxActorNum; i++)
        {
            musclePtr     = GetMuscle(i);
            bonePtr       = GetViceBone(musclePtr.viceBoneId);
            musclePtr.dir = bonePtr.dir;
            Vector2 offsetDir =
                LogicMath.GetRotateNewPos(bonePtr.dir, musclePtr.sinWithBoneDir, musclePtr.cosWithBoneDir);
            musclePtr.pos = bonePtr.pos + offsetDir * musclePtr.deltaLength;
        }
    }
Esempio n. 2
0
    private void UpdateMuscle()
    {
        MoveViceBone viceBonePtr = null;
        MoveMuscle   musclePtr   = null;

        for (int i = 0; i < muscleNum; i++)
        {
            musclePtr   = GetMuscle(i);
            viceBonePtr = GetViceBone(musclePtr.viceBoneId);
            MoveBone baseBone = GetBaseBone(viceBonePtr.baseBoneId);
            musclePtr.dir = baseBone.dir;
            Vector2 offsetDir =
                LogicMath.GetRotateNewPos(baseBone.dir, musclePtr.sinWithBoneDir, musclePtr.cosWithBoneDir);
            musclePtr.pos = baseBone.pos + offsetDir * musclePtr.deltaLength;
        }
    }
Esempio n. 3
0
    private void _InitMusclePosInfo()
    {
        MoveMuscle   musclePtr   = null;
        MoveViceBone viceBonePtr = null;

        for (int i = 0; i < c_nMaxActorNum; i++)
        {
            musclePtr = GetMuscle(i);
            //获取副骨骼
            viceBonePtr = GetViceBone(musclePtr.viceBoneId);
            Debug.Log("=4=init=======>>" + " musclePtr.viceBoneId = " + musclePtr.viceBoneId);
            //肌肉
            musclePtr.dir = viceBonePtr.dir;
            Vector2 offsetDir = LogicMath.GetRotateNewPos(viceBonePtr.dir, musclePtr.sinWithBoneDir, musclePtr.cosWithBoneDir);
            //计算位置
            musclePtr.pos = viceBonePtr.pos + offsetDir * musclePtr.deltaLength;

            Debug.Log("=4=init=======>>" + " musclePtr.pos = " + musclePtr.pos + ", viceBonePtr.pos = " + viceBonePtr.pos + ", musclePtr.dir = " + musclePtr.dir + ",offsetDir = " + offsetDir + ",MusclePos = " + musclePtr.pos);
        }
    }