From cce6604f2533c52d108df2774935fcce50385896 Mon Sep 17 00:00:00 2001 From: rdb Date: Thu, 1 Oct 2009 17:27:42 +0000 Subject: [PATCH] Fix joint feedback exposure --- panda/src/ode/odeJoint.I | 8 +++----- panda/src/ode/odeJoint.h | 13 +++++++++++-- 2 files changed, 14 insertions(+), 7 deletions(-) diff --git a/panda/src/ode/odeJoint.I b/panda/src/ode/odeJoint.I index cef47ed02b..22f4be8bc9 100755 --- a/panda/src/ode/odeJoint.I +++ b/panda/src/ode/odeJoint.I @@ -52,17 +52,15 @@ get_joint_type() const { return dJointGetType(_id); } -/* INLINE void OdeJoint:: -set_feedback(dJointFeedback *feedback) { +set_feedback(OdeJointFeedback *feedback) { dJointSetFeedback(_id, feedback); } -INLINE dJointFeedback *OdeJoint:: +INLINE OdeJointFeedback *OdeJoint:: get_feedback() { - return dJointGetFeedback(_id); + return (OdeJointFeedback*) dJointGetFeedback(_id); } -*/ INLINE int OdeJoint:: compare_to(const OdeJoint &other) const { diff --git a/panda/src/ode/odeJoint.h b/panda/src/ode/odeJoint.h index 996eb6ab44..8aefa4ed9c 100755 --- a/panda/src/ode/odeJoint.h +++ b/panda/src/ode/odeJoint.h @@ -23,6 +23,15 @@ #include "odeWorld.h" // Needed for derived classes #include "odeJointGroup.h" +BEGIN_PUBLISH +class EXPCL_PANDAODE OdeJointFeedback : public dJointFeedback { + INLINE const LVector3f get_force1() const { return LVector3f(f1[0], f1[1], f1[2]); }; + INLINE const LVector3f get_force2() const { return LVector3f(f2[0], f2[1], f2[2]); }; + INLINE const LVector3f get_torque1() const { return LVector3f(t1[0], t1[1], t1[2]); }; + INLINE const LVector3f get_torque2() const { return LVector3f(t2[0], t2[1], t2[2]); }; +}; +END_PUBLISH + // Strange, we should be forced to include this by get_body() class OdeBody; @@ -75,8 +84,8 @@ PUBLISHED: /* INLINE void *get_data(); */ INLINE int get_joint_type() const; OdeBody get_body(int index) const; - /* INLINE void set_feedback(dJointFeedback *); */ - /* INLINE dJointFeedback *get_feedback(); */ + INLINE void set_feedback(OdeJointFeedback *); + INLINE OdeJointFeedback *get_feedback(); void attach_bodies(const OdeBody &body1, const OdeBody &body2); void attach_body(const OdeBody &body, int index);