Main Page   Namespace List   Class Hierarchy   Compound List   File List   Compound Members   File Members  

SCA_RandomActuator.h

Go to the documentation of this file.
00001 
00007 
00008 #ifndef __KX_RANDOMACTUATOR
00009 #define __KX_RANDOMACTUATOR
00010 
00011 #include "SCA_IActuator.h"
00012 #include "SCA_RandomNumberGenerator.h"
00013 
00014 class SCA_RandomActuator : public SCA_IActuator
00015 {
00016         Py_Header;
00018         CCString m_propname;
00019         
00022         float m_parameter1;
00025         float m_parameter2;
00026 
00028         SCA_RandomNumberGenerator *m_base;
00029 
00031         int m_counter;
00032 
00034         long m_previous;
00035 
00037         void enforceConstraints(void);
00038         
00039  public:
00040 
00041         enum KX_RANDOMACT_MODE {
00042                 KX_RANDOMACT_NODEF,
00043                 KX_RANDOMACT_BOOL_CONST,
00044                 KX_RANDOMACT_BOOL_UNIFORM,
00045                 KX_RANDOMACT_BOOL_BERNOUILLI,           
00046                 KX_RANDOMACT_INT_CONST,
00047                 KX_RANDOMACT_INT_UNIFORM,
00048                 KX_RANDOMACT_INT_POISSON,               
00049                 KX_RANDOMACT_FLOAT_CONST,
00050                 KX_RANDOMACT_FLOAT_UNIFORM,
00051                 KX_RANDOMACT_FLOAT_NORMAL,
00052                 KX_RANDOMACT_FLOAT_NEGATIVE_EXPONENTIAL,
00053                 KX_RANDOMACT_MAX
00054         };
00056         KX_RANDOMACT_MODE m_distribution;
00057         
00058         SCA_RandomActuator(class SCA_IObject* gameobj,
00059                                           long seed,
00060                                           KX_RANDOMACT_MODE mode,
00061                                           float para1,
00062                                           float para2,
00063                                           const CCString &propName,
00064                                           PyTypeObject* T=&Type);
00065         virtual ~SCA_RandomActuator();
00066         virtual bool Update(double curtime,double deltatime);
00067         
00068         virtual CValue* GetReplica() {
00069                 SCA_RandomActuator* replica = new SCA_RandomActuator(*this);
00070                 replica->ProcessReplica();
00071                 CValue::AddDataToReplica(replica);
00072                 return replica;
00073         };
00074         
00075         /* --------------------------------------------------------------------- */
00076         /* Python interface ---------------------------------------------------- */
00077         /* --------------------------------------------------------------------- */
00078 
00079         virtual PyObject*  _getattr(char *attr);
00080 
00081         /* 1. setSeed                                                            */
00082         KX_PYMETHOD_DOC(SCA_RandomActuator,SetSeed);
00083         /* 2. getSeed                                                            */
00084         KX_PYMETHOD_DOC(SCA_RandomActuator,GetSeed);
00085         /* 3. setPara1 -removed-                                                 */
00086         /* 4. getPara1                                                           */
00087         KX_PYMETHOD_DOC(SCA_RandomActuator,GetPara1);
00088         /* 5. setPara2 -removed-                                                 */
00089         /* 6. getPara2                                                           */
00090         KX_PYMETHOD_DOC(SCA_RandomActuator,GetPara2);
00091         /* 7. setDistribution -removed-                                          */
00092         /* 8. getDistribution                                                    */
00093         KX_PYMETHOD_DOC(SCA_RandomActuator,GetDistribution);
00094         /* 9. setProperty                                                        */
00095         KX_PYMETHOD_DOC(SCA_RandomActuator,SetProperty);
00096         /* 10. getProperty                                                       */
00097         KX_PYMETHOD_DOC(SCA_RandomActuator,GetProperty);
00098         /* 11. setBoolConst                                                      */
00099         KX_PYMETHOD_DOC(SCA_RandomActuator,SetBoolConst);
00100         /* 12. setBoolUniform, */
00101         KX_PYMETHOD_DOC(SCA_RandomActuator,SetBoolUniform);
00102         /* 13. setBoolBernouilli,  */
00103         KX_PYMETHOD_DOC(SCA_RandomActuator,SetBoolBernouilli);
00104         /* 14. setIntConst,*/
00105         KX_PYMETHOD_DOC(SCA_RandomActuator,SetIntConst);
00106         /* 15. setIntUniform,*/
00107         KX_PYMETHOD_DOC(SCA_RandomActuator,SetIntUniform);
00108         /* 16. setIntPoisson,           */
00109         KX_PYMETHOD_DOC(SCA_RandomActuator,SetIntPoisson);
00110         /* 17. setFloatConst,*/
00111         KX_PYMETHOD_DOC(SCA_RandomActuator,SetFloatConst);
00112         /* 18. setFloatUniform, */
00113         KX_PYMETHOD_DOC(SCA_RandomActuator,SetFloatUniform);
00114         /* 19. setFloatNormal, */
00115         KX_PYMETHOD_DOC(SCA_RandomActuator,SetFloatNormal);
00116         /* 20. setFloatNegativeExponential, */
00117         KX_PYMETHOD_DOC(SCA_RandomActuator,SetFloatNegativeExponential);
00118         
00119 }; /* end of class KX_EditObjectActuator : public SCA_PropertyActuator */
00120 
00121 #endif

Generated at Thu Feb 1 13:03:11 2001 for Ketsji Game Engine by doxygen1.2.3 written by Dimitri van Heesch, © 1997-2000