25 void PhysxRevoluteJoint::
26 link(NxJoint *jointPtr) {
28 _ptr = jointPtr->isRevoluteJoint();
29 _ptr->userData =
this;
35 scene->_joints.add(
this);
41 void PhysxRevoluteJoint::
44 _ptr->userData =
nullptr;
45 _error_type = ET_released;
48 scene->_joints.remove(
this);
57 nassertv(_error_type == ET_ok);
58 _ptr->saveToDesc(jointDesc._desc);
67 nassertv(_error_type == ET_ok);
68 _ptr->loadFromDesc(jointDesc._desc);
83 nassertr(_error_type == ET_ok, 0.0f);
84 return NxMath::radToDeg(_ptr->getAngle());
94 nassertr(_error_type == ET_ok, 0.0f);
95 return _ptr->getVelocity();
104 nassertv(_error_type == ET_ok);
105 _ptr->setProjectionMode((NxJointProjectionMode)mode);
114 nassertr(_error_type == ET_ok, PM_none);
115 return (PhysxProjectionMode)_ptr->getProjectionMode();
122 set_flag(PhysxRevoluteJointFlag flag,
bool value) {
124 nassertv( _error_type == ET_ok );
125 NxU32 flags = _ptr->getFlags();
134 _ptr->setFlags(flags);
143 nassertr(_error_type == ET_ok,
false);
144 return (_ptr->getFlags() & flag) ?
true :
false;
171 nassertv(_error_type == ET_ok);
172 _ptr->setSpring(spring._desc);
202 nassertv(_error_type == ET_ok);
203 _ptr->setMotor(motor._desc);
231 nassertv(_error_type == ET_ok);
233 NxJointLimitPairDesc limits;
234 limits.low = low._desc;
235 limits.high = high._desc;
236 _ptr->setLimits(limits);
248 _ptr->getMotor(value._desc);
261 _ptr->getSpring(value._desc);
Descriptor class for distance joint.
void set_flag(PhysxRevoluteJointFlag flag, bool value)
Sets or clears a single RevoluteJointFlag.
void load_from_desc(const PhysxRevoluteJointDesc &jointDesc)
Loads the entire state of the joint from a descriptor with a single call.
float get_velocity() const
Retrieves the revolute joint angle's rate of change (angular velocity).
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
Describes a joint spring.
A scene is a collection of bodies, constraints, and effectors which can interact.
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
void save_to_desc(PhysxRevoluteJointDesc &jointDesc) const
Saves the state of the joint object to a descriptor.
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 set_spring(const PhysxSpringDesc &spring)
Sets spring parameters.
bool get_flag(PhysxRevoluteJointFlag flag) const
Returns the value of a single RevoluteJointFlag.
void set_name(const char *name)
Sets a name string for this object.
float get_angle() const
Retrieves the current revolute joint angle.
TypeHandle is the identifier used to differentiate C++ class types.
void set_motor(const PhysxMotorDesc &motor)
Sets motor parameters for the joint.
void set_projection_mode(PhysxProjectionMode mode)
Sets the joint projection mode.
void set_limits(const PhysxJointLimitDesc &low, const PhysxJointLimitDesc &high)
Sets angular joint limits.
PhysxProjectionMode get_projection_mode() const
Retrieves the joints projection mode.