Panda3D
 All Classes Functions Variables Enumerations
odeMass.cxx
1 // Filename: odeMass.cxx
2 // Created by: joswilso (27Dec06)
3 //
4 ////////////////////////////////////////////////////////////////////
5 //
6 // PANDA 3D SOFTWARE
7 // Copyright (c) Carnegie Mellon University. All rights reserved.
8 //
9 // All use of this software is subject to the terms of the revised BSD
10 // license. You should have received a copy of this license along
11 // with this source code in a file named "LICENSE."
12 //
13 ////////////////////////////////////////////////////////////////////
14 
15 #include "config_ode.h"
16 #include "odeMass.h"
17 
18 TypeHandle OdeMass::_type_handle;
19 
20 OdeMass::
21 OdeMass() :
22  _mass() {
23  dMassSetZero(&_mass);
24 }
25 
26 OdeMass::
27 OdeMass(const OdeMass &copy) :
28  _mass() {
29  _mass.setParameters(copy._mass.mass,
30  copy._mass.c[0], copy._mass.c[1], copy._mass.c[2],
31  copy._mass.I[0], copy._mass.I[5], copy._mass.I[10],
32  copy._mass.I[1], copy._mass.I[2], copy._mass.I[4]);
33 }
34 
35 OdeMass::
36 ~OdeMass() {
37 }
38 
39 dMass* OdeMass::
40 get_mass_ptr() {
41  return &_mass;
42 }
43 
44 void OdeMass::
45 operator = (const OdeMass &copy) {
46  _mass.setParameters(copy._mass.mass,
47  copy._mass.c[0], copy._mass.c[1], copy._mass.c[2],
48  copy._mass.I[0], copy._mass.I[5], copy._mass.I[10],
49  copy._mass.I[1], copy._mass.I[2], copy._mass.I[4]);
50 
51 }
52 
53 
54 void OdeMass::
55 write(ostream &out, unsigned int indent) const {
56  out.width(indent);
57  out << get_type() \
58  << "(mag = " << get_magnitude() \
59  << ", center = " << get_center() \
60  << ", inertia = " << get_inertial_tensor() \
61  << ")";
62 }
TypeHandle is the identifier used to differentiate C++ class types.
Definition: typeHandle.h:85