28 void PhysxForceFieldShape::
31 nassertv(_error_type == ET_ok);
34 ptr()->getShapeGroup().releaseShape(*ptr());
41 factory(NxShapeType shapeType) {
51 case NX_SHAPE_CAPSULE:
58 physx_cat.error() <<
"Unknown shape type.\n";
69 nassertr(_error_type == ET_ok,
nullptr);
71 NxForceField *fieldPtr = ptr()->getForceField();
72 if (fieldPtr ==
nullptr) {
84 nassertr(_error_type == ET_ok,
nullptr);
95 nassertv(_error_type == ET_ok);
97 _name = name ? name :
"";
98 ptr()->setName(_name.c_str());
107 nassertr(_error_type == ET_ok,
"");
108 return ptr()->getName();
115 set_mat(
const LMatrix4f &mat) {
117 nassertv(_error_type == ET_ok);
128 nassertr(_error_type == ET_ok, LMatrix4f::zeros_mat());
139 nassertv(_error_type == ET_ok);
141 NxMat34 pose = ptr()->getPose();
143 ptr()->setPose(pose);
152 nassertr(_error_type == ET_ok, LPoint3f::zero());
A box shaped region used to define a force field.
A capsule shaped region used to define a force field.
A convex shaped region used to define force field.
Abstract base class for force field shapes.
void set_mat(const LMatrix4f &mat)
Sets the force field shape's transform.
LPoint3f get_pos() const
Returns the force field shape's translation.
PhysxForceField * get_force_field() const
Returns the owning force field if this is a shape of an include group, else NULL will be returned.
const char * get_name() const
Returns the name string.
PhysxForceFieldShapeGroup * get_shape_group() const
Returns the owning force field shape group.
void set_pos(const LPoint3f &pos)
Sets the force field shape's translation.
void set_name(const char *name)
Sets a name string for this object.
LMatrix4f get_mat() const
Returns the force field shape's transform.
static NxVec3 point3_to_nxVec3(const LPoint3f &p)
Converts from LPoint3f to NxVec3.
static NxMat34 mat4_to_nxMat34(const LMatrix4f &m)
Converts from LMatrix4f to NxMat34.
static LPoint3f nxVec3_to_point3(const NxVec3 &p)
Converts from NxVec3 to LPoint3f.
static LMatrix4f nxMat34_to_mat4(const NxMat34 &m)
Converts from NxMat34 to LMatrix4f.
A spherical force field shape.
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.