27LinearForce(PN_stdfloat a,
bool mass) :
29 _amplitude(a), _mass_dependent(mass),
30 _x_mask(true), _y_mask(true), _z_mask(true) {
39 _amplitude = copy._amplitude;
40 _mass_dependent = copy._mass_dependent;
41 _x_mask = copy._x_mask;
42 _y_mask = copy._y_mask;
43 _z_mask = copy._z_mask;
58 LVector3 child_vector = get_child_vector(po) * _amplitude;
59 nassertr(!child_vector.is_nan(), LVector3::zero());
62 child_vector[0] = 0.0f;
65 child_vector[1] = 0.0f;
68 child_vector[2] = 0.0f;
85output(std::ostream &out)
const {
87 out<<
"LinearForce (id "<<
this<<
")";
97 out.width(
indent); out<<
""; out<<
"LinearForce (id "<<
this<<
")\n";
98 out.width(
indent+2); out<<
""; out<<
"_amplitude "<<_amplitude<<
"\n";
99 out.width(
indent+2); out<<
""; out<<
"_mass_dependent "<<_mass_dependent<<
"\n";
100 out.width(
indent+2); out<<
""; out<<
"_x_mask "<<_x_mask<<
"\n";
101 out.width(
indent+2); out<<
""; out<<
"_y_mask "<<_y_mask<<
"\n";
102 out.width(
indent+2); out<<
""; out<<
"_z_mask "<<_z_mask<<
"\n";
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
pure virtual base class for all forces that could POSSIBLY exist.
virtual void write(std::ostream &out, int indent_level=0) const
Write a string representation of this instance to <out>.
A force that acts on a PhysicsObject by way of an Integrator.
~LinearForce()
Destructor.
virtual void write(std::ostream &out, int indent=0) const
Write a string representation of this instance to <out>.
virtual void output(std::ostream &out) const
Write a string representation of this instance to <out>.
A body on which physics will be applied.
TypeHandle is the identifier used to differentiate C++ class types.
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
std::ostream & indent(std::ostream &out, int indent_level)
A handy function for doing text formatting.
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.