Panda3D
|
00001 // Filename: cConstrainHprInterval.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 CCONSTRAINHPRINTERVAL_H 00016 #define CCONSTRAINHPRINTERVAL_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 : CConstrainHprInterval 00026 // Description : A constraint interval that will constrain the 00027 // orientation of one node to the orientation of another. 00028 //////////////////////////////////////////////////////////////////// 00029 class EXPCL_DIRECT CConstrainHprInterval : public CConstraintInterval { 00030 PUBLISHED: 00031 CConstrainHprInterval(const string &name, double duration, 00032 const NodePath &node, const NodePath &target, 00033 bool wrt, const LVecBase3 hprOffset=LVector3::zero()); 00034 00035 INLINE const NodePath &get_node() const; 00036 INLINE const NodePath &get_target() const; 00037 00038 virtual void priv_step(double t); 00039 virtual void output(ostream &out) const; 00040 00041 private: 00042 NodePath _node; 00043 NodePath _target; 00044 bool _wrt; 00045 LQuaternion _quatOffset; 00046 00047 public: 00048 static TypeHandle get_class_type() { 00049 return _type_handle; 00050 } 00051 static void init_type() { 00052 CConstraintInterval::init_type(); 00053 register_type(_type_handle, "CConstrainHprInterval", 00054 CConstraintInterval::get_class_type()); 00055 } 00056 virtual TypeHandle get_type() const { 00057 return get_class_type(); 00058 } 00059 virtual TypeHandle force_init_type() {init_type(); return get_class_type();} 00060 00061 private: 00062 static TypeHandle _type_handle; 00063 }; 00064 00065 #include "cConstrainHprInterval.I" 00066 00067 #endif 00068