15 #include "physxSphericalJoint.h"
16 #include "physxSphericalJointDesc.h"
25 void PhysxSphericalJoint::
26 link(NxJoint *jointPtr) {
28 _ptr = jointPtr->isSphericalJoint();
29 _ptr->userData =
this;
35 scene->_joints.add(
this);
43 void PhysxSphericalJoint::
46 _ptr->userData = NULL;
47 _error_type = ET_released;
50 scene->_joints.remove(
this);
62 nassertv(_error_type == ET_ok);
63 _ptr->saveToDesc(jointDesc._desc);
75 nassertv(_error_type == ET_ok);
76 _ptr->loadFromDesc(jointDesc._desc);
87 nassertv(_error_type == ET_ok);
88 _ptr->setProjectionMode((NxJointProjectionMode)mode);
99 nassertr(_error_type == ET_ok, PM_none);
100 return (PhysxProjectionMode)_ptr->getProjectionMode();
109 set_flag(PhysxSphericalJointFlag flag,
bool value) {
111 nassertv(_error_type == ET_ok);
112 NxU32 flags = _ptr->getFlags();
121 _ptr->setFlags(flags);
132 nassertr(_error_type == ET_ok,
false);
133 return (_ptr->getFlags() & flag) ?
true :
false;
void save_to_desc(PhysxSphericalJointDesc &jointDesc) const
Saves the state of the joint object to a descriptor.
A scene is a collection of bodies, constraints, and effectors which can interact. ...
Descriptor class for distance joint.
PhysxProjectionMode get_projection_mode() const
Returns the current projection mode settings.
bool get_flag(PhysxSphericalJointFlag flag) const
Returns the value of a single SphericalJointFlag.
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.