15 #include "physxForceField.h" 16 #include "physxForceFieldDesc.h" 17 #include "physxForceFieldShapeGroup.h" 18 #include "physxScene.h" 27 void PhysxForceField::
28 link(NxForceField *fieldPtr) {
32 _ptr->userData =
this;
35 set_name(fieldPtr->getName());
38 scene->_forcefields.add(
this);
42 group->link(&(_ptr->getIncludeShapeGroup()));
50 void PhysxForceField::
58 _ptr->userData = NULL;
59 _error_type = ET_released;
62 scene->_forcefields.remove(
this);
70 void PhysxForceField::
73 nassertv(_error_type == ET_ok);
76 _ptr->getScene().releaseForceField(*_ptr);
85 void PhysxForceField::
86 set_name(
const char *name) {
88 nassertv(_error_type == ET_ok);
90 _name = name ? name :
"";
91 _ptr->setName(_name.c_str());
99 const char *PhysxForceField::
102 nassertr(_error_type == ET_ok,
"");
103 return _ptr->getName();
114 nassertr(_error_type == ET_ok, NULL);
115 return (
PhysxScene *)(_ptr->getScene().userData);
124 get_include_shape_group()
const {
126 nassertr(_error_type == ET_ok, NULL);
135 unsigned int PhysxForceField::
136 get_num_shape_groups()
const {
138 nassertr(_error_type == ET_ok, 0);
139 return _ptr->getNbShapeGroups();
148 get_shape_group(
unsigned int idx)
const {
150 nassertr(_error_type == ET_ok, NULL);
151 nassertr_always(idx < _ptr->getNbShapeGroups(), NULL);
153 NxForceFieldShapeGroup *groupPtr;
154 NxU32 nGroups = _ptr->getNbShapeGroups();
156 _ptr->resetShapeGroupsIterator();
157 for (NxU32 i=0; i <= idx; i++) {
158 groupPtr = _ptr->getNextShapeGroup();
A scene is a collection of bodies, constraints, and effectors which can interact. ...
TypeHandle is the identifier used to differentiate C++ class types.