using UnityEngine; namespace BioIK { //This objective aims to minimise the translational distance between the transform and the target. [AddComponentMenu("")] public class Position : BioObjective { [SerializeField] private Transform Target; [SerializeField] private double TPX, TPY, TPZ; [SerializeField] private double MaximumError = 0.001; private double ChainLength; private double Rescaling; //private Vector3 Root; public override ObjectiveType GetObjectiveType() { return ObjectiveType.Position; } public override void UpdateData() { if(Segment.Character.Evolution == null) { return; } ChainLength = 0.0; Transform[] chain = Segment.Character.Evolution.GetModel().FindObjectivePtr(this).Node.Chain;; for(int i=0; i