00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015 #ifndef LINEARCONTROLFORCE_H
00016 #define LINEARCONTROLFORCE_H
00017
00018 #include "linearForce.h"
00019
00020
00021
00022
00023
00024
00025
00026
00027
00028
00029 class EXPCL_PANDAPHYSICS LinearControlForce : public LinearForce {
00030 PUBLISHED:
00031 LinearControlForce(const PhysicsObject *po = 0, PN_stdfloat a = 1.0f,
00032 bool mass = false);
00033 LinearControlForce(const LinearControlForce ©);
00034 virtual ~LinearControlForce();
00035
00036 INLINE void clear_physics_object();
00037 INLINE void set_physics_object(const PhysicsObject *po);
00038 INLINE CPT(PhysicsObject) get_physics_object() const;
00039
00040 INLINE void set_vector(const LVector3& v);
00041 INLINE void set_vector(PN_stdfloat x, PN_stdfloat y, PN_stdfloat z);
00042
00043 INLINE LVector3 get_local_vector() const;
00044
00045 virtual void output(ostream &out) const;
00046 virtual void write(ostream &out, unsigned int indent=0) const;
00047
00048 private:
00049 CPT(PhysicsObject) _physics_object;
00050 LVector3 _fvec;
00051
00052 virtual LinearForce *make_copy();
00053 virtual LVector3 get_child_vector(const PhysicsObject *po);
00054
00055 public:
00056 static TypeHandle get_class_type() {
00057 return _type_handle;
00058 }
00059 static void init_type() {
00060 LinearForce::init_type();
00061 register_type(_type_handle, "LinearControlForce",
00062 LinearForce::get_class_type());
00063 }
00064 virtual TypeHandle get_type() const {
00065 return get_class_type();
00066 }
00067 virtual TypeHandle force_init_type() {init_type(); return get_class_type();}
00068
00069 private:
00070 static TypeHandle _type_handle;
00071 };
00072
00073 #include "linearControlForce.I"
00074
00075 #endif // LINEARCONTROLFORCE_H