internal PowerSetting GetBoneSetting(BoneName bone) { ThrowExceptionIfNotValid(); if (settings.TryGetValue(bone, out PowerSetting setting)) { return(setting); } else { UnityEngine.Debug.LogWarning($"Requested power settings for {bone}, but no setting for it was found in {name}."); return(PowerSetting.Unpowered); } }
internal float GetBoneMass(BoneName bone, float totalMass) { ThrowExceptionIfNotValid(); if (factors.TryGetValue(bone, out float factor)) { float actualFactor = factor / GetTotalFactorSum(); return(totalMass * actualFactor); } else { UnityEngine.Debug.LogWarning($"Bone \"{bone}\" is not present in {definition.name}.", this); return(1); } }
public bool TryGetBoundBoneName(ConfigurableJoint joint, out BoneName boneName) { ThrowExceptionIfNotInitialized(); foreach (KeyValuePair <BoneName, ConfigurableJoint> pair in bindings) { if (pair.Value == joint) { boneName = pair.Key; return(true); } } boneName = "JointDoesNotBelongToARagdollBone"; return(false); }
public bool TryGetBone(BoneName boneName, out RagdollBone bone) { ThrowExceptionIfNotInitialized(); return(bones.TryGetValue(boneName, out bone)); }
ConfigurableJoint GetBindingJoint(BoneName name) { return(bindings[name]); }
public bool IsRoot(BoneName boneName) { ThrowExceptionIfIsInvalid(); return(boneName == _root); }
public BonePair(BoneName boneA, BoneName boneB) { this.boneA = boneA; this.boneB = boneB; }