Panda3D
 All Classes Functions Variables Enumerations
angularVectorForce.h
00001 // Filename: angularVectorForce.h
00002 // Created by:  charles (09Aug00)
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 ANGULARVECTORFORCE_H
00016 #define ANGULARVECTORFORCE_H
00017 
00018 #include "angularForce.h"
00019 
00020 ////////////////////////////////////////////////////////////////////
00021 //       Class : AngularVectorForce
00022 // Description : a simple directed torque force, the angular
00023 //               equivalent of simple vector force.
00024 ////////////////////////////////////////////////////////////////////
00025 class EXPCL_PANDAPHYSICS AngularVectorForce : public AngularForce {
00026 PUBLISHED:
00027   AngularVectorForce(const LRotation& quat);
00028   AngularVectorForce(PN_stdfloat h, PN_stdfloat p, PN_stdfloat r);
00029   AngularVectorForce(const AngularVectorForce &copy);
00030   virtual ~AngularVectorForce();
00031 
00032   INLINE void set_quat(const LRotation& quat);
00033   INLINE void set_hpr(PN_stdfloat h, PN_stdfloat p, PN_stdfloat r);
00034   INLINE LRotation get_local_quat() const;
00035   
00036   virtual void output(ostream &out) const;
00037   virtual void write(ostream &out, unsigned int indent=0) const;
00038 
00039 private:
00040   LRotation _fvec;
00041 
00042   virtual AngularForce *make_copy() const;
00043   virtual LRotation get_child_quat(const PhysicsObject *po);
00044 
00045 public:
00046   static TypeHandle get_class_type() {
00047     return _type_handle;
00048   }
00049   static void init_type() {
00050     AngularForce::init_type();
00051     register_type(_type_handle, "AngularVectorForce",
00052                   AngularForce::get_class_type());
00053   }
00054   virtual TypeHandle get_type() const {
00055     return get_class_type();
00056   }
00057   virtual TypeHandle force_init_type() {init_type(); return get_class_type();}
00058 
00059 private:
00060   static TypeHandle _type_handle;
00061 };
00062 
00063 #include "angularVectorForce.I"
00064 
00065 #endif // ANGULARVECTORFORCE_H
 All Classes Functions Variables Enumerations