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 _taoDNode_h 00024 #define _taoDNode_h 00025 00026 #include "taoTypes.h" 00027 #include "taoCNode.h" 00028 00029 class taoABNode; 00030 class taoJoint; 00031 class deVector3; 00032 class deVector6; 00033 class deFrame; 00034 class deMatrix3; 00035 00042 class taoDNode : public taoCNode 00043 { 00044 public: 00045 taoDNode() : _abNode(NULL), _propagate(1) {} 00046 virtual ~taoDNode() {} 00047 virtual void sync(deFrame* local) = 0; 00049 00052 virtual deInt isRoot() { return (getDParent() == NULL); } 00054 00057 virtual deInt isParentRoot() { return (isRoot() || getDParent()->isRoot()); } 00058 00059 virtual taoJoint* getJointList() = 0; 00060 00062 virtual taoABNode* getABNode() { return _abNode; } 00064 virtual void setABNode(taoABNode* node) { _abNode = node; } 00065 00067 00070 virtual deInt getPropagate() { return _propagate; } 00071 virtual void setPropagate(deInt p) { _propagate = p; } // YYY 00072 00073 virtual deVector6* velocity() = 0; 00074 virtual deVector6* acceleration() = 0; 00075 00077 virtual deFrame* frameHome() = 0; 00079 virtual deFrame* frameLocal() = 0; 00081 //virtual deFrame* frameGlobal() = 0; 00083 virtual deFloat* mass() = 0; 00085 virtual deVector3* center() = 0; 00087 virtual deMatrix3* inertia() = 0; 00089 virtual deVector6* force() = 0; 00090 virtual void zeroForce() = 0; 00091 virtual void addForce(const deVector6* f) = 0; 00092 00093 virtual void updateFrame() = 0; 00094 virtual void integrate(deFloat dt) = 0; 00095 00097 virtual taoDNode* getDParent() = 0; 00098 virtual void setDChild(taoDNode* n) = 0; 00100 virtual taoDNode* getDChild() = 0; 00102 virtual taoDNode* getDSibling() = 0; 00103 00104 private: 00105 taoABNode* _abNode; 00106 deInt _propagate; 00107 }; 00108 00109 #endif // _taoDNode_h