/***************************************************************
 * PrJointIntegrator.h
 *
 * This class provides the interface to the joint integrator.
 *
 ****************************************************************/

/*
 * modification history
 *----------------------
 *
 * 02/17/98: K.C. Chang: created.
 */

#ifndef _PrJointIntegrator_h
#define _PrJointIntegrator_h

#include "PrGlobalDefn.h"

#define PR_JOINTINTEGRATOR_OK              1
#define PR_JOINTINTEGRATOR_ERROR           0

#define PR_JOINTINTEGRATOR_NOJ_DEFAULT     6

class PrRobot;
class PrJointState;

class PrJointIntegrator
{
 public:
    PrJointIntegrator( int noj = PR_JOINTINTEGRATOR_NOJ_DEFAULT );
    ~PrJointIntegrator();

    int flag() { return flag_; }

    // current noj
    int noj() { return noj_; }

    void integrateEuler(PrRobot *robot,Float dt);
    void integrateRK4(PrRobot *robot,Float dt);
    
 private:
    int flag_;
    int noj_;
    PrJointState *k_[5];

    // Copy is not allowed
    PrJointIntegrator(const PrJointIntegrator &) {}
};

#endif // _PrJointIntegrator_h
