37 nassertv(_error_type == ET_ok);
40 ptr()->getScene().releaseJoint(*ptr());
47 factory(NxJointType shapeType) {
51 case NX_JOINT_PRISMATIC:
54 case NX_JOINT_REVOLUTE:
57 case NX_JOINT_CYLINDRICAL:
60 case NX_JOINT_SPHERICAL:
63 case NX_JOINT_POINT_ON_LINE:
66 case NX_JOINT_POINT_IN_PLANE:
69 case NX_JOINT_DISTANCE:
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);
278 add_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();
LPoint3f get_global_anchor() const
Retrieves the joint anchor.
bool get_use_acceleration_spring() const
Checks whether acceleration spring is used.
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
A point on line joint constrains a point on one body to only move along a line attached to another bo...
PhysxActor * get_actor(unsigned int idx) const
Retrieves the actor which this joint is associated with.
Cylindrical Joints permit relative translational movement between two bodies along an axis,...
void set_use_acceleration_spring(bool value)
Switch between acceleration and force based spring.
A fixed joint permits no relative movement between two bodies.
A pulley joint simulates a rope between two objects passing over two pulleys.
static NxVec3 point3_to_nxVec3(const LPoint3f &p)
Converts from LPoint3f to NxVec3.
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
Abstract base class for the different types of joints.
A distance joint maintains a certain distance between two points on two actors.
void set_limit_point(const LPoint3f &pos, bool isOnActor2=true)
Sets the limit point.
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
A scene is a collection of bodies, constraints, and effectors which can interact.
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
void set_breakable(float maxForce, float maxTorque)
Sets the maximum force magnitude that the joint is able to withstand without breaking.
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
LVector3f get_global_axis() const
Retrieves the joint axis.
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
A D6 joint is a general constraint between two actors.
void set_global_axis(const LVector3f &axis)
Sets the direction of the joint's primary axis, specified in global coordinates.
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.
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
Actors are the main simulation objects.
void purge_limit_planes()
Deletes all limit planes added to the joint.
A prismatic joint permits relative translational movement between two bodies along an axis,...
PhysxScene * get_scene() const
Retrieves the scene which this joint is associated with.
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
static LPoint3f nxVec3_to_point3(const NxVec3 &p)
Converts from NxVec3 to LPoint3f.
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
void set_name(const char *name)
Sets a name string for this object.
float get_solver_extrapolation_factor() const
Retrieves the solver extrapolation factor.
A point in plane joint constrains a point on one body to only move inside a plane attached to another...
A sphere joint constrains two points on two bodies to coincide.
TypeHandle is the identifier used to differentiate C++ class types.
void set_global_anchor(const LPoint3f &anchor)
Sets the point where the two actors are attached, specified in global coordinates.
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
void add_limit_plane(const LVector3f &normal, const LPoint3f &pointInPlane, float restitution=0.0f)
Adds a limit plane.
A joint which behaves in a similar way to a hinge or axel.
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
const char * get_name() const
Returns the name string.
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
void set_solver_extrapolation_factor(float factor)
Sets the solver extrapolation factor.