24 void PhysxForceField::
25 link(NxForceField *fieldPtr) {
29 _ptr->userData =
this;
32 set_name(fieldPtr->getName());
35 scene->_forcefields.add(
this);
39 group->link(&(_ptr->getIncludeShapeGroup()));
45 void PhysxForceField::
53 _ptr->userData =
nullptr;
54 _error_type = ET_released;
57 scene->_forcefields.remove(
this);
63 void PhysxForceField::
66 nassertv(_error_type == ET_ok);
69 _ptr->getScene().releaseForceField(*_ptr);
76 void PhysxForceField::
77 set_name(
const char *name) {
79 nassertv(_error_type == ET_ok);
81 _name = name ? name :
"";
82 _ptr->setName(_name.c_str());
88 const char *PhysxForceField::
91 nassertr(_error_type == ET_ok,
"");
92 return _ptr->getName();
101 nassertr(_error_type == ET_ok,
nullptr);
102 return (
PhysxScene *)(_ptr->getScene().userData);
109 get_include_shape_group()
const {
111 nassertr(_error_type == ET_ok,
nullptr);
118 unsigned int PhysxForceField::
119 get_num_shape_groups()
const {
121 nassertr(_error_type == ET_ok, 0);
122 return _ptr->getNbShapeGroups();
129 get_shape_group(
unsigned int idx)
const {
131 nassertr(_error_type == ET_ok,
nullptr);
132 nassertr_always(idx < _ptr->getNbShapeGroups(),
nullptr);
134 NxForceFieldShapeGroup *groupPtr;
135 NxU32 nGroups = _ptr->getNbShapeGroups();
137 _ptr->resetShapeGroupsIterator();
138 for (NxU32 i=0; i <= idx; i++) {
139 groupPtr = _ptr->getNextShapeGroup();
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.
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
TypeHandle is the identifier used to differentiate C++ class types.
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.