00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015 #ifndef LINEARVECTORFORCE_H
00016 #define LINEARVECTORFORCE_H
00017
00018 #include "linearForce.h"
00019
00020
00021
00022
00023
00024
00025 class EXPCL_PANDAPHYSICS LinearVectorForce : public LinearForce {
00026 PUBLISHED:
00027 LinearVectorForce(const LVector3& vec, PN_stdfloat a = 1.0f, bool mass = false);
00028 LinearVectorForce(const LinearVectorForce ©);
00029 LinearVectorForce(PN_stdfloat x = 0.0f, PN_stdfloat y = 0.0f, PN_stdfloat z = 0.0f,
00030 PN_stdfloat a = 1.0f, bool mass = false);
00031 virtual ~LinearVectorForce();
00032
00033 INLINE void set_vector(const LVector3& v);
00034 INLINE void set_vector(PN_stdfloat x, PN_stdfloat y, PN_stdfloat z);
00035
00036 INLINE LVector3 get_local_vector() const;
00037
00038 virtual void output(ostream &out) const;
00039 virtual void write(ostream &out, unsigned int indent=0) const;
00040
00041 public:
00042 INLINE LinearVectorForce& operator += (const LinearVectorForce &other);
00043
00044 private:
00045 LVector3 _fvec;
00046
00047 virtual LinearForce *make_copy();
00048 virtual LVector3 get_child_vector(const PhysicsObject *po);
00049
00050 public:
00051 static TypeHandle get_class_type() {
00052 return _type_handle;
00053 }
00054 static void init_type() {
00055 LinearForce::init_type();
00056 register_type(_type_handle, "LinearVectorForce",
00057 LinearForce::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 "linearVectorForce.I"
00069
00070 #endif // LINEARVECTORFORCE_H