public HandBones GetHandBones() { HandBones handBones = new HandBones(); if (PsaFile.DataSection[DataSectionLocation + 19] >= 8096 && PsaFile.DataSection[DataSectionLocation + 19] < PsaFile.DataSectionSize) { handBones.Offset = PsaFile.DataSection[DataSectionLocation + 19]; int handBonesLocation = PsaFile.DataSection[DataSectionLocation + 19] / 4; // k handBones.HandNBoneIndex0 = PsaFile.DataSection[handBonesLocation]; handBones.HandNBoneIndex1 = PsaFile.DataSection[handBonesLocation + 1]; handBones.HandNBoneIndex2 = PsaFile.DataSection[handBonesLocation + 2]; handBones.HandNBoneIndex3 = PsaFile.DataSection[handBonesLocation + 3]; handBones.DataCount = PsaFile.DataSection[handBonesLocation + 4]; handBones.DataOffset = PsaFile.DataSection[handBonesLocation + 5]; if (PsaFile.DataSection[handBonesLocation + 5] >= 8096 && PsaFile.DataSection[handBonesLocation + 5] < PsaFile.DataSectionSize) { int numberOfHandBones = PsaFile.DataSection[handBonesLocation + 4]; if (numberOfHandBones > 0 && numberOfHandBones < 80) // I guess there can only be 80 handbones? ok... { handBones.BonesListDataOffset = PsaFile.DataSection[handBonesLocation + 5]; int handBonesValuesLocation = PsaFile.DataSection[handBonesLocation + 5] / 4; // j for (int i = 0; i < numberOfHandBones; i++) { handBones.Bones.Add(PsaFile.DataSection[handBonesValuesLocation + i]); } } } } Console.WriteLine(handBones); return(handBones); }
/// <summary> /// /// </summary> public HandControllerBase( HandAnimator i_animator, int i_handType, HandBones i_handId ) { // animator = i_animator; handType = i_handType; handId = i_handId; // fingers = new HandFinger[5]; }
/// <summary> /// /// </summary> public virtual HandControllerBase GetHandController(HandBones i_handId) { switch (i_handId) { case HandBones.LeftHand: return(hands[HandControllerBase.k_LeftHand]); case HandBones.RightHand: return(hands[HandControllerBase.k_RightHand]); default: return(null); } }
/// <summary> /// /// </summary> public HandFinger( HandAnimator i_animator, int i_fingerId, HandBones i_boneId, int i_num = 3 ) { animator = i_animator; fingerId = i_fingerId; joints = new HandJoint[i_num]; m_NumJoints = 0; for (; m_NumJoints < i_num; ++m_NumJoints) { joints[m_NumJoints] = animator.joints[i_boneId + m_NumJoints]; } }