Panda3D

cConstrainPosInterval.h

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