15 #include "physxForceFieldShape.h" 16 #include "physxForceFieldShapeGroup.h" 17 #include "physxForceField.h" 18 #include "physxBoxForceFieldShape.h" 19 #include "physxCapsuleForceFieldShape.h" 20 #include "physxSphereForceFieldShape.h" 21 #include "physxConvexForceFieldShape.h" 22 #include "physxManager.h" 31 void PhysxForceFieldShape::
34 nassertv(_error_type == ET_ok);
37 ptr()->getShapeGroup().releaseShape(*ptr());
46 factory(NxShapeType shapeType) {
56 case NX_SHAPE_CAPSULE:
63 physx_cat.error() <<
"Unknown shape type.\n";
76 nassertr(_error_type == ET_ok, NULL);
78 NxForceField *fieldPtr = ptr()->getForceField();
79 if (fieldPtr == NULL) {
93 nassertr(_error_type == ET_ok, NULL);
106 nassertv(_error_type == ET_ok);
108 _name = name ? name :
"";
109 ptr()->setName(_name.c_str());
120 nassertr(_error_type == ET_ok,
"");
121 return ptr()->getName();
132 nassertv(_error_type == ET_ok);
158 nassertv(_error_type == ET_ok);
160 NxMat34 pose = ptr()->getPose();
162 ptr()->setPose(pose);
LMatrix4f get_mat() const
Returns the force field shape's transform.
void set_mat(const LMatrix4f &mat)
Sets the force field shape's transform.
A convex shaped region used to define force field.
static const LPoint3f & zero()
Returns a zero-length point.
static NxVec3 point3_to_nxVec3(const LPoint3f &p)
Converts from LPoint3f to NxVec3.
This is a three-component point in space (as opposed to a three-component vector, which represents a ...
PhysxForceFieldShapeGroup * get_shape_group() const
Returns the owning force field shape group.
const char * get_name() const
Returns the name string.
static NxMat34 mat4_to_nxMat34(const LMatrix4f &m)
Converts from LMatrix4f to NxMat34.
PhysxForceField * get_force_field() const
Returns the owning force field if this is a shape of an include group, else NULL will be returned...
void set_name(const char *name)
Sets a name string for this object.
Abstract base class for force field shapes.
void set_pos(const LPoint3f &pos)
Sets the force field shape's translation.
This is a 4-by-4 transform matrix.
static const LMatrix4f & zeros_mat()
Returns an matrix filled with zeros.
A box shaped region used to define a force field.
static LPoint3f nxVec3_to_point3(const NxVec3 &p)
Converts from NxVec3 to LPoint3f.
A spherical force field shape.
A capsule shaped region used to define a force field.
TypeHandle is the identifier used to differentiate C++ class types.
static LMatrix4f nxMat34_to_mat4(const NxMat34 &m)
Converts from NxMat34 to LMatrix4f.
LPoint3f get_pos() const
Returns the force field shape's translation.