00001
00006
00007 #ifndef __KX_CONSTRAINTACTUATOR
00008 #define __KX_CONSTRAINTACTUATOR
00009
00010 #include "SCA_IActuator.h"
00011 #include "MT_Scalar.h"
00012
00013
00014 class KX_ConstraintActuator : public SCA_IActuator
00015 {
00016 Py_Header;
00017
00018
00019 int m_dampTime;
00020
00021 float m_minimumBound;
00022
00023 float m_maximumBound;
00024
00025 int m_locrot;
00026
00031 void Clamp(MT_Scalar &var, float min, float max);
00032
00033
00034 public:
00035 enum KX_CONSTRAINTTYPE {
00036 KX_ACT_CONSTRAINT_NODEF = 0,
00037 KX_ACT_CONSTRAINT_LOCX,
00038 KX_ACT_CONSTRAINT_LOCY,
00039 KX_ACT_CONSTRAINT_LOCZ,
00040 KX_ACT_CONSTRAINT_ROTX,
00041 KX_ACT_CONSTRAINT_ROTY,
00042 KX_ACT_CONSTRAINT_ROTZ,
00043 KX_ACT_CONSTRAINT_MAX
00044 };
00045
00046 bool IsValidMode(KX_CONSTRAINTTYPE m);
00047
00048 KX_ConstraintActuator(SCA_IObject* gameobj,
00049 int damptime,
00050 float min,
00051 float max,
00052 int locrot,
00053 PyTypeObject* T=&Type);
00054 virtual ~KX_ConstraintActuator();
00055 virtual CValue* GetReplica() {
00056 KX_ConstraintActuator* replica = new KX_ConstraintActuator(*this);
00057 replica->ProcessReplica();
00058
00059 CValue::AddDataToReplica(replica);
00060 return replica;
00061 };
00062
00063 virtual bool Update(double curtime,double deltatime);
00064
00065
00066
00067
00068
00069 virtual PyObject* _getattr(char *attr);
00070
00071 KX_PYMETHOD_DOC(KX_ConstraintActuator,SetDamp);
00072 KX_PYMETHOD_DOC(KX_ConstraintActuator,GetDamp);
00073 KX_PYMETHOD_DOC(KX_ConstraintActuator,SetMin);
00074 KX_PYMETHOD_DOC(KX_ConstraintActuator,GetMin);
00075 KX_PYMETHOD_DOC(KX_ConstraintActuator,SetMax);
00076 KX_PYMETHOD_DOC(KX_ConstraintActuator,GetMax);
00077 KX_PYMETHOD_DOC(KX_ConstraintActuator,SetLimit);
00078 KX_PYMETHOD_DOC(KX_ConstraintActuator,GetLimit);
00079
00080 };
00081 #endif //__KX_CONSTRAINTACTUATOR