16 #include "datagramIterator.h" 17 #include "bamReader.h" 18 #include "bamWriter.h" 20 #include "linearForce.h" 30 LinearForce(PN_stdfloat a,
bool mass) :
32 _amplitude(a), _mass_dependent(mass),
33 _x_mask(true), _y_mask(true), _z_mask(true) {
44 _amplitude = copy._amplitude;
45 _mass_dependent = copy._mass_dependent;
46 _x_mask = copy._x_mask;
47 _y_mask = copy._y_mask;
48 _z_mask = copy._z_mask;
66 LVector3 child_vector = get_child_vector(po) * _amplitude;
70 child_vector[0] = 0.0f;
73 child_vector[1] = 0.0f;
76 child_vector[2] = 0.0f;
99 out<<
"LinearForce (id "<<
this<<
")";
110 write(ostream &out,
unsigned int indent)
const {
112 out.width(indent); out<<
""; out<<
"LinearForce (id "<<
this<<
")\n";
113 out.width(indent+2); out<<
""; out<<
"_amplitude "<<_amplitude<<
"\n";
114 out.width(indent+2); out<<
""; out<<
"_mass_dependent "<<_mass_dependent<<
"\n";
115 out.width(indent+2); out<<
""; out<<
"_x_mask "<<_x_mask<<
"\n";
116 out.width(indent+2); out<<
""; out<<
"_y_mask "<<_y_mask<<
"\n";
117 out.width(indent+2); out<<
""; out<<
"_z_mask "<<_z_mask<<
"\n";
~LinearForce()
Destructor.
virtual void write(ostream &out, int indent_level=0) const
Write a string representation of this instance to <out>.
A body on which physics will be applied.
static const LVector3f & zero()
Returns a zero-length vector.
This is a three-component vector distance (as opposed to a three-component point, which represents a ...
bool is_nan() const
Returns true if any component of the vector is not-a-number, false otherwise.
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(ostream &out, unsigned int indent=0) const
Write a string representation of this instance to <out>.
TypeHandle is the identifier used to differentiate C++ class types.
virtual void output(ostream &out) const
Write a string representation of this instance to <out>.