15 #include "physxSphereForceFieldShape.h"
16 #include "physxSphereForceFieldShapeDesc.h"
18 TypeHandle PhysxSphereForceFieldShape::_type_handle;
25 void PhysxSphereForceFieldShape::
26 link(NxForceFieldShape *shapePtr) {
28 _ptr = shapePtr->isSphere();
29 _ptr->userData =
this;
35 group->_shapes.add(
this);
43 void PhysxSphereForceFieldShape::
46 _ptr->userData = NULL;
47 _error_type = ET_released;
50 group->_shapes.remove(
this);
62 nassertv(_error_type == ET_ok);
63 _ptr->saveToDesc(shapeDesc._desc);
74 nassertv(_error_type == ET_ok);
75 _ptr->setRadius(radius);
86 nassertr(_error_type == ET_ok, 0.0f);
87 return _ptr->getRadius();
float get_radius() const
Returns the radius of the sphere.
void set_name(const char *name)
Sets a name string for this object.
void set_radius(float radius)
Sets the sphere radius.
A descriptor for a sphere force field shape.
TypeHandle is the identifier used to differentiate C++ class types.
void save_to_desc(PhysxSphereForceFieldShapeDesc &shapeDesc) const
Saves the state of the shape object to a descriptor.