24 _linear_forces.erase(_linear_forces.begin(),
25 _linear_forces.end());
35 _angular_forces.erase(_angular_forces.begin(),
36 _angular_forces.end());
46 _physics_objects.erase(_physics_objects.begin(),
47 _physics_objects.end());
57 _linear_forces.push_back(f);
67 _angular_forces.push_back(f);
77 LinearForceVector::iterator found;
82 found = find(_linear_forces.begin(), _linear_forces.end(), pt_lf);
84 if (found == _linear_forces.end())
87 _linear_forces.erase(found);
97 AngularForceVector::iterator found;
100 found = find(_angular_forces.begin(), _angular_forces.end(), pt_af);
102 if (found == _angular_forces.end())
105 _angular_forces.erase(found);
115 _physics_objects.push_back(po);
123 get_physics_manager()
const {
124 return _physics_manager;
132 get_phys_body()
const {
141 get_physical_node()
const {
142 return _physical_node;
150 get_physical_node_path()
const {
159 get_object_vector()
const {
160 return _physics_objects;
168 get_linear_forces()
const {
169 return _linear_forces;
177 get_angular_forces()
const {
178 return _angular_forces;
185 INLINE
int Physical::
186 get_num_linear_forces()
const {
187 return _linear_forces.size();
195 get_linear_force(
int index)
const {
196 nassertr(index >= 0 && index < (
int)_linear_forces.size(), NULL);
197 return _linear_forces[index];
204 INLINE
int Physical::
205 get_num_angular_forces()
const {
206 return _angular_forces.size();
214 get_angular_force(
int index)
const {
215 nassertr(index >= 0 && index < (
int)_angular_forces.size(), NULL);
216 return _angular_forces[index];
224 INLINE
void Physical::
225 set_viscosity(PN_stdfloat viscosity) {
226 _viscosity=viscosity;
void remove_angular_force(AngularForce *f)
removes an angular force from the force list
A basic node of the scene graph or data graph.
A body on which physics will be applied.
PN_stdfloat get_viscosity() const
Get the local viscosity.
void clear_physics_objects()
Erases the object list.
A force that acts on a PhysicsObject by way of an Integrator.
Graph node that encapsulated a series of physical objects.
Physics don't get much higher-level than this.
void add_linear_force(LinearForce *f)
Adds a linear force to the force list.
void add_angular_force(AngularForce *f)
Adds an angular force to the force list.
pure virtual parent of all quat-based forces.
void remove_linear_force(LinearForce *f)
removes a linear force from the force list
void add_physics_object(PhysicsObject *po)
Adds an object to the physics object vector.
NodePath is the fundamental system for disambiguating instances, and also provides a higher-level int...
void clear_angular_forces()
Erases the angular force list.
void clear_linear_forces()
Erases the linear force list.