protected virtual void ReadPose() { for (int i = 0; i < bendConstraints.Length; i++) { bendConstraints[i].LimitBend(IKPositionWeight); } // Presolve effectors, apply effector offset to the nodes for (int i = 0; i < effectors.Length; i++) { effectors[i].ResetOffset(); } for (int i = 0; i < effectors.Length; i++) { effectors[i].OnPreSolve(); } // Set solver positions to match the current bone positions of the biped for (int i = 0; i < chain.Length; i++) { chain[i].ReadPose(chain); } // IKMapping spineMapping.ReadPose(); for (int i = 0; i < boneMappings.Length; i++) { boneMappings[i].ReadPose(); } for (int i = 0; i < limbMappings.Length; i++) { limbMappings[i].ReadPose(); } }
protected virtual void ReadPose() { // Presolve effectors, apply effector offset to the nodes for (int i = 0; i < effectors.Length; i++) { effectors[i].ResetOffset(); } for (int i = 0; i < effectors.Length; i++) { effectors[i].OnPreSolve(); } // Set solver positions to match the current bone positions of the biped chain.ReadPose(); // IKMapping spineMapping.ReadPose(); for (int i = 0; i < boneMappings.Length; i++) { boneMappings[i].ReadPose(); } for (int i = 0; i < limbMappings.Length; i++) { limbMappings[i].ReadPose(); } }
protected virtual void ReadPose() { // Making sure the limbs are not inverted // 确保肢体没有被翻转, 约束其在一定范围内 for (int i = 0; i < chain.Length; i++) { if (chain[i].bendConstraint.initiated) { chain[i].bendConstraint.LimitBend(IKPositionWeight, GetEffector(chain[i].nodes[2].transform).positionWeight); } } // Presolve effectors, apply effector offset to the nodes // 清零之间计算好的 Node 的 offset for (int i = 0; i < effectors.Length; i++) { effectors[i].ResetOffset(this); } // 将上一帧所产生的 effctor 的偏移值送给 node的offset for (int i = 0; i < effectors.Length; i++) { effectors[i].OnPreSolve(this); } // Set solver positions to match the current bone positions of the biped // 将上一次 累计的offset置入到 chain 各个骨骼的solverPosition中去 for (int i = 0; i < chain.Length; i++) { chain[i].ReadPose(this, iterations > 0); } // IKMapping if (iterations > 0) { spineMapping.ReadPose(); for (int i = 0; i < boneMappings.Length; i++) { boneMappings[i].ReadPose(); } } for (int i = 0; i < limbMappings.Length; i++) { limbMappings[i].ReadPose(); } }
protected virtual void ReadPose() { // Making sure the limbs are not inverted for (int i = 0; i < chain.Length; i++) { if (chain[i].bendConstraint.initiated) { chain[i].bendConstraint.LimitBend(IKPositionWeight, GetEffector(chain[i].nodes[2].transform).positionWeight); } } // Presolve effectors, apply effector offset to the nodes for (int i = 0; i < effectors.Length; i++) { effectors[i].ResetOffset(this); } for (int i = 0; i < effectors.Length; i++) { effectors[i].OnPreSolve(this); } // Set solver positions to match the current bone positions of the biped for (int i = 0; i < chain.Length; i++) { chain[i].ReadPose(this, iterations > 0); } // IKMapping if (iterations > 0) { spineMapping.ReadPose(); for (int i = 0; i < boneMappings.Length; i++) { boneMappings[i].ReadPose(); } } for (int i = 0; i < limbMappings.Length; i++) { limbMappings[i].ReadPose(); } }