Exemple #1
0
 public void SetChangingOptions(
     PoseCostType poseCostType,
     TrajectoryCostType trajectoryCostType,
     ContactPointCostType contactCostType,
     ContactStateMovemetType movementType,
     NativeArray <BoneData> currentPose,
     NativeArray <TrajectoryPoint> currentTrajectory,
     NativeArray <FrameContact> currentContacts,
     NativeArray <float2> whereWeCanFindingPos,
     float trajectoryWeight,
     float poseWeight,
     float contactWeight
     )
 {
     this.poseCostType         = poseCostType;
     this.trajectoryCostType   = trajectoryCostType;
     this.contactCostType      = contactCostType;
     this.cntactMovmentType    = movementType;
     this.currentPose          = currentPose;
     this.currentTrajectory    = currentTrajectory;
     this.currentContactPoints = currentContacts;
     this.whereWeCanFindingPos = whereWeCanFindingPos;
     this.trajectoryWeight     = trajectoryWeight;
     this.poseWeight           = poseWeight;
     this.contactWeight        = contactWeight;
 }
Exemple #2
0
 public ContactStateFeatures()
 {
     contactMovementType = ContactStateMovemetType.ContactLand;
     contactCostType     = ContactPointCostType.PositionNormal_OR_Direction;
     adapt = false;
     contactPointsWeight = 1f;
     rotateToStart       = true;
     postionCorrection   = ContactPointPositionCorrectionType.MovePosition;
 }
Exemple #3
0
 public void SetChangingOptions(
     PoseCostType poseCostType,
     ContactPointCostType contactCostType,
     NativeArray <BoneData> currentPose,
     NativeArray <FrameContact> currentContacts,
     float poseWeight,
     float contactWeight
     )
 {
     this.poseCostType         = poseCostType;
     this.contactCostType      = contactCostType;
     this.currentPose          = currentPose;
     this.currentContactPoints = currentContacts;
     this.poseWeight           = poseWeight;
     this.contactWeight        = contactWeight;
 }
Exemple #4
0
        public float CalculateCost(MotionMatchingContact to, ContactPointCostType costType)
        {
            float cost = 0f;

            switch (costType)
            {
            case ContactPointCostType.Postion:
                cost += CalculatePositionCost(to);
                break;

            case ContactPointCostType.Normal_OR_Direction:
                cost += CalculateNormalCost(to);
                break;

            case ContactPointCostType.PositionNormal_OR_Direction:
                cost += CalculatePositionCost(to);
                cost += CalculateNormalCost(to);
                break;
            }

            return(cost);
        }
        private void OnCreate()
        {
            currentMotionDataGroupIndex = 0;

            this.contactType = dataState.csFeatures.contactMovementType;
            this.contactCost = dataState.csFeatures.contactCostType;
            csJobs           = new MotionMatchingContactEnterJob[dataState.maxJobsCount];
            logicLayer.adaptedContactPoints = new List <MotionMatchingContact>();
            targetContactPointIndex         = 0;

            for (int i = 0; i < dataState.maxJobsCount; i++)
            {
                csJobs[i] = new MotionMatchingContactEnterJob();
                csJobs[i].SetBasicOptions(
                    this.dataState.motionDataGroups[currentMotionDataGroupIndex].framesInfoPerJob[i],
                    this.dataState.motionDataGroups[currentMotionDataGroupIndex].bonesPerJob[i],
                    this.dataState.motionDataGroups[currentMotionDataGroupIndex].trajectoryPointsPerJob[i],
                    this.dataState.motionDataGroups[currentMotionDataGroupIndex].contactPointsPerJob[i],
                    bestInfosFromJob[i],
                    this.dataState.csFeatures.middleContactsCount
                    );
            }
        }