# How to constrain axis-angle rotation?

I have a problem where I'm performing an axis-angle rotation and am trying to constrain my rotations. Specifically I have a skeleton (model/mesh with rig, transforms are hierarchy parented to pelvis which move the triangles of the mesh) and I am constraining the motions to prevent bad joint rotations (e.g. knees bending sideways or backwards). The rotations in this case can pretty much be constrained by saying "do not rotate about X/Y/Z."

I'm using the Unity3D RotateAround function which rotates about a specified axis at a point by an arbitrary angle. Given control over this point, axis, and angle how can I constrain this rotation to prevent "bad" rotations?

Vector3 axis = Vector3.Cross(RD, RE);