コード例 #1
0
        /// <summary>
        /// Instantiates a muscle at the specified point.
        /// </summary>
        private void CreateMuscleFromBone(Bone bone)
        {
            var muscleData = new MuscleData(idCounter++, bone.BoneData.id, bone.BoneData.id, Muscle.Defaults.MaxForce, true);

            currentMuscle = Muscle.CreateFromData(muscleData);
            currentMuscle.startingBone = bone;
            currentMuscle.SetLinePoints(bone.Center, bone.Center);
        }
コード例 #2
0
        private Muscle CreateMuscleBetween(Bone startingBone, Bone endingBone, MuscleData data)
        {
            var muscle = Muscle.CreateFromData(data);

            muscle.startingBone = startingBone;
            muscle.endingBone   = endingBone;

            muscle.SetLinePoints(startingBone.Center, endingBone.Center);
            return(muscle);
        }