taoCNode.h

Go to the documentation of this file.
00001 /* Copyright (c) 2005 Arachi, Inc. and Stanford University.
00002  *
00003  * Permission is hereby granted, free of charge, to any person obtaining
00004  * a copy of this software and associated documentation files (the
00005  * "Software"), to deal in the Software without restriction, including
00006  * without limitation the rights to use, copy, modify, merge, publish,
00007  * distribute, sublicense, and/or sell copies of the Software, and to
00008  * permit persons to whom the Software is furnished to do so, subject
00009  * to the following conditions:
00010  *
00011  * The above copyright notice and this permission notice shall be included
00012  * in all copies or substantial portions of the Software.
00013  *
00014  * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
00015  * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
00016  * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
00017  * IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
00018  * CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
00019  * TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
00020  * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
00021  */
00022 
00023 #ifndef _taoCNode_h
00024 #define _taoCNode_h
00025 
00026 #include "deTypes.h"
00027 
00028 class deVector3;
00029 class deFrame;
00030 
00038 class taoCNode
00039 {
00040 public:
00041         taoCNode() : _id(-1), _isFixed(0), _cor(0), _cofg(0), _cofv(0), _cofs(0), _cofd(0) {}
00042         virtual ~taoCNode() {}
00043 
00045 
00049         virtual deFrame* frameGlobal() = 0;
00051 
00057         virtual void getFrameGraphics(deFrame* Fg) = 0;
00058 
00059         virtual void setID(const deInt id) { _id = id; }
00060         virtual deInt getID() { return _id; }
00061 
00062         virtual void setIsFixed(const deInt f) { _isFixed = f; }
00063         virtual deInt getIsFixed() { return _isFixed; }
00064 
00065         virtual deFloat getCOR() { return _cor; }
00066         virtual deFloat getCOF_grip() { return _cofg; }
00067         virtual deFloat getCOF_viscous() { return _cofv; }
00068         virtual deFloat getCOF_static() { return _cofs; }
00069         virtual deFloat getCOF_dynamic() { return _cofd; }
00070 
00072         virtual void setCOR(deFloat c) { _cor = c; }
00078 
00079         virtual void setCOF_grip(deFloat c) { _cofg = c; }
00081         virtual void setCOF_viscous(deFloat c) { _cofv = c; }
00083         virtual void setCOF_static(deFloat c) { _cofs = c; }
00085         virtual void setCOF_dynamic(deFloat c) { _cofd = c; }
00086 
00087         virtual deFloat effectiveMass(const deVector3* Pie, const deVector3* Ui) { return 0; }
00088         virtual void linearVelocity(deVector3* Vie, const deVector3* Pie) {}
00089         virtual void linearAcceleration(deVector3* Aie, const deVector3* Pie) {}
00091 
00100         virtual void impulse(const deVector3* Pie, const deVector3* Yie) {}
00102 
00108         virtual void impulseDist(const deVector3* Pie, const deVector3* Yie) {}
00110 
00120         virtual void force(const deVector3* Pie, const deVector3* Fie) {}
00122 
00133         virtual deInt impact1(const deVector3* Pie, const deVector3* Ui, const deFloat cor2, const deFloat cofg2);
00135 
00142         virtual deInt impact2(taoCNode* ni, const deVector3* Pie, const deVector3* Ui,
00143                                                         taoCNode* nj, const deVector3* Pje, const deVector3* Uj);
00145 
00152         virtual deInt penetration1(const deVector3* Pie, const deVector3* Ui, const deVector3* pdist, const deFloat dt);
00153 
00154 private:
00155         deInt _id;
00156         deInt _isFixed;
00157 
00158         deFloat _cor;
00159         deFloat _cofg;
00160         deFloat _cofv;
00161         deFloat _cofs;
00162         deFloat _cofd;
00163 
00164         deInt _Impact1(const deVector3* Pie, const deVector3* Ui, const deVector3* V, const deFloat m, const deFloat vp, const deFloat vm, const deFloat cofg2);
00165         void _Friction(const deVector3* Pie, const deVector3* Ui, const deVector3* Ut, const deFloat vtmag, const deFloat m);
00166 };
00167 
00168 #endif // _taoCNode_h

Generated on Sun Apr 9 22:12:43 2006 for TAO by  doxygen 1.4.6-NO