Why not save the result of `cpPinJointGetClass ()` and used in following codes.