34 std::ostream &out = odejoint_cat.debug();
35 out << get_type() <<
"(" << _id <<
")\n";
39 OdeJoint(dJointID
id) :
41 std::ostream &out = odejoint_cat.debug();
42 out << get_type() <<
"(" << _id <<
")\n";
63 nassertv(body1.
get_id() !=
nullptr || body2.
get_id() !=
nullptr);
75 nassertv(body.
get_id() !=
nullptr);
76 nassertv(index == 0 || index == 1);
78 dJointAttach(_id, body.
get_id(),
nullptr);
80 dJointAttach(_id,
nullptr, body.
get_id());
87 dJointAttach(_id,
nullptr,
nullptr);
91 get_body(
int index)
const {
92 nassertr(_id,
OdeBody(
nullptr));
93 nassertr(index == 0 || index == 1,
OdeBody(
nullptr));
94 return OdeBody(dJointGetBody(_id, index));
98 write(std::ostream &out,
unsigned int indent)
const {
99 out.width(
indent); out <<
"" << get_type() \
103 if (body.
get_id() !=
nullptr) {
111 if (body.
get_id() !=
nullptr) {
122 operator bool ()
const {
123 return (_id !=
nullptr);
127 convert_to_ball()
const {
129 nassertr(get_joint_type() == JT_ball,
OdeBallJoint(
nullptr));
134 convert_to_hinge()
const {
136 nassertr(get_joint_type() == JT_hinge,
OdeHingeJoint(
nullptr));
141 convert_to_slider()
const {
148 convert_to_contact()
const {
155 convert_to_universal()
const {
162 convert_to_hinge2()
const {
169 convert_to_fixed()
const {
171 nassertr(get_joint_type() == JT_fixed,
OdeFixedJoint(
nullptr));
176 convert_to_null()
const {
178 nassertr(get_joint_type() == JT_null,
OdeNullJoint(
nullptr));
183 convert_to_a_motor()
const {
185 nassertr(get_joint_type() == JT_a_motor,
OdeAMotorJoint(
nullptr));
190 convert_to_l_motor()
const {
192 nassertr(get_joint_type() == JT_l_motor,
OdeLMotorJoint(
nullptr));
197 convert_to_plane2d()
const {
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
void attach_bodies(const OdeBody &body1, const OdeBody &body2)
Attaches two OdeBody objects to this joint.
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
dBodyID get_id() const
Returns the underlying dBodyID.
std::ostream & indent(std::ostream &out, int indent_level)
A handy function for doing text formatting.
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
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.
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.