Panda3D
|
00001 // Filename: angularVectorForce.cxx 00002 // Created by: charles (09Aug00) 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 "angularVectorForce.h" 00016 00017 TypeHandle AngularVectorForce::_type_handle; 00018 00019 //////////////////////////////////////////////////////////////////// 00020 // Function : AngularVectorForce 00021 // Access : public 00022 // Description : constructor 00023 //////////////////////////////////////////////////////////////////// 00024 AngularVectorForce:: 00025 AngularVectorForce(const LRotation &vec) : 00026 AngularForce(), _fvec(vec) { 00027 } 00028 00029 //////////////////////////////////////////////////////////////////// 00030 // Function : AngularVectorForce 00031 // Access : public 00032 // Description : constructor 00033 //////////////////////////////////////////////////////////////////// 00034 AngularVectorForce:: 00035 AngularVectorForce(PN_stdfloat h, PN_stdfloat p, PN_stdfloat r) : 00036 AngularForce() { 00037 _fvec.set_hpr(LVecBase3(h, p, r)); 00038 } 00039 00040 //////////////////////////////////////////////////////////////////// 00041 // Function : AngularVectorForce 00042 // Access : public 00043 // Description : copy constructor 00044 //////////////////////////////////////////////////////////////////// 00045 AngularVectorForce:: 00046 AngularVectorForce(const AngularVectorForce ©) : 00047 AngularForce(copy) { 00048 _fvec = copy._fvec; 00049 } 00050 00051 //////////////////////////////////////////////////////////////////// 00052 // Function : ~AngularVectorForce 00053 // Access : public, virtual 00054 // Description : destructor 00055 //////////////////////////////////////////////////////////////////// 00056 AngularVectorForce:: 00057 ~AngularVectorForce() { 00058 } 00059 00060 //////////////////////////////////////////////////////////////////// 00061 // Function : make_copy 00062 // Access : private, virtual 00063 // Description : dynamic copier 00064 //////////////////////////////////////////////////////////////////// 00065 AngularForce *AngularVectorForce:: 00066 make_copy() const { 00067 return new AngularVectorForce(*this); 00068 } 00069 00070 //////////////////////////////////////////////////////////////////// 00071 // Function : get_child_quat 00072 // Access : private, virtual 00073 // Description : query 00074 //////////////////////////////////////////////////////////////////// 00075 LRotation AngularVectorForce:: 00076 get_child_quat(const PhysicsObject *) { 00077 return _fvec; 00078 } 00079 00080 //////////////////////////////////////////////////////////////////// 00081 // Function : output 00082 // Access : Public 00083 // Description : Write a string representation of this instance to 00084 // <out>. 00085 //////////////////////////////////////////////////////////////////// 00086 void AngularVectorForce:: 00087 output(ostream &out) const { 00088 #ifndef NDEBUG //[ 00089 out<<"AngularVectorForce"; 00090 #endif //] NDEBUG 00091 } 00092 00093 //////////////////////////////////////////////////////////////////// 00094 // Function : write 00095 // Access : Public 00096 // Description : Write a string representation of this instance to 00097 // <out>. 00098 //////////////////////////////////////////////////////////////////// 00099 void AngularVectorForce:: 00100 write(ostream &out, unsigned int indent) const { 00101 #ifndef NDEBUG //[ 00102 out.width(indent); out<<""; out<<"AngularVectorForce:\n"; 00103 out.width(indent+2); out<<""; out<<"_fvec "<<_fvec<<"\n"; 00104 AngularForce::write(out, indent+2); 00105 #endif //] NDEBUG 00106 }