27 LinearForce(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;
56 LVector3 LinearForce::
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;
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";
~LinearForce()
Destructor.
A body on which physics will be applied.
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
A force that acts on a PhysicsObject by way of an Integrator.
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>.
std::ostream & indent(std::ostream &out, int indent_level)
A handy function for doing text formatting.
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
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>.
TypeHandle is the identifier used to differentiate C++ class types.
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.