Panda3D

odeMass.cxx

00001 // Filename: odeMass.cxx
00002 // Created by:  joswilso (27Dec06)
00003 //
00004 ////////////////////////////////////////////////////////////////////
00005 //
00006 // PANDA 3D SOFTWARE
00007 // Copyright (c) Carnegie Mellon University.  All rights reserved.
00008 //
00009 // All use of this software is subject to the terms of the revised BSD
00010 // license.  You should have received a copy of this license along
00011 // with this source code in a file named "LICENSE."
00012 //
00013 ////////////////////////////////////////////////////////////////////
00014 
00015 #include "config_ode.h"
00016 #include "odeMass.h"
00017 
00018 TypeHandle OdeMass::_type_handle;
00019 
00020 OdeMass::
00021 OdeMass() : 
00022   _mass() {
00023   dMassSetZero(&_mass);
00024 }
00025 
00026 OdeMass::
00027 OdeMass(const OdeMass &copy) : 
00028   _mass() {
00029   _mass.setParameters(copy._mass.mass, 
00030                       copy._mass.c[0], copy._mass.c[1], copy._mass.c[2],
00031                       copy._mass.I[0], copy._mass.I[5], copy._mass.I[10],
00032                       copy._mass.I[1], copy._mass.I[2], copy._mass.I[4]);
00033 }
00034 
00035 OdeMass::
00036 ~OdeMass() {
00037 }
00038 
00039 dMass* OdeMass::
00040 get_mass_ptr() {
00041   return &_mass;
00042 }
00043 
00044 void OdeMass::
00045 operator = (const OdeMass &copy) {
00046   _mass.setParameters(copy._mass.mass, 
00047                       copy._mass.c[0], copy._mass.c[1], copy._mass.c[2],
00048                       copy._mass.I[0], copy._mass.I[5], copy._mass.I[10],
00049                       copy._mass.I[1], copy._mass.I[2], copy._mass.I[4]);
00050 
00051 }
00052 
00053 
00054 void OdeMass::
00055 write(ostream &out, unsigned int indent) const {
00056   out.width(indent); 
00057   out << get_type() \
00058       << "(mag = " << get_magnitude() \
00059       << ", center = " << get_center() \
00060       << ", inertia = " << get_inertial_tensor() \
00061       << ")";
00062 }
 All Classes Functions Variables Enumerations