/// <summary> /// Determines whether this IKMappingSpine is valid /// </summary> public override bool IsValid(IKSolver solver, Warning.Logger logger) { if (!base.IsValid(solver, logger)) return false; foreach (Transform spineBone in spineBones) if (spineBone == null) { if (logger != null) logger("Spine bones contains a null reference."); return false; } int nodes = 0; for (int i = 0; i < spineBones.Length; i++) { if (solver.GetPoint(spineBones[i]) != null) nodes ++; } if (nodes == 0) { if (logger != null) logger("IKMappingSpine does not contain any nodes."); return false; } if (leftUpperArmBone == null) { if (logger != null) logger("IKMappingSpine is missing the left upper arm bone."); return false; } if (rightUpperArmBone == null) { if (logger != null) logger("IKMappingSpine is missing the right upper arm bone."); return false; } if (leftThighBone == null) { if (logger != null) logger("IKMappingSpine is missing the left thigh bone."); return false; } if (rightThighBone == null) { if (logger != null) logger("IKMappingSpine is missing the right thigh bone."); return false; } if (solver.GetPoint(leftUpperArmBone) == null) { if (logger != null) logger("Full Body IK is missing the left upper arm node."); return false; } if (solver.GetPoint(rightUpperArmBone) == null) { if (logger != null) logger("Full Body IK is missing the right upper arm node."); return false; } if (solver.GetPoint(leftThighBone) == null) { if (logger != null) logger("Full Body IK is missing the left thigh node."); return false; } if (solver.GetPoint(rightThighBone) == null) { if (logger != null) logger("Full Body IK is missing the right thigh node."); return false; } return true; }
/* * Determines whether this IKEffector is valid or not. * */ public bool IsValid(IKSolver solver, ref string message) { if (bone == null) { message = "IK Effector bone is null."; return(false); } if (solver.GetPoint(bone) == null) { message = "IK Effector is referencing to a bone '" + bone.name + "' that does not excist in the Node Chain."; return(false); } foreach (Transform b in childBones) { if (b == null) { message = "IK Effector contains a null reference."; return(false); } } foreach (Transform b in childBones) { if (solver.GetPoint(b) == null) { message = "IK Effector is referencing to a bone '" + b.name + "' that does not excist in the Node Chain."; return(false); } } if (planeBone1 != null && solver.GetPoint(planeBone1) == null) { message = "IK Effector is referencing to a bone '" + planeBone1.name + "' that does not excist in the Node Chain."; return(false); } if (planeBone2 != null && solver.GetPoint(planeBone2) == null) { message = "IK Effector is referencing to a bone '" + planeBone2.name + "' that does not excist in the Node Chain."; return(false); } if (planeBone3 != null && solver.GetPoint(planeBone3) == null) { message = "IK Effector is referencing to a bone '" + planeBone3.name + "' that does not excist in the Node Chain."; return(false); } return(true); }
/* * Initiate the effector, set default values * */ public void Initiate(IKSolver solver) { this.solver = solver; position = bone.position; rotation = bone.rotation; animatedPlaneRotation = Quaternion.identity; // Getting the node node = solver.GetPoint(bone) as IKSolver.Node; // Child nodes if (childNodes == null || childNodes.Length != childBones.Length) { childNodes = new IKSolver.Node[childBones.Length]; } for (int i = 0; i < childBones.Length; i++) { childNodes[i] = solver.GetPoint(childBones[i]) as IKSolver.Node; } if (localPositions == null || localPositions.Length != childBones.Length) { localPositions = new Vector3[childBones.Length]; } // Plane nodes usePlaneNodes = false; if (planeBone1 != null) { planeNode1 = solver.GetPoint(planeBone1) as IKSolver.Node; if (planeBone2 != null) { planeNode2 = solver.GetPoint(planeBone2) as IKSolver.Node; if (planeBone3 != null) { planeNode3 = solver.GetPoint(planeBone3) as IKSolver.Node; usePlaneNodes = true; } } isEndEffector = true; } else { isEndEffector = false; } }
public bool IsValid(IKSolver solver, ref string message) { if (this.bone == null) { message = "IK Effector bone is null."; return(false); } if (solver.GetPoint(this.bone) == null) { message = "IK Effector is referencing to a bone '" + this.bone.name + "' that does not excist in the Node Chain."; return(false); } Transform[] array = this.childBones; for (int i = 0; i < array.Length; i++) { if (array[i] == null) { message = "IK Effector contains a null reference."; return(false); } } foreach (Transform transform in this.childBones) { if (solver.GetPoint(transform) == null) { message = "IK Effector is referencing to a bone '" + transform.name + "' that does not excist in the Node Chain."; return(false); } } if (this.planeBone1 != null && solver.GetPoint(this.planeBone1) == null) { message = "IK Effector is referencing to a bone '" + this.planeBone1.name + "' that does not excist in the Node Chain."; return(false); } if (this.planeBone2 != null && solver.GetPoint(this.planeBone2) == null) { message = "IK Effector is referencing to a bone '" + this.planeBone2.name + "' that does not excist in the Node Chain."; return(false); } if (this.planeBone3 != null && solver.GetPoint(this.planeBone3) == null) { message = "IK Effector is referencing to a bone '" + this.planeBone3.name + "' that does not excist in the Node Chain."; return(false); } return(true); }
public void Initiate(Transform transform, IKSolver solver) { this.transform = transform; IKSolver.Point point = solver.GetPoint(transform); if (point != null) { this.node = (point as IKSolver.Node); } }
protected bool BoneIsValid(Transform bone, IKSolver solver, Warning.Logger logger = null) { if (bone == null) { if (logger != null) logger("IKMappingLimb contains a null reference."); return false; } if (solver.GetPoint(bone) == null) { if (logger != null) logger("IKMappingLimb is referencing to a bone '" + bone.name + "' that does not excist in the Node Chain."); return false; } return true; }
public void Initiate(IKSolver solver) { this.solver = solver; this.position = this.bone.position; this.rotation = this.bone.rotation; this.animatedPlaneRotation = Quaternion.identity; this.node = (solver.GetPoint(this.bone) as IKSolver.Node); if (this.childNodes == null || this.childNodes.Length != this.childBones.Length) { this.childNodes = new IKSolver.Node[this.childBones.Length]; } for (int i = 0; i < this.childBones.Length; i++) { this.childNodes[i] = (solver.GetPoint(this.childBones[i]) as IKSolver.Node); } if (this.localPositions == null || this.localPositions.Length != this.childBones.Length) { this.localPositions = new Vector3[this.childBones.Length]; } this.usePlaneNodes = false; if (this.planeBone1 != null) { this.planeNode1 = (solver.GetPoint(this.planeBone1) as IKSolver.Node); if (this.planeBone2 != null) { this.planeNode2 = (solver.GetPoint(this.planeBone2) as IKSolver.Node); if (this.planeBone3 != null) { this.planeNode3 = (solver.GetPoint(this.planeBone3) as IKSolver.Node); this.usePlaneNodes = true; } } this.isEndEffector = true; } else { this.isEndEffector = false; } }
protected bool BoneIsValid(Transform bone, IKSolver solver, Warning.Logger logger = null) { if (bone == null) { if (logger != null) { logger("IKMappingLimb contains a null reference."); } return(false); } if (solver.GetPoint(bone) == null) { if (logger != null) { logger("IKMappingLimb is referencing to a bone '" + bone.name + "' that does not excist in the Node Chain."); } return(false); } return(true); }
public override bool IsValid(IKSolver solver, Warning.Logger logger = null) { if (!base.IsValid(solver, logger)) { return(false); } Transform[] array = this.spineBones; for (int i = 0; i < array.Length; i++) { Transform x = array[i]; if (x == null) { if (logger != null) { logger("Spine bones contains a null reference."); } return(false); } } int num = 0; for (int j = 0; j < this.spineBones.Length; j++) { if (solver.GetPoint(this.spineBones[j]) != null) { num++; } } if (num == 0) { if (logger != null) { logger("IKMappingSpine does not contain any nodes."); } return(false); } if (this.leftUpperArmBone == null) { if (logger != null) { logger("IKMappingSpine is missing the left upper arm bone."); } return(false); } if (this.rightUpperArmBone == null) { if (logger != null) { logger("IKMappingSpine is missing the right upper arm bone."); } return(false); } if (this.leftThighBone == null) { if (logger != null) { logger("IKMappingSpine is missing the left thigh bone."); } return(false); } if (this.rightThighBone == null) { if (logger != null) { logger("IKMappingSpine is missing the right thigh bone."); } return(false); } if (solver.GetPoint(this.leftUpperArmBone) == null) { if (logger != null) { logger("Full Body IK is missing the left upper arm node."); } return(false); } if (solver.GetPoint(this.rightUpperArmBone) == null) { if (logger != null) { logger("Full Body IK is missing the right upper arm node."); } return(false); } if (solver.GetPoint(this.leftThighBone) == null) { if (logger != null) { logger("Full Body IK is missing the left thigh node."); } return(false); } if (solver.GetPoint(this.rightThighBone) == null) { if (logger != null) { logger("Full Body IK is missing the right thigh node."); } return(false); } return(true); }
/* * Initiate the effector, set default values * */ public void Initiate(IKSolver solver) { this.solver = solver; position = bone.position; rotation = bone.rotation; animatedPlaneRotation = Quaternion.identity; // Getting the node node = solver.GetPoint(bone) as IKSolver.Node; // Child nodes if (childNodes == null || childNodes.Length != childBones.Length) childNodes = new IKSolver.Node[childBones.Length]; for (int i = 0; i < childBones.Length; i++) { childNodes[i] = solver.GetPoint(childBones[i]) as IKSolver.Node; } if (localPositions == null || localPositions.Length != childBones.Length) localPositions = new Vector3[childBones.Length]; // Plane nodes usePlaneNodes = false; if (planeBone1 != null) { planeNode1 = solver.GetPoint(planeBone1) as IKSolver.Node; if (planeBone2 != null) { planeNode2 = solver.GetPoint(planeBone2) as IKSolver.Node; if (planeBone3 != null) { planeNode3 = solver.GetPoint(planeBone3) as IKSolver.Node; usePlaneNodes = true; } } isEndEffector = true; } else isEndEffector = false; }
/* * Determines whether this IKEffector is valid or not. * */ public bool IsValid(IKSolver solver, Warning.Logger logger) { if (bone == null) { if (logger != null) logger("IK Effector bone is null."); return false; } if (solver.GetPoint(bone) == null) { if (logger != null) logger("IK Effector is referencing to a bone '" + bone.name + "' that does not excist in the Node Chain."); return false; } foreach (Transform b in childBones) { if (b == null) { if (logger != null) logger("IK Effector contains a null reference."); return false; } } foreach (Transform b in childBones) { if (solver.GetPoint(b) == null) { if (logger != null) logger("IK Effector is referencing to a bone '" + b.name + "' that does not excist in the Node Chain."); return false; } } if (planeBone1 != null && solver.GetPoint(planeBone1) == null) { if (logger != null) logger("IK Effector is referencing to a bone '" + planeBone1.name + "' that does not excist in the Node Chain."); return false; } if (planeBone2 != null && solver.GetPoint(planeBone2) == null) { if (logger != null) logger("IK Effector is referencing to a bone '" + planeBone2.name + "' that does not excist in the Node Chain."); return false; } if (planeBone3 != null && solver.GetPoint(planeBone3) == null) { if (logger != null) logger("IK Effector is referencing to a bone '" + planeBone3.name + "' that does not excist in the Node Chain."); return false; } return true; }
public void Initiate(Transform transform, IKSolver solver) { this.transform = transform; IKSolver.Point point = solver.GetPoint(transform); if (point != null) this.node = point as IKSolver.Node; }
/// <summary> /// Determines whether this IKMappingSpine is valid /// </summary> public override bool IsValid(IKSolver solver, Warning.Logger logger = null) { if (!base.IsValid(solver, logger)) { return(false); } foreach (Transform spineBone in spineBones) { if (spineBone == null) { if (logger != null) { logger("Spine bones contains a null reference."); } return(false); } } int nodes = 0; for (int i = 0; i < spineBones.Length; i++) { if (solver.GetPoint(spineBones[i]) != null) { nodes++; } } if (nodes == 0) { if (logger != null) { logger("IKMappingSpine does not contain any nodes."); } return(false); } if (leftUpperArmBone == null) { if (logger != null) { logger("IKMappingSpine is missing the left upper arm bone."); } return(false); } if (rightUpperArmBone == null) { if (logger != null) { logger("IKMappingSpine is missing the right upper arm bone."); } return(false); } if (leftThighBone == null) { if (logger != null) { logger("IKMappingSpine is missing the left thigh bone."); } return(false); } if (rightThighBone == null) { if (logger != null) { logger("IKMappingSpine is missing the right thigh bone."); } return(false); } if (solver.GetPoint(leftUpperArmBone) == null) { if (logger != null) { logger("Full Body IK is missing the left upper arm node."); } return(false); } if (solver.GetPoint(rightUpperArmBone) == null) { if (logger != null) { logger("Full Body IK is missing the right upper arm node."); } return(false); } if (solver.GetPoint(leftThighBone) == null) { if (logger != null) { logger("Full Body IK is missing the left thigh node."); } return(false); } if (solver.GetPoint(rightThighBone) == null) { if (logger != null) { logger("Full Body IK is missing the right thigh node."); } return(false); } return(true); }
public bool IsValid(IKSolver solver, Warning.Logger logger) { if (this.bone == null) { if (logger != null) { logger("IK Effector bone is null."); } return(false); } if (solver.GetPoint(this.bone) == null) { if (logger != null) { logger("IK Effector is referencing to a bone '" + this.bone.name + "' that does not excist in the Node Chain."); } return(false); } Transform[] array = this.childBones; for (int i = 0; i < array.Length; i++) { Transform x = array[i]; if (x == null) { if (logger != null) { logger("IK Effector contains a null reference."); } return(false); } } Transform[] array2 = this.childBones; for (int j = 0; j < array2.Length; j++) { Transform transform = array2[j]; if (solver.GetPoint(transform) == null) { if (logger != null) { logger("IK Effector is referencing to a bone '" + transform.name + "' that does not excist in the Node Chain."); } return(false); } } if (this.planeBone1 != null && solver.GetPoint(this.planeBone1) == null) { if (logger != null) { logger("IK Effector is referencing to a bone '" + this.planeBone1.name + "' that does not excist in the Node Chain."); } return(false); } if (this.planeBone2 != null && solver.GetPoint(this.planeBone2) == null) { if (logger != null) { logger("IK Effector is referencing to a bone '" + this.planeBone2.name + "' that does not excist in the Node Chain."); } return(false); } if (this.planeBone3 != null && solver.GetPoint(this.planeBone3) == null) { if (logger != null) { logger("IK Effector is referencing to a bone '" + this.planeBone3.name + "' that does not excist in the Node Chain."); } return(false); } return(true); }
public override bool IsValid(IKSolver solver, ref string message) { if (!base.IsValid(solver, ref message)) { return(false); } foreach (Transform x in this.spineBones) { if (x == null) { message = "Spine bones contains a null reference."; return(false); } } int num = 0; for (int j = 0; j < this.spineBones.Length; j++) { if (solver.GetPoint(this.spineBones[j]) != null) { num++; } } if (num == 0) { message = "IKMappingSpine does not contain any nodes."; return(false); } if (this.leftUpperArmBone == null) { message = "IKMappingSpine is missing the left upper arm bone."; return(false); } if (this.rightUpperArmBone == null) { message = "IKMappingSpine is missing the right upper arm bone."; return(false); } if (this.leftThighBone == null) { message = "IKMappingSpine is missing the left thigh bone."; return(false); } if (this.rightThighBone == null) { message = "IKMappingSpine is missing the right thigh bone."; return(false); } if (solver.GetPoint(this.leftUpperArmBone) == null) { message = "Full Body IK is missing the left upper arm node."; return(false); } if (solver.GetPoint(this.rightUpperArmBone) == null) { message = "Full Body IK is missing the right upper arm node."; return(false); } if (solver.GetPoint(this.leftThighBone) == null) { message = "Full Body IK is missing the left thigh node."; return(false); } if (solver.GetPoint(this.rightThighBone) == null) { message = "Full Body IK is missing the right thigh node."; return(false); } return(true); }