00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023 INLINE bool OdeJoint::
00024 is_empty() const {
00025 return (_id == 0);
00026 }
00027
00028
00029
00030
00031
00032
00033 INLINE dJointID OdeJoint::
00034 get_id() const {
00035 return _id;
00036 }
00037
00038
00039
00040
00041
00042
00043
00044
00045
00046
00047
00048
00049
00050 INLINE int OdeJoint::
00051 get_joint_type() const {
00052 return dJointGetType(_id);
00053 }
00054
00055 INLINE void OdeJoint::
00056 set_feedback(bool flag) {
00057 if (flag) {
00058 if (dJointGetFeedback(_id) != NULL) {
00059 return;
00060 }
00061 OdeJointFeedback* feedback = new OdeJointFeedback;
00062 dJointSetFeedback(_id, (dJointFeedback*) feedback);
00063 } else if (dJointFeedback* feedback = dJointGetFeedback(_id)) {
00064 dJointSetFeedback(_id, NULL);
00065 delete feedback;
00066 }
00067 }
00068
00069 INLINE void OdeJoint::
00070 set_feedback(OdeJointFeedback *feedback) {
00071 dJointSetFeedback(_id, feedback);
00072 }
00073
00074 INLINE OdeJointFeedback *OdeJoint::
00075 get_feedback() {
00076 return (OdeJointFeedback*) dJointGetFeedback(_id);
00077 }
00078
00079 INLINE int OdeJoint::
00080 compare_to(const OdeJoint &other) const {
00081 if (_id != other._id) {
00082 return _id < other._id ? -1 : 1;
00083 }
00084 return 0;
00085 }
00086
00087 INLINE bool OdeJoint::
00088 operator == (const OdeJoint &other) const {
00089 return _id == other._id;
00090 }