00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019 #ifndef LINEARFORCE_H
00020 #define LINEARFORCE_H
00021
00022 #include "baseForce.h"
00023
00024
00025
00026
00027
00028
00029 class EXPCL_PANDAPHYSICS LinearForce : public BaseForce {
00030 private:
00031 float _amplitude;
00032 bool _mass_dependent;
00033
00034 bool _x_mask;
00035 bool _y_mask;
00036 bool _z_mask;
00037
00038 virtual LVector3f get_child_vector(const PhysicsObject *po) = 0;
00039
00040 protected:
00041 LinearForce(float a, bool mass);
00042 LinearForce(const LinearForce& copy);
00043
00044 PUBLISHED:
00045 ~LinearForce(void);
00046
00047 INLINE void set_amplitude(const float a);
00048 INLINE void set_mass_dependent(bool m);
00049
00050 INLINE float get_amplitude(void) const;
00051 INLINE bool get_mass_dependent(void) const;
00052
00053 INLINE void set_vector_masks(bool x, bool y, bool z);
00054
00055 virtual LVector3f get_vector(const PhysicsObject *po);
00056
00057 virtual LinearForce *make_copy(void) = 0;
00058
00059 virtual bool is_linear(void) const;
00060
00061 public:
00062 static TypeHandle get_class_type(void) {
00063 return _type_handle;
00064 }
00065 static void init_type(void) {
00066 BaseForce::init_type();
00067 register_type(_type_handle, "LinearForce",
00068 BaseForce::get_class_type());
00069 }
00070 virtual TypeHandle get_type(void) const {
00071 return get_class_type();
00072 }
00073 virtual TypeHandle force_init_type() {init_type(); return get_class_type();}
00074
00075 private:
00076 static TypeHandle _type_handle;
00077 };
00078
00079 #include "linearForce.I"
00080
00081 #endif // BASELINEARFORCE_H