37 nassertv(_error_type == ET_ok);
40 ptr()->getScene().releaseJoint(*ptr());
47factory(NxJointType shapeType) {
51 case NX_JOINT_PRISMATIC:
52 return new PhysxPrismaticJoint();
54 case NX_JOINT_REVOLUTE:
55 return new PhysxRevoluteJoint();
57 case NX_JOINT_CYLINDRICAL:
58 return new PhysxCylindricalJoint();
60 case NX_JOINT_SPHERICAL:
61 return new PhysxSphericalJoint();
63 case NX_JOINT_POINT_ON_LINE:
64 return new PhysxPointOnLineJoint();
66 case NX_JOINT_POINT_IN_PLANE:
67 return new PhysxPointInPlaneJoint();
69 case NX_JOINT_DISTANCE:
70 return new PhysxDistanceJoint();
73 return new PhysxPulleyJoint();
76 return new PhysxFixedJoint();
79 return new PhysxD6Joint();
82 physx_cat.error() <<
"Unknown joint type.\n";
93 nassertv(_error_type == ET_ok);
95 _name = name ? name :
"";
96 ptr()->setName(_name.c_str());
105 nassertr(_error_type == ET_ok,
"");
106 return ptr()->getName();
115 nassertr_always(idx < 2,
nullptr);
116 nassertr(_error_type == ET_ok,
nullptr);
118 NxActor *actorPtr[2];
119 ptr()->getActors(&actorPtr[0], &actorPtr[1]);
120 return (
PhysxActor *)(actorPtr[idx]->userData);
129 nassertr(_error_type == ET_ok,
nullptr);
130 return (
PhysxScene *)(ptr()->getScene().userData);
140 nassertv(_error_type == ET_ok);
150 nassertr(_error_type == ET_ok, LPoint3f::zero());
161 nassertv(_error_type == ET_ok);
171 nassertr(_error_type == ET_ok, LVector3f::zero());
200 nassertv(_error_type == ET_ok);
201 ptr()->setBreakable(maxForce, maxTorque);
210 nassertv(_error_type == ET_ok);
211 ptr()->setUseAccelerationSpring(value);
220 nassertr(_error_type == ET_ok,
false);
221 return ptr()->getUseAccelerationSpring();
230 nassertv(_error_type == ET_ok);
231 ptr()->setSolverExtrapolationFactor(factor);
240 nassertr(_error_type == ET_ok,
false);
241 return ptr()->getSolverExtrapolationFactor();
264 nassertv(_error_type == ET_ok);
278add_limit_plane(
const LVector3f &normal,
const LPoint3f &pointInPlane,
float restitution) {
280 nassertv(_error_type == ET_ok);
292 nassertv(_error_type == ET_ok);
293 ptr()->purgeLimitPlanes();
Actors are the main simulation objects.
Abstract base class for the different types of joints.
PhysxActor * get_actor(unsigned int idx) const
Retrieves the actor which this joint is associated with.
void add_limit_plane(const LVector3f &normal, const LPoint3f &pointInPlane, float restitution=0.0f)
Adds a limit plane.
const char * get_name() const
Returns the name string.
float get_solver_extrapolation_factor() const
Retrieves the solver extrapolation factor.
void purge_limit_planes()
Deletes all limit planes added to the joint.
PhysxScene * get_scene() const
Retrieves the scene which this joint is associated with.
void set_limit_point(const LPoint3f &pos, bool isOnActor2=true)
Sets the limit point.
void set_name(const char *name)
Sets a name string for this object.
void set_use_acceleration_spring(bool value)
Switch between acceleration and force based spring.
void set_global_anchor(const LPoint3f &anchor)
Sets the point where the two actors are attached, specified in global coordinates.
void set_breakable(float maxForce, float maxTorque)
Sets the maximum force magnitude that the joint is able to withstand without breaking.
void set_global_axis(const LVector3f &axis)
Sets the direction of the joint's primary axis, specified in global coordinates.
void set_solver_extrapolation_factor(float factor)
Sets the solver extrapolation factor.
LPoint3f get_global_anchor() const
Retrieves the joint anchor.
LVector3f get_global_axis() const
Retrieves the joint axis.
bool get_use_acceleration_spring() const
Checks whether acceleration spring is used.
static NxVec3 vec3_to_nxVec3(const LVector3f &v)
Converts from LVector3f to NxVec3.
static NxVec3 point3_to_nxVec3(const LPoint3f &p)
Converts from LPoint3f to NxVec3.
static LPoint3f nxVec3_to_point3(const NxVec3 &p)
Converts from NxVec3 to LPoint3f.
static LVector3f nxVec3_to_vec3(const NxVec3 &v)
Converts from NxVec3 to LVector3f.
A scene is a collection of bodies, constraints, and effectors which can interact.
TypeHandle is the identifier used to differentiate C++ class types.
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.