23 _name = name ? name :
"";
24 ptr()->name = _name.c_str();
33 ptr()->maxForce = force;
43 ptr()->maxTorque = torque;
52 ptr()->solverExtrapolationFactor = factor;
61 nassertv_always(idx < 2);
62 ptr()->actor[idx] = actor.ptr();
72 nassertv_always(idx < 2);
83 nassertv_always(idx < 2);
94 nassertv_always(idx < 2);
105 ptr()->jointFlags |= flag;
108 ptr()->jointFlags &= ~(flag);
133 const char *PhysxJointDesc::
142 float PhysxJointDesc::
143 get_max_force()
const {
145 return ptr()->maxForce;
151 float PhysxJointDesc::
152 get_max_torque()
const {
154 return ptr()->maxTorque;
160 float PhysxJointDesc::
161 get_solver_extrapolation_factor()
const {
163 return ptr()->solverExtrapolationFactor;
169 LVector3f PhysxJointDesc::
170 get_local_normal(
unsigned int idx)
const {
172 nassertr_always(idx < 2, LVector3f::zero());
179 LVector3f PhysxJointDesc::
180 get_local_axis(
unsigned int idx)
const {
182 nassertr_always(idx < 2, LVector3f::zero());
189 LPoint3f PhysxJointDesc::
190 get_local_anchor(
unsigned int idx)
const {
192 nassertr_always(idx < 2, LPoint3f::zero());
199 bool PhysxJointDesc::
200 get_joint_flag(
const PhysxJointFlag flag)
const {
202 return (ptr()->jointFlags & flag) ? true :
false;
209 get_actor(
unsigned int idx)
const {
211 nassertr_always(idx < 2,
nullptr);
213 NxActor *actorPtr = ptr()->actor[idx];
214 if (actorPtr ==
nullptr) {
void set_global_axis(const LVector3f &axis)
Set the local axis/normal using a world space axis.
void set_local_anchor(unsigned int idx, const LPoint3f &anchor)
Set the attachment point of joint in actor[i]'s space.
void set_local_axis(unsigned int idx, const LVector3f &axis)
Set the Z axis of joint space, in actor[i]'s space.
static NxVec3 point3_to_nxVec3(const LPoint3f &p)
Converts from LPoint3f to NxVec3.
void set_joint_flag(PhysxJointFlag flag, bool value)
Set or clear a single JointFlag.
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
void set_max_torque(float torque)
Set the maximum angular force (torque) that the joint can withstand before breaking,...
static NxVec3 vec3_to_nxVec3(const LVector3f &v)
Converts from LVector3f to NxVec3.
static LVector3f nxVec3_to_vec3(const NxVec3 &v)
Converts from NxVec3 to LVector3f.
void set_name(const char *name)
Sets a possible debug name.
Actors are the main simulation objects.
void set_actor(unsigned int idx, const PhysxActor &actor)
Set the two actors connected by the joint.
static LPoint3f nxVec3_to_point3(const NxVec3 &p)
Converts from NxVec3 to LPoint3f.
void set_global_anchor(const LPoint3f &anchor)
Set the anchor using a world space point.
void set_local_normal(unsigned int idx, const LVector3f &normal)
Set the X axis of joint space, in actor[i]'s space, orthogonal to localAxis[i].
void set_solver_extrapolation_factor(float factor)
Set the extrapolation factor for solving joint constraints.
void set_max_force(float force)
Set a possible debug name.
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.