15 #include "config_ode.h" 17 #include "odeBallJoint.h" 18 #include "odeHingeJoint.h" 19 #include "odeHinge2Joint.h" 20 #include "odeSliderJoint.h" 21 #include "odeContactJoint.h" 22 #include "odeUniversalJoint.h" 23 #include "odeFixedJoint.h" 24 #include "odeNullJoint.h" 25 #include "odePlane2dJoint.h" 26 #include "odeAMotorJoint.h" 27 #include "odeLMotorJoint.h" 35 ostream &out = odejoint_cat.debug();
36 out << get_type() <<
"(" << _id <<
")\n";
40 OdeJoint(dJointID
id) :
42 ostream &out = odejoint_cat.debug();
43 out << get_type() <<
"(" << _id <<
")\n";
83 nassertv(body.
get_id() != 0);
84 nassertv(index == 0 || index == 1);
86 dJointAttach(_id, body.
get_id(), 0);
88 dJointAttach(_id, 0, body.
get_id());
95 dJointAttach(_id, 0, 0);
99 get_body(
int index)
const {
101 nassertr(index == 0 || index == 1,
OdeBody(0));
102 return OdeBody(dJointGetBody(_id, index));
106 write(ostream &out,
unsigned int indent)
const {
107 out.width(indent); out <<
"" << get_type() \
130 operator bool ()
const {
131 return (_id != NULL);
135 convert_to_ball()
const {
142 convert_to_hinge()
const {
149 convert_to_slider()
const {
156 convert_to_contact()
const {
163 convert_to_universal()
const {
170 convert_to_hinge2()
const {
177 convert_to_fixed()
const {
184 convert_to_null()
const {
191 convert_to_a_motor()
const {
198 convert_to_l_motor()
const {
205 convert_to_plane2d()
const {
void attach_bodies(const OdeBody &body1, const OdeBody &body2)
Attaches two OdeBody objects to this joint.
dBodyID get_id() const
Returns the underlying dBodyID.
void attach_body(const OdeBody &body, int index)
Attaches a single OdeBody to this joint at the specified index (0 or 1).
TypeHandle is the identifier used to differentiate C++ class types.