Panda3D
|
00001 // Filename: cConstrainPosHprInterval.h 00002 // Created by: pratt (10Mar08) 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 #ifndef CCONSTRAINPOSHPRINTERVAL_H 00016 #define CCONSTRAINPOSHPRINTERVAL_H 00017 00018 #include "directbase.h" 00019 #include "cConstraintInterval.h" 00020 #include "nodePath.h" 00021 #include "lvecBase3.h" 00022 #include "lquaternion.h" 00023 00024 //////////////////////////////////////////////////////////////////// 00025 // Class : CConstrainPosHprInterval 00026 // Description : A constraint interval that will constrain the 00027 // position and orientation of one node to the 00028 // position and orientation of another. 00029 //////////////////////////////////////////////////////////////////// 00030 class EXPCL_DIRECT CConstrainPosHprInterval : public CConstraintInterval { 00031 PUBLISHED: 00032 CConstrainPosHprInterval(const string &name, double duration, 00033 const NodePath &node, const NodePath &target, 00034 bool wrt, const LVecBase3 posOffset=LVector3::zero(), 00035 const LVecBase3 hprOffset=LVector3::zero()); 00036 00037 INLINE const NodePath &get_node() const; 00038 INLINE const NodePath &get_target() const; 00039 00040 virtual void priv_step(double t); 00041 virtual void output(ostream &out) const; 00042 00043 private: 00044 NodePath _node; 00045 NodePath _target; 00046 bool _wrt; 00047 LVecBase3 _posOffset; 00048 LQuaternion _quatOffset; 00049 00050 public: 00051 static TypeHandle get_class_type() { 00052 return _type_handle; 00053 } 00054 static void init_type() { 00055 CConstraintInterval::init_type(); 00056 register_type(_type_handle, "CConstrainPosHprInterval", 00057 CConstraintInterval::get_class_type()); 00058 } 00059 virtual TypeHandle get_type() const { 00060 return get_class_type(); 00061 } 00062 virtual TypeHandle force_init_type() {init_type(); return get_class_type();} 00063 00064 private: 00065 static TypeHandle _type_handle; 00066 }; 00067 00068 #include "cConstrainPosHprInterval.I" 00069 00070 #endif 00071