22 void PhysxSphericalJoint::
23 link(NxJoint *jointPtr) {
25 _ptr = jointPtr->isSphericalJoint();
26 _ptr->userData =
this;
32 scene->_joints.add(
this);
38 void PhysxSphericalJoint::
41 _ptr->userData =
nullptr;
42 _error_type = ET_released;
45 scene->_joints.remove(
this);
54 nassertv(_error_type == ET_ok);
55 _ptr->saveToDesc(jointDesc._desc);
64 nassertv(_error_type == ET_ok);
65 _ptr->loadFromDesc(jointDesc._desc);
74 nassertv(_error_type == ET_ok);
75 _ptr->setProjectionMode((NxJointProjectionMode)mode);
84 nassertr(_error_type == ET_ok, PM_none);
85 return (PhysxProjectionMode)_ptr->getProjectionMode();
92 set_flag(PhysxSphericalJointFlag flag,
bool value) {
94 nassertv(_error_type == ET_ok);
95 NxU32 flags = _ptr->getFlags();
104 _ptr->setFlags(flags);
113 nassertr(_error_type == ET_ok,
false);
114 return (_ptr->getFlags() & flag) ?
true :
false;
void save_to_desc(PhysxSphericalJointDesc &jointDesc) const
Saves the state of the joint object to a descriptor.
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
A scene is a collection of bodies, constraints, and effectors which can interact.
Descriptor class for distance joint.
bool get_flag(PhysxSphericalJointFlag flag) const
Returns the value of a single SphericalJointFlag.
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
PhysxProjectionMode get_projection_mode() const
Returns the current projection mode settings.
void set_projection_mode(PhysxProjectionMode mode)
Sets the joint projection mode.
void set_name(const char *name)
Sets a name string for this object.
TypeHandle is the identifier used to differentiate C++ class types.
void load_from_desc(const PhysxSphericalJointDesc &jointDesc)
Loads the entire state of the joint from a descriptor with a single call.
void set_flag(PhysxSphericalJointFlag flag, bool value)
Sets or clears a single SphericalJointFlag.