   An other problem with IK CCD method.
  I use CCD method to implement ik system.I'll show some code herevoid CCCDIKManager::rotate_parent_bone_to_dest_position( CBaseBone& current_bone, const Vector3& dest_world_position ){CBaseBone* parent_bone = _attached_model->get_parent_bone( current_bone.bone_no );MY_ASSERT( NULL != parent_bone );Matrix parent_world_to_local;MatrixInverse( &parent_world_to_local, NULL, parent_bone->world_matrix );Vector3 parent_bone_world_position( parent_bone->world_matrix->w.x, parent_bone->world_matrix->w.y, parent_bone->world_matrix->w.z );Vector3 current_bone_world_position( current_bone.world_matrix->w.x, current_bone.world_matrix->w.y, current_bone.world_matrix->w.z );Vector3 parent_to_current_bone_dir = current_bone_world_position - parent_bone_world_position;Vector3 parent_to_dest_dir = dest_world_position - parent_bone_world_position;if( parent_to_current_bone_dir.is_zero_vector() || parent_to_dest_dir.is_zero_vector() )return;parent_to_current_bone_dir.normalize();parent_to_dest_dir.normalize();float dot_product = parent_to_current_bone_dir.dot_prod( parent_to_dest_dir );if ( dot_product > 0.999f )return;floattheta = acos( dot_product );Vector3 normal = parent_to_current_bone_dir.cross_prod( parent_to_dest_dir );normal.normalize();Vector3 parent_space_normal;NormalTransformCoord( &parent_space_normal, &normal, &parent_world_to_local );parent_space_normal.normalize();Quaternion constraint_rotation = calc_constrant_rotation( *parent_bone, theta, parent_space_normal );parent_bone->local_rot = constraint_rotation;MatrixTransform( parent_bone->local_matrix, &parent_bone->local_translate, &parent_bone->local_rot, &parent_bone->local_scale );}// hereif ( dot_product > 0.999f )return;means parentBoneToCurrentBoneDirection is colinear with parentBoneToDestPositionDirectionHow to deal with this situation?   
  float angleToChange = acos(dot(parentBoneToCurrentBoneDirection, parentBoneToDestPositionDirection));which is equal to zero when the vectors are colinear. In other words, the angle change necessary is zero.if you did:float angleToChange = asin(dot(cross(parentBoneToCurrentBoneDirection, parentBoneToDestPositionDirection), parentBoneToDestPositionDirection));it would give you the signed angle to rotate in order to point towards the target. where as the previouse example will give you 0 to pioutput over the range of the dot product.;  why are these posted under Graphics Theory? I think they would be much better suited in Math and Physics.   