15 #include "physxJointDesc.h"
16 #include "physxManager.h"
26 _name = name ? name :
"";
27 ptr()->name = _name.c_str();
38 ptr()->maxForce = force;
51 ptr()->maxTorque = torque;
63 ptr()->solverExtrapolationFactor = factor;
75 nassertv_always(idx < 2);
76 ptr()->actor[idx] = actor.ptr();
89 nassertv_always(idx < 2);
103 nassertv_always(idx < 2);
116 nassertv_always(idx < 2);
129 ptr()->jointFlags |= flag;
132 ptr()->jointFlags &= ~(flag);
163 const char *PhysxJointDesc::
174 float PhysxJointDesc::
175 get_max_force()
const {
177 return ptr()->maxForce;
185 float PhysxJointDesc::
186 get_max_torque()
const {
188 return ptr()->maxTorque;
196 float PhysxJointDesc::
197 get_solver_extrapolation_factor()
const {
199 return ptr()->solverExtrapolationFactor;
208 get_local_normal(
unsigned int idx)
const {
220 get_local_axis(
unsigned int idx)
const {
232 get_local_anchor(
unsigned int idx)
const {
243 bool PhysxJointDesc::
244 get_joint_flag(
const PhysxJointFlag flag)
const {
246 return (ptr()->jointFlags & flag) ?
true :
false;
255 get_actor(
unsigned int idx)
const {
257 nassertr_always(idx < 2, NULL);
259 NxActor *actorPtr = ptr()->actor[idx];
260 if (actorPtr == NULL) {
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 const LPoint3f & zero()
Returns a zero-length point.
static NxVec3 point3_to_nxVec3(const LPoint3f &p)
Converts from LPoint3f to NxVec3.
static const LVector3f & zero()
Returns a zero-length vector.
This is a three-component vector distance (as opposed to a three-component point, which represents a ...
This is a three-component point in space (as opposed to a three-component vector, which represents a ...
void set_joint_flag(PhysxJointFlag flag, bool value)
Set or clear a single JointFlag.
void set_max_torque(float torque)
Set the maximum angular force (torque) that the joint can withstand before breaking, must be positive.
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.